feat(cli): deepcode setup-token — long-lived auth token for CI#130
Merged
Conversation
§3.4 named `setup-token` but it didn't exist. DeepSeek has no OAuth device flow (unlike Claude Code), so the token is supplied directly — as an argument, via $DEEPSEEK_AUTH_TOKEN, or piped on stdin (`echo "$TOK" | deepcode setup-token`, the CI path) — and persisted to the credential store (Keychain on macOS, else chmod-600 file) as the Bearer credential, preserving any existing apiKey/baseURL. Wired into cli.ts dispatch + --help. Tests: +5 (arg / env / stdin-pipe / preserves-existing / usage-on-missing), all using forceFile so they never touch the real Keychain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
§3.4 named
deepcode setup-tokenbut it didn't exist (the audit's confirmed gap). DeepSeek has no OAuth device flow (unlike Claude Code's version), so the token is supplied directly and persisted to the credential store.Token source (first that's present): CLI argument →
$DEEPSEEK_AUTH_TOKEN→ piped stdin (echo "$TOK" | deepcode setup-token— the CI path). Stored as the Bearer credential (Keychain on macOS, chmod-600 file elsewhere), preserving any existingapiKey/baseURL. Missing token → usage + exit 2.Tests
+5 (
setup-token.test.ts): arg / env / stdin-pipe / preserves-existing-creds / usage-on-missing. All passforceFileso they write the file fallback and never touch the real Keychain. CLI suite 98 green.🤖 Generated with Claude Code