Skip to content

feat(PRLT-1369): support multiple Claude accounts via --executor-env / --executor-bin#1262

Open
chrismcdermut wants to merge 1 commit into
mainfrom
PRLT-1369/feat/support-multiple-cla
Open

feat(PRLT-1369): support multiple Claude accounts via --executor-env / --executor-bin#1262
chrismcdermut wants to merge 1 commit into
mainfrom
PRLT-1369/feat/support-multiple-cla

Conversation

@chrismcdermut
Copy link
Copy Markdown
Owner

Summary

  • Adds two new flags to all spawn-style commands that let users point a spawned executor at a different Claude account or wrap it with a custom binary, without changing the executor type:
    • --executor-env KEY=VALUE (repeatable) — sets env vars on the spawned executor (e.g. CLAUDE_CONFIG_DIR=$HOME/.claude-work to switch accounts).
    • --executor-bin <path> — overrides the executor binary (e.g. an absolute path or wrapper script).
  • Wired through work start, work spawn, work run, orchestrator start, claude, qa, and agent shell.
  • Threaded into runners: host (export lines in tmux script), devcontainer (docker exec -e KEY=VALUE), docker (docker run -e), cloud (env prefix on remote ssh command), and the inline agent shell claude/docker exec.
  • Backward compatible — omitting the flags behaves exactly as before.

Implementation notes

  • New helper module apps/cli/src/lib/execution/executor-overrides.ts with: parseExecutorEnv, buildShellExports, buildDockerEnvFlags, executorOverrideFlags, readExecutorOverridesFromFlags. Single source of truth for parsing/escaping.
  • getExecutorCommand gained an optional 4th binOverride arg so all runners can swap the binary uniformly. 'custom' executor with --executor-bin finally produces a real command instead of the echo fallback.
  • ExecutionContext and SpawnOptions extended with executorEnv?: Record<string, string> and executorBin?: string. Runners read them off the context — no new arguments to the dispatcher.

Test plan

  • New unit tests in apps/cli/test/unit/executor-overrides.test.ts (22 tests) covering parser, shell/docker fragment builders, flag reader, and getExecutorCommand binOverride paths
  • Existing executor command suite (31 tests) still passes
  • pnpm build clean
  • Manual verification: `prlt work start --executor-env CLAUDE_CONFIG_DIR=$HOME/.claude-work` spawns an agent against the alternate account
  • Manual verification: same flag works on a devcontainer agent (env var set inside container via `docker exec -e`)

🤖 Generated with Claude Code

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