diff --git a/zsh.add b/zsh.add new file mode 100644 index 0000000..2edf07c --- /dev/null +++ b/zsh.add @@ -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 +} \ No newline at end of file