-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagentshell.bash
More file actions
72 lines (64 loc) · 1.58 KB
/
Copy pathagentshell.bash
File metadata and controls
72 lines (64 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
# Optional Bash integration. Account routing is only activated when the first
# argument is --account/--project; all ordinary commands retain native behavior.
__agentshell_has_account_option() {
case "${1:-}" in
--account|--account=*|--project|--project=*) return 0 ;;
*) return 1 ;;
esac
}
codex() {
if __agentshell_has_account_option "${1:-}"; then
command agent-codex "$@"
elif [ -x "$HOME/scripts/codex_wrapper.sh" ]; then
"$HOME/scripts/codex_wrapper.sh" codex "$@"
else
command codex "$@"
fi
}
codexr() {
if __agentshell_has_account_option "${1:-}"; then
command agent-codexr "$@"
elif [ -x "$HOME/scripts/codex_wrapper.sh" ]; then
"$HOME/scripts/codex_wrapper.sh" codexr "$@"
else
command codex resume "$@"
fi
}
codexmv() {
if __agentshell_has_account_option "${1:-}"; then
command agent-codexmv "$@"
elif [ -x "$HOME/scripts/codex_wrapper.sh" ]; then
"$HOME/scripts/codex_wrapper.sh" codexmv "$@"
else
command codexmv "$@"
fi
}
if type -P claude >/dev/null 2>&1; then
claude() {
if __agentshell_has_account_option "${1:-}"; then
command agent-claude "$@"
else
command claude "$@"
fi
}
fi
if type -P gemini >/dev/null 2>&1; then
gemini() {
if __agentshell_has_account_option "${1:-}"; then
command agent-gemini "$@"
else
command gemini "$@"
fi
}
fi
if type -P copilot >/dev/null 2>&1; then
copilot() {
if __agentshell_has_account_option "${1:-}"; then
command agent-copilot "$@"
else
command copilot "$@"
fi
}
fi
alias cr='codexr'