update
This commit is contained in:
parent
eafb0e678c
commit
0da2c62dfe
1 changed files with 12 additions and 7 deletions
19
agent
19
agent
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
workspace="$HOME/ai_workspace"
|
||||
app="opencode"
|
||||
|
|
@ -24,7 +25,7 @@ while [[ $# -gt 0 ]]; do
|
|||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [-p /path/to/workspace] [-a claude|opencode] [-e rust] [--rebuild]" >&2
|
||||
echo "Usage: $0 [-p /path/to/workspace] [-a claude|opencode|vibe] [-e rust] [--rebuild]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -33,16 +34,21 @@ done
|
|||
case "$app" in
|
||||
claude)
|
||||
image_name="claude-code-local"
|
||||
npm_pkg="@anthropic-ai/claude-code"
|
||||
install_pkg="RUN apt-get update && apt-get install -y npm && npm install -g @anthropic-ai/claude-code"
|
||||
cmd="claude"
|
||||
extra_volumes=(
|
||||
-v "$HOME/.claude:$HOME/.claude"
|
||||
-v "$HOME/.claude.json:$HOME/.claude.json"
|
||||
)
|
||||
;;
|
||||
vibe)
|
||||
image_name="vibe-local"
|
||||
install_pkg="RUN apt-get update && apt-get install -y curl && curl -LsSf https://mistral.ai/vibe/install.sh | bash"
|
||||
cmd="vibe"
|
||||
;;
|
||||
opencode)
|
||||
image_name="opencode-local"
|
||||
npm_pkg="opencode-ai"
|
||||
install_pkg="RUN apt-get update && apt-get install -y npm && npm install -g opencode-ai"
|
||||
cmd="opencode"
|
||||
extra_volumes=(
|
||||
-v "$HOME/.config/opencode:$HOME/.config/opencode"
|
||||
|
|
@ -89,16 +95,15 @@ image_name="${image_name}${env_suffix}"
|
|||
|
||||
if $rebuild || ! docker image inspect "$image_name" &>/dev/null; then
|
||||
echo "Building $image_name..."
|
||||
dockerfile="FROM node:24-bookworm
|
||||
dockerfile="FROM debian:bookworm
|
||||
ENV PATH=/root/.local/bin/:$PATH
|
||||
${env_layer}
|
||||
RUN npm install -g $npm_pkg
|
||||
$install_pkg
|
||||
WORKDIR /workspace
|
||||
CMD [\"$cmd\"]"
|
||||
docker build --pull -t "$image_name" - <<< "$dockerfile"
|
||||
fi
|
||||
|
||||
clear
|
||||
|
||||
docker run -it --rm \
|
||||
--name "${image_name}-container" \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue