Apply agent account selection to CLI subprocesses (#14233)

* Apply agent account selection to CLI subprocesses

* Fix account dispatch edge cases and remove redundant shell wrappers

* Use the current account when launching a new agent session
This commit is contained in:
David Heinemeier Hansson authored and GitHub committed 2026-10-04 09:01:06 -04:00
1 parent 5657a91f8d
commit f9646299bf
15 files changed
+351 -67

No files matched your search

-35
View File
@@ -1,35 +0,0 @@
# Start Claude Code, Codex, and Grok as the active subscription account, so
# `cx`, `cy`, `tdl` and a plain `claude` all follow `omarchy agent account use`.
# An explicitly set CLAUDE_CONFIG_DIR / CODEX_HOME / GROK_HOME still wins.
claude() {
local home=""
[[ -z ${CLAUDE_CONFIG_DIR:-} ]] && home=$(omarchy-agent-account-home claude)
if [[ -n $home ]]; then
CLAUDE_CONFIG_DIR="$home" command claude "$@"
else
command claude "$@"
fi
}
codex() {
local home=""
[[ -z ${CODEX_HOME:-} ]] && home=$(omarchy-agent-account-home codex)
if [[ -n $home ]]; then
CODEX_HOME="$home" command codex "$@"
else
command codex "$@"
fi
}
grok() {
local home=""
[[ -z ${GROK_HOME:-} ]] && home=$(omarchy-agent-account-home grok)
if [[ -n $home ]]; then
GROK_HOME="$home" command grok "$@"
else
command grok "$@"
fi
}