Add non-interactive mode to profiles create command#61
Merged
Conversation
f50a002 to
354f651
Compare
…l options to allow programmatic profile creation. This enables the VSCode extension and other tools to create profiles without user interaction. Changes: Added create_profile_non_interactive method to ProfileManager Added CLI options: --region, --api-token, --api-url, --non-interactive, --output-mode Added JSON output mode for machine-readable responses Validates credentials and region before creating profile
354f651 to
5e6296e
Compare
- Add type annotation for region_info to ensure it's typed as RegionInfo - Use temporary variable for dict.get() result to narrow type properly - Add validation for required parameters before calling non-interactive helper - Fix line length lint error by splitting RegionInfo construction Fixes type errors: - Incompatible types in assignment for region_info - Incompatible arg types for _create_profile_non_interactive
hovu96
requested changes
Feb 5, 2026
hovu96
requested changes
Feb 5, 2026
Contributor
hovu96
left a comment
There was a problem hiding this comment.
Also think about if we should cover this in unit tests
The validation for region and api_token is now done at the call site in create() to satisfy mypy type checking. Removed the redundant checks from inside _create_profile_non_interactive() to avoid duplication. Kept the api_url validation since it's specific to the custom region case.
- Change all error returns to raise SystemExit(1) in profiles create command - This ensures the CLI exits with proper error codes when: - Profile already exists - Authentication fails - Keyring storage fails - User cancels interactive setup - Update tests to expect SystemExit(1) on error cases Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
960c1f7 to
8a94562
Compare
- Add 'from None' to SystemExit in ClickException handler - Add 'from e' to SystemExit in ValueError handler - Properly chains exception context per ruff B904 rule
8a94562 to
32d4688
Compare
Contributor
Author
added unit tests |
hovu96
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added --non-interactive flag with --region, --api-token, and --api-url options to allow programmatic profile creation. This enables the VSCode extension and other tools to create profiles without user interaction.
Changes: