agent-container/agent.aliases
Jeena 1b35ab0b2a aliases: Add -local variants to run tools on the host
The opencode, claude, and pi functions wrap the tools in the Docker
container. Add opencode-local, claude-local, and pi-local so the real
host binaries can be invoked directly when container isolation is not
needed. They use `command` to bypass the wrapping functions.
2026-09-09 09:35:25 +09:00

35 lines
775 B
Text

if [ -n "$BASH_VERSION" ]; then
AGENT_CONTAINER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
elif [ -n "$ZSH_VERSION" ]; then
AGENT_CONTAINER_DIR="${0:A:h}"
fi
opencode() {
python3 "$AGENT_CONTAINER_DIR/agent-container.py" opencode "$@"
}
claude() {
python3 "$AGENT_CONTAINER_DIR/agent-container.py" claude "$@"
}
pi() {
python3 "$AGENT_CONTAINER_DIR/agent-container.py" pi "$@"
}
agent-container() {
python3 "$AGENT_CONTAINER_DIR/agent-container.py" "$@"
}
# Local variants: run the tools directly on the host, bypassing the container.
# `command` skips the shell functions above so the real binaries are used.
opencode-local() {
command opencode "$@"
}
claude-local() {
command claude "$@"
}
pi-local() {
command pi "$@"
}