-
Notifications
You must be signed in to change notification settings - Fork 7
[PR-739] [PR-740] Unify Context Management Under a Single config Command #709
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR unifies context management under a single context
command by reorganizing CLI commands for better user experience. It consolidates context-related functionality that was previously scattered across different command groups into a cohesive interface.
- Replaced the
config
command group with a unifiedcontext
command group - Moved the
login
command from top-level to remain at top-level while organizing context subcommands - Added comprehensive documentation for context management commands
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
clarifai/cli/base.py | Restructures CLI commands by removing config group and organizing context subcommands with improved naming and documentation |
clarifai/cli/README.md | Adds comprehensive documentation section for context management commands with usage examples |
Comments suppressed due to low confidence (1)
clarifai/cli/base.py:105
- The pat_display function is defined but not used in this diff. Consider adding tests to verify it correctly masks personal access tokens.
def pat_display(pat):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
clarifai/cli/README.md
Outdated
``` | ||
# Show current context | ||
```bash | ||
clarifai config get-current-context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can shorten it e.g clarifai config current
? And may be other clis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh update the readme, we are using clarifai config current-context
. Currently we are using cli commands consistent with kubectl context CLI
```bash | ||
clarifai context create <name> --user-id <user_id> --base-url <base_url> --pat <token> | ||
clarifai config create-context staging --user-id myuser --pat 678*** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be set-context
according to kubectl
commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, I'm not sure because Matt also used create-context
in the initial setup instead of set-context
. we could add alias for set-context
Minimum allowed line rate is |
…and (#709) * Unify Context Management Under a Single context Command * login func * improvemensts and fix tests * better alias * active to current * Unify config * Update readme * fix test * update readme * update readme * update readme * add set-context alias
* Initial plan * Implement CLI config context fallback in BaseClient Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> * Remove tests/test_base_client_cli_config.py file as requested Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> * Remove tests/test_misc_cli_config.py as requested Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> * [PR-725]: Using Config Context in Baseclient class * Improve error message formatting and clarity in authentication Co-authored-by: luv-bansal <70321430+luv-bansal@users.noreply.github.com> * Add github folder download support and toolkit option in model init (#699) * added github folder download support * modified folder structure validation * supported toolkit options for ollama * fixed param name and toolkit bugs * removed print in misc.py * updated with log and raise * Update clarifai/utils/misc.py Co-authored-by: Srikanth Bachala <srikanth.bachala@clarifai.com> --------- Co-authored-by: Srikanth Bachala <srikanth.bachala@clarifai.com> * Improve client script formatting (black linter formatting) and added logger once runner start (#705) * VERSION-11.5.5 * Black linter to fix stylistic issues and ensure it follows to common Python standards * better representation * fix formatting * fix formatting * fix formatting * [PR-727]: Improve Local-Runner CLI Logging (#706) * [PR-727]: Improve Local-Runner CLI Logging * [PR-727]: Improve Local-Runner CLI Logging * [PR-727]: Improve Local-Runner CLI Logging * [PR-727]: Improve Local-Runner CLI Logging * PR-323 Unit tests for toolkits. (#639) * added initial vllm unit tests * modified permissions for maintainer_tests.yml * modified yaml file * removed codecoverage for maintainer tests * modified env vars for tests * added labels to tests * removed inputs in workflow disptach * added pytest.ini * removed unused functions * added --enforce-eager option * removed redundant URL logging * Added Playground URL to Local-Runner Logs (#708) * [PR-733] Improve URL Download error handling (#710) * Improve error handling * Improve error handling * Improve error handling * Added local-runner requirements validation step (#712) * added local-runner requirements validation step * added post check for ollama toolkit * fixed tests * [EAGLE-6460]: Add func to return both stub and channel. (#713) * Add func to return both stub and channel. * tidy * [PR-739] [PR-740] Unify Context Management Under a Single config Command (#709) * Unify Context Management Under a Single context Command * login func * improvemensts and fix tests * better alias * active to current * Unify config * Update readme * fix test * update readme * update readme * update readme * add set-context alias * Initial plan * [PR-725]: Using Config Context in Baseclient class --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com> Co-authored-by: Srikanth Bachala <srikanth.bachala@clarifai.com> Co-authored-by: luv-bansal <70321430+luv-bansal@users.noreply.github.com> Co-authored-by: mogith-pn <143642606+mogith-pn@users.noreply.github.com> Co-authored-by: Patrick Lundquist <1460278+patricklundquist@users.noreply.github.com>
Pull Request Overview
This PR unifies context management under a single
context
command by reorganizing CLI commands for better user experience. It consolidates context-related functionality that was previously scattered across different command groups into a cohesive interface.config
command group with a unifiedcontext
command grouplogin
command from top-level to remain at top-level while organizing context subcommands