add --from-live flag to aisw add#7
Merged
burakdede merged 6 commits intoburakdede:mainfrom Apr 19, 2026
Merged
Conversation
Closed
burakdede
reviewed
Apr 17, 2026
burakdede
reviewed
Apr 17, 2026
Owner
|
Thanks @JulioJair, overall PR looks solid with baseline tests for But for this new functionality, I’d still call test coverage partial considering my goal is to reliably support 3 coding agents.
Aside from PR comments, adding those would get this to mergeable state. |
Contributor
Author
|
Added 7 tests covering the gaps you noted: Codex API-key live shape ( |
Owner
|
@JulioJair can you rebase with main and run the pipeline again? If tests pass, this PR is good to go. |
Captures whatever credentials the tool currently has in its live config and stores them as a new aisw-managed profile without launching any login flow. This is the recovery path when a native tool login (claude login, codex login, gemini login) already succeeded but aisw add was not used. Supported for all three tools, reading from each tool's live credential location: - Claude: ~/.claude/.credentials.json or system keyring (macOS) - Codex: ~/.codex/auth.json - Gemini: ~/.gemini/.env (API key) or OAuth files in ~/.gemini/ Deduplication and overwrite-confirmation logic match the existing add command. Activation follows --set-active semantics (opt-in, same as all other add paths). --yes skips the overwrite prompt. Adds --from-live and --yes to completions (bash, zsh, fish) and docs. New tests cover profile creation, stored-not-active default, overwrite with --yes, and the no-credentials error path for all three tools.
Credentials captured with --from-live are already the live credentials, so the profile is activated unconditionally rather than requiring --set-active. --set-active is a no-op for --from-live and ignored.
6ebab7d to
d74ffdb
Compare
burakdede
approved these changes
Apr 19, 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.
Problem
aisw addruns a full interactive login flow. When it fails or is interrupted, the nativeclaude login/codex login/gemini loginis always available as a fallback — but there was no way to hand those credentials over to aisw afterward.Solution
aisw add <tool> <profile_name> --from-livecaptures whatever credentials the tool currently has in its live config and stores them as a new aisw-managed profile — no login flow launched. The profile is always activated immediately, since those credentials are already live by definition.This is the recovery/adoption path for cases where a native tool login already succeeded but aisw was not used.
--from-livefits within the existingaddmodel alongside--api-key,--from-env, and interactive OAuth.Scope
Supports all three tools, reading from each tool's live config location:
--yesskips the overwrite prompt when a same-name profile already exists. Deduplication identity checks match existingaddbehavior.Changes
src/cli.rs—--from-liveand--yesadded toAddArgssrc/commands/add.rs—--from-livebranch + per-tool capture functions + 12 new testscompletions/— bash, zsh, fish updated for new flagsdocs/commands.md—--from-livedocumented underaisw addAll 369 existing tests pass. New tests cover profile creation, auto-activation, overwrite with
--yes, and the no-credentials error path for all three tools.Closes #6