feat: Linux support + drop credential gate from passthrough#22
Draft
diranged wants to merge 4 commits into
Draft
feat: Linux support + drop credential gate from passthrough#22diranged wants to merge 4 commits into
diranged wants to merge 4 commits into
Conversation
Splits the macOS `security` CLI shell-outs in internal/profile out into darwin-only helper methods, with stubs on non-darwin builds that fall through to the existing .credentials.json path. Claude Code itself writes .credentials.json (mode 0600) into CLAUDE_CONFIG_DIR on Linux, so profile isolation works end-to-end without a Linux secret-store backend. Adds a hack/Dockerfile.linux-test smoke harness with make docker-test for exercising the linux binary locally. Refs #21 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The gate (\`profile %q has no credentials\`) tried to fail fast when a profile had no creds, but it duplicated work claude already does when launched without auth and forced us to track claude's auth subcommand surface (\`isAuthCmd\`, \`hasExternalAuth\`). It also blocked legitimate bootstrap paths the gate didn't know about: TUI \`/login\`, \`setup-token\`, or seeded \`.credentials.json\` files. The banner already reports \`Auth: none\` so the user isn't flying blind. Let claude render its own no-creds message and exit when appropriate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Reframe credential storage to give the Linux .credentials.json path equal billing alongside the macOS keychain (it's the default on Linux, not a degraded fallback). - Document the build-tag layout for keychain helpers (profile_darwin.go / profile_other.go) in ARCHITECTURE.md. - Add `make docker-test` to DEVELOPMENT.md. - Drop "skips keychain check" wording from the Bedrock/Vertex/API-key sections; the gate is gone. Co-Authored-By: Claude Opus 4.7 (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
securityCLI shell-outs ininternal/profileinto darwin-only helpers (keychainHas/keychainRead/keychainDelete) gated by//go:build, with no-op stubs on!darwinthat fall through to the existing.credentials.jsoncodepath. Claude Code itself writes.credentials.json(mode 0600) intoCLAUDE_CONFIG_DIRon Linux, so profile isolation works end-to-end without a Linux secret-store backend.profile %q has no credentialspre-flight inpassthrough.go. It duplicated work claude already does, hardcodedauth loginas the only bootstrap path (which is broken on Linux), and forced us to track claude's auth subcommand surface (isAuthCmd,hasExternalAuth). Banner still reportsAuth: none, so the user isn't flying blind -- claude renders its own no-creds message and exits when appropriate.hack/Dockerfile.linux-test+make docker-testso the linux binary can be exercised locally without a real linux box.Closes #21
Test plan
go build ./...andgo vet ./...clean on darwin andGOOS=linux GOARCH=amd64go test ./internal/profile/passes on darwinmake docker-test-buildsucceeds (golang:1.25-bookworm + Claude Code via npm)claude-profile listshows a seeded profile withauth=fileclaude-profile show workparses.credentials.json(subscription, rate limit, scopes)strace -f -e execveconfirms thesecurityCLI is never invokedclaude-profile delete workcleans up the dir without calling keychainclaude-profile -P mattexec's straight into claude TUI;/loginworks thereauth=keychainprofile still works;deletestill removes the keychain entry tooNotes
internal/cli/statusline_test.go::TestStatuslineCmd_DefaultColorreproduces on a cleanmaincheckout. Not addressed here.🤖 Generated with Claude Code