Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK/CLI] added autocompletion for pf cli #2534

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

sashokbg
Copy link
Contributor

@sashokbg sashokbg commented Mar 28, 2024

Description

This pull request adds shell (bash / zsh) autocompletion for the "pf" cli tool.
It is based on "argcomplete" library https://kislyuk.github.io/argcomplete/ and inspired by "az" cli

All Promptflow Contribution checklist:

  • The pull request does not introduce [breaking changes].
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: suggested workflow.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@sashokbg
Copy link
Contributor Author

Hello @wangchao1230 I created this PR as a draft related to #2446
Can you please tell me if I am on the right track before I continue with the rest it ?

Thank you and have a nice day

@wangchao1230 wangchao1230 linked an issue Mar 29, 2024 that may be closed by this pull request
@wangchao1230
Copy link
Contributor

Hello @wangchao1230 I created this PR as a draft related to #2446 Can you please tell me if I am on the right track before I continue with the rest it ?

Thank you and have a nice day

I think we are on the right track. However we are doing a major refactor to layering our sdk into several packages recently. And which has caused some conflict to your PR.

  • @YingChen1996 to help you on that, and help you merge to main finally

@github-actions github-actions bot added the cli prompt flow CLI label Mar 29, 2024
@sashokbg
Copy link
Contributor Author

@sashokbg please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@sashokbg
Copy link
Contributor Author

Hello @wangchao1230 I have rebased the MR and added some description per your comments.

@YingChen1996 can you please help me with how the pf.autocomplete.sh needs to be sourced ?
Do we need to include it in the final "distribution" alongside the "pf" executable ?
Do we need to update the .zshhrc file of the client ?

Thank you for your help

@YingChen1996
Copy link
Contributor

Hello @wangchao1230 I have rebased the MR and added some description per your comments.

@YingChen1996 can you please help me with how the pf.autocomplete.sh needs to be sourced ? Do we need to include it in the final "distribution" alongside the "pf" executable ? Do we need to update the .zshhrc file of the client ?

Thank you for your help

Hi, @sashokbg .

  1. Yeah, I think user need add source pf.autocomplete.sh in their ~/.bashrc, ~/.zshrc or ~/.bash_profile. Maybe we need add this note in the document.
  2. Yes, we need include it in the final "distribution" alongside the "pf" executable.
  3. What do you mean update the .zshhrc file of the client? I think it's likely similar to the first question, user need udpate .zshhrc file to source pf.autocomplete.sh in zshell

@sashokbg
Copy link
Contributor Author

sashokbg commented Apr 2, 2024

Hello @wangchao1230 I have rebased the MR and added some description per your comments.
@YingChen1996 can you please help me with how the pf.autocomplete.sh needs to be sourced ? Do we need to include it in the final "distribution" alongside the "pf" executable ? Do we need to update the .zshhrc file of the client ?
Thank you for your help

Hi, @sashokbg .

  1. Yeah, I think user need add source pf.autocomplete.sh in their ~/.bashrc, ~/.zshrc or ~/.bash_profile. Maybe we need add this note in the document.
  2. Yes, we need include it in the final "distribution" alongside the "pf" executable.
  3. What do you mean update the .zshhrc file of the client? I think it's likely similar to the first question, user need udpate .zshhrc file to source pf.autocomplete.sh in zshell

Hello @YingChen1996 ok I will take care of the rest.
Can you point to me how do we include a file in the final distribution please ?

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 5, 2024
@sashokbg sashokbg marked this pull request as ready for review April 5, 2024 10:24
@sashokbg sashokbg requested review from a team as code owners April 5, 2024 10:24
@sashokbg
Copy link
Contributor Author

sashokbg commented Apr 5, 2024

Hello @YingChen1996 @wangchao1230 I updated my pull request to "ready for review".
Can you please take a look ?

@wangchao1230 wangchao1230 merged commit 8332f12 into microsoft:main Apr 10, 2024
38 of 39 checks passed
@wangchao1230
Copy link
Contributor

Thanks @sashokbg for your contribution! I have merged the PR.
You can expect this changes goes in 1.9.0, which should come next week if goes well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli prompt flow CLI documentation Improvements or additions to documentation external promptflow promptflow-devkit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] pf autocomplete
4 participants