Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions dot_agents/shell/claude.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ function _claude_nono() {
"$@"
}

function _claude_acp() {
local profile="$1"
shift

# npm uses the uppercase form directly; lifecycle tooling may read the lowercase form.
local -x NPM_CONFIG_CACHE="$HOME/.claude/npm-cache"
local -x npm_config_cache="$NPM_CONFIG_CACHE"
mkdir -p "$NPM_CONFIG_CACHE" || return

local NONO_AGENT_ACP=1

_nono_agent_run \
"$profile" \
npx \
"${CLAUDE_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \
"${CLAUDE_SSH_SIGNING_KEY:-$HOME/.ssh/id_ed25519}" \
-y @agentclientprotocol/claude-agent-acp@latest \
"$@"
}

function claude() { _claude_nono my-claude-code "$@" }

function claude-chezmoi() { _claude_nono claude-code-chezmoi "$@" }
Expand All @@ -22,3 +42,7 @@ function claude-node() { _claude_nono claude-code-node "$@" }
function claude-python() { _claude_nono claude-code-python "$@" }

function claude-rust() { _claude_nono claude-code-rust "$@" }

function claude-acp() { _claude_acp my-claude-code "$@" }

function claude-chezmoi-acp() { _claude_acp claude-code-chezmoi "$@" }
13 changes: 7 additions & 6 deletions dot_agents/shell/codex.zsh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
function _codex_nono_run() {
function _codex_nono_with_npm_cache() {
# npm uses the uppercase form directly; lifecycle tooling may read the lowercase form.
local -x NPM_CONFIG_CACHE="$HOME/.codex/npm-cache"
local -x npm_config_cache="$NPM_CONFIG_CACHE"
mkdir -p "$NPM_CONFIG_CACHE" || return

_nono_agent_run "$@"
}

function _codex() {
function _codex_nono() {
local profile="$1"
shift

_codex_nono_run \
_codex_nono_with_npm_cache \
"$profile" \
codex \
"${CODEX_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \
Expand All @@ -25,7 +26,7 @@ function _codex_acp() {
local NONO_AGENT_ACP=1
local -x INITIAL_AGENT_MODE=agent-full-access

_codex_nono_run \
_codex_nono_with_npm_cache \
"$profile" \
npx \
"${CODEX_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \
Expand All @@ -34,9 +35,9 @@ function _codex_acp() {
"$@"
}

function codex() { _codex my-codex "$@" }
function codex() { _codex_nono my-codex "$@" }

function codex-chezmoi() { _codex codex-chezmoi "$@" }
function codex-chezmoi() { _codex_nono codex-chezmoi "$@" }

function codex-acp() { _codex_acp my-codex "$@" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ export PATH

profile="${1:-}"
case "$profile" in
codex|my-codex|codex-*)
claude|my-claude-code|claude-code-*|work-*-claude-code|work-*-claude-code-*)
[[ "$profile" == claude ]] && profile=my-claude-code
source "$HOME/.nvm/nvm.sh" || exit
nvm use --silent default || exit
agent_shell_config="$HOME/.agents/shell/claude.zsh"
runtime=claude
;;
codex|my-codex|codex-*|work-*-codex|work-*-codex-*)
[[ "$profile" == codex ]] && profile=my-codex
source "$HOME/.nvm/nvm.sh" || exit
nvm use --silent default || exit
agent_shell_config="$HOME/.agents/shell/codex.zsh"
runtime=codex
;;
opencode|my-opencode|opencode-*)
opencode|my-opencode|opencode-*|work-*-opencode|work-*-opencode-*)
[[ "$profile" == opencode ]] && profile=my-opencode
agent_shell_config="$HOME/.agents/shell/opencode.zsh"
runtime=opencode
;;
*)
print -u2 'Usage: zed-agent-acp {codex|my-codex|codex-*|opencode|my-opencode|opencode-*} [args...]'
print -u2 'Usage: nono-agent-acp {claude|my-claude-code|claude-code-*|codex|my-codex|codex-*|opencode|my-opencode|opencode-*|work-*-<agent>[-*]} [args...]'
exit 2
;;
esac
Expand All @@ -28,6 +35,7 @@ source "$HOME/.agents/shell/nono.zsh" || exit
source "$agent_shell_config" || exit

case "$runtime" in
claude) _claude_acp "$profile" "$@" ;;
codex) _codex_acp "$profile" "$@" ;;
opencode) _opencode_nono "$profile" acp "$@" ;;
esac
Loading