[add] zshrc
This commit is contained in:
parent
120eb67b02
commit
692edb9c09
1 changed files with 29 additions and 0 deletions
29
zsh.add
Normal file
29
zsh.add
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# add to ~/.zshrc
|
||||
# --- AI Agent Launcher (The "Brain Box") ---
|
||||
function agent() {
|
||||
# 1. Determine Workspace
|
||||
local TARGET_DIR="${1:-$PWD}"
|
||||
|
||||
# 2. Generate Unique Name
|
||||
local CONTAINER_NAME="opencode-agent-$(basename "$TARGET_DIR")"
|
||||
|
||||
echo "> Launching Smart Agent: $CONTAINER_NAME"
|
||||
echo "> Workspace: $TARGET_DIR"
|
||||
|
||||
docker run -it --rm \
|
||||
--name "$CONTAINER_NAME" \
|
||||
--add-host=host.docker.internal:host-gateway \
|
||||
-v "$TARGET_DIR:/workspace" \
|
||||
-v "$HOME/dev/ai/docker-images/starship.toml:/root/.config/starship.toml" \
|
||||
-v opencode-cargo-cache:/root/.cargo \
|
||||
-v opencode-go-cache:/root/go \
|
||||
-v opencode-bun-cache:/root/.bun \
|
||||
-v opencode-uv-cache:/root/.cache/uv \
|
||||
-v opencode-pip-cache:/root/.cache/pip \
|
||||
-v opencode-history:/root/.history \
|
||||
-e HISTFILE=/root/.history/zsh_history \
|
||||
-w /workspace \
|
||||
-p 4096:4096 \
|
||||
smart-agent \
|
||||
zsh
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue