Skip to content

feat(cli): deepcode setup-token — long-lived auth token for CI#130

Merged
oratis merged 1 commit into
mainfrom
feat/cli-setup-token
May 31, 2026
Merged

feat(cli): deepcode setup-token — long-lived auth token for CI#130
oratis merged 1 commit into
mainfrom
feat/cli-setup-token

Conversation

@oratis
Copy link
Copy Markdown
Owner

@oratis oratis commented May 31, 2026

Summary

§3.4 named deepcode setup-token but 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 existing apiKey/baseURL. Missing token → usage + exit 2.

Tests

+5 (setup-token.test.ts): arg / env / stdin-pipe / preserves-existing-creds / usage-on-missing. All pass forceFile so they write the file fallback and never touch the real Keychain. CLI suite 98 green.

🤖 Generated with Claude Code

§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>
@oratis oratis merged commit 183be31 into main May 31, 2026
3 checks passed
@oratis oratis deleted the feat/cli-setup-token branch May 31, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant