feat(auth): add named auth profiles#7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds named auth profiles to the CLI while preserving the existing single-token config and PUTIO_CLI_TOKEN override semantics. Profile selection is driven by --profile, PUTIO_CLI_PROFILE, or a persisted default_profile, with new auth profiles list/use/remove subcommands and updated status/login/logout flows.
Changes:
- Extends config schema and
CliStateservice with profile-aware load/save/clear/list/use/remove and a new"profile"auth source. - Adds
--profiletoauth login/status/logout, newauth profilessubcommands, profile arg/flag schema incommand-specs,PUTIO_CLI_PROFILEenv wiring, and profile metadata indescribe. - Updates README, architecture notes, skill docs, i18n strings, and tests (state/CLI/command-paths/metadata/config) for profile behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/internal/state.ts | Adds profile schemas, validation, and profile-aware save/clear/list/use/remove/resolve effects. |
| src/internal/state.test.ts | Tests for profile save/list/use/remove/logout and env precedence. |
| src/internal/auth-profile.ts | New profile-name pattern, description, and normalizer. |
| src/internal/config.ts | Adds PUTIO_CLI_PROFILE to runtime config. |
| src/internal/config.test.ts | Adds profile to runtime config expectation. |
| src/internal/env.ts | Exports ENV_CLI_PROFILE. |
| src/internal/command-specs.ts | Adds CommandArgument schema and stringArgument helper. |
| src/internal/metadata.ts | Includes profiles/default_profile and profileEnv in metadata. |
| src/internal/metadata.test.ts | Asserts new auth profiles commands and profileEnv. |
| src/internal/terminal/auth-terminal.ts | Renders saved profile in login success panel. |
| src/commands/auth.ts | Wires --profile, new auth profiles subcommands, profile validation, updated status/login/logout. |
| src/i18n/catalog/en.ts | New strings for profile commands, status, and login success. |
| src/cli.test.ts | New auth status/profiles list JSON assertions. |
| src/command-paths.test.ts | Profile flow assertions for login/status/logout/profiles. |
| src/test-support/command-path-mocks.ts | Mocks for new profile-aware state service methods. |
| README.md, docs/ARCHITECTURE.md, skills/putio-cli/*.md | Documentation for profile precedence and usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
Adds named auth profiles for stable automation sessions while preserving the existing single-token config path and
PUTIO_CLI_TOKENoverride behavior.Changed
PUTIO_CLI_PROFILEselection.auth login/status/logout --profile,auth profiles list/use/remove, and profile metadata indescribe.devs-fe-autoharness usage and auth precedence.Risks
Verification
pnpm exec vp run verifypnpm exec tsc --noEmit./dist/bin.mjs describe./dist/bin.mjs auth status --output jsonPUTIO_CLI_PROFILE=devs-fe-autopnpm exec vp run smoke:pack$HOME/.agents/skills/codex-review/scripts/codex-review --mode autocleanComplexity
Increased: auth state now has legacy and profile-aware resolution paths, kept in internal helpers/services with command modules staying thin.