rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:trmquang93/dsh-claude-code-account
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Use a Claude Code sign-in (Claude Pro/Max subscription) as a DSH model provider.
Claude Code keeps its OAuth grant in the login keychain, one item per
CLAUDE_CONFIG_DIR. DSH's pi-ai adapter keeps its own copy of that grant in the
credential record llm-pi-ai/<provider> and refreshes it when it expires. This
plugin keeps both sides on the same rotating chain, so
anthropic route)
with no second OAuth sign-in, andIt refreshes once when neither side holds a usable access token, and mirrors whichever side already holds the fresher valid grant (so a refresh DSH performed itself is repaired back into the keychain instead of being spent twice).
dsh plugin --profile <name> add @trmquang93/dsh-claude-code-account
The package ships prebuilt JavaScript, so the install runs no build script and
needs no permission. It declares a bundle: dsh appends it to the profile's
dsh.profile.bundles and applies its patch on the next boot. Signing in to
Claude Code first is optional — the plugin reports a missing login instead of
failing the boot.
The route is configuration, not code. DSH's last patch layer — the profile's
own $DSH_HOME/profiles/<profile>/cordis.patch.yml — must list anthropic
under llm-pi-ai.providers. Keep the route key equal to the plugin's
provider:
- id: llm-pi-ai
name: '@deepseek-ai/dsh-llm-pi-ai'
config:
providers:
opencode-go:
apiKeyEnv: OPENCODE_GO_API_KEY
openrouter:
apiKeyEnv: OPENROUTER_API_KEY
anthropic:
displayName: Claude Code (personal)
The plugin ships its own Claude model list (models.json) and serves it on the
route, so new models appear without waiting for the app's bundled pi-ai. A
models list set on the route in the profile wins over it.
Set the route's displayName to the account it is wired to; the plugin writes
the credential and never the route.
- id: claude-code-account
name: '@trmquang93/dsh-claude-code-account'
config:
account: default # default/work → ~/.claude, personal → ~/.claude-personal
provider: anthropic # pi-ai route whose record this plugin owns
accounts: # optional: extra name → config-dir map
personal: .claude-personal
work: .claude
configDir: /abs/dir # optional: an absolute CLAUDE_CONFIG_DIR instead
refreshLeadMs: 600000 # refresh when the access token is this close
intervalMs: 300000 # how often the timer re-checks
writeBack: true # write rotated tokens back into the keychain
claudeCommand: claude # used for `claude auth status --json` metadata
The account name selects the Claude Code config directory, and the directory selects the keychain item:
| account | config dir | keychain service |
|---|---|---|
default, work |
~/.claude |
Claude Code-credentials |
personal |
~/.claude-personal |
Claude Code-credentials-<sha256(absolute dir)[:8]> |
any configDir |
that directory | Claude Code-credentials, or the suffix above for a non-default directory |
That is exactly how Claude Code namespaces several logins in one keychain, so a
second login at ~/.claude-personal resolves to its own suffixed item
(sha256("<home>/.claude-personal")[:8]).
claude auth login, or
CLAUDE_CONFIG_DIR=~/.claude-personal claude auth login for a second one.anthropic route is in the profile patch (above). DSH applies
patch changes live with HMR.llm-pi-ai/anthropic.claude_code_account (tool) or read the startup log line for the account
email, plan and access-token expiry.The tool returns no secret values:
{
"account": "personal",
"configDir": "/Users/quangtran/.claude-personal",
"keychainService": "Claude Code-credentials-6195afbc",
"provider": "anthropic",
"providerRegistered": true,
"email": "trmquang@icloud.com",
"subscriptionType": "pro",
"accessExpiresAt": "2026-11-10T19:10:43.114Z",
"accessExpiresInMinutes": 469,
"source": "keychain",
"recordConfigured": true
}
action: "sync" forces a reconcile pass (refreshing when needed).
llm-pi-ai/<provider>. Signing out or signing in to the
same route from the Models page writes the same record; the next timer pass
restores the Claude Code account's grant. Use another route key (and another
provider in this plugin's config) if the two must coexist.security to update the item; the sync then still updates DSH
but the CLI keeps its old chain. The record reports the failure via
lastError; re-enable the CLI by running claude auth login for the account.run "claude auth login" message instead of silently leaving DSH keyless.<configDir>/.credentials.json, which is where Claude Code stores its grant
on Linux. Nothing else is platform-specific.claude auth login.npm test
npm publish # publishConfig sets access:public and the public registry
Bump version first; files limits the tarball to the entry points, the patch,
the README and the LICENSE.
node --test test/ covers the decision logic (which side wins, when a network
refresh happens, write-back), the keychain-service naming, document merging, and
the record shape, all with injected fakes.
claude_code_account (tool) or the startup log line reports the account email,
plan and access-token expiry; action: "sync" forces a reconcile./model) lists a Claude Code (personal) group
once the anthropic route is configured.CLAUDE_CONFIG_DIR=~/.claude-personal claude auth status and a one-shot
claude -p "ok" must still work: that proves the write-back preserved the
CLI login.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm、anthropic。