update
This commit is contained in:
parent
bb735586b0
commit
22937e4023
1 changed files with 40 additions and 0 deletions
40
claude
Executable file
40
claude
Executable file
|
|
@ -0,0 +1,40 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
workspace="$HOME/ai_workspace"
|
||||||
|
image_name="claude-code-local"
|
||||||
|
rebuild=false
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
-p|--path)
|
||||||
|
workspace="$(readlink -f "$2")"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--rebuild)
|
||||||
|
rebuild=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 [-p /path/to/workspace] [--rebuild]" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if $rebuild || ! docker image inspect "$image_name" &>/dev/null; then
|
||||||
|
echo "Building $image_name..."
|
||||||
|
docker build --pull -t "$image_name" - <<'EOF'
|
||||||
|
FROM node:24-bullseye
|
||||||
|
RUN npm install -g @anthropic-ai/claude-code
|
||||||
|
WORKDIR /workspace
|
||||||
|
CMD ["claude"]
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run -it --rm \
|
||||||
|
--name claude-chat \
|
||||||
|
-v "$workspace:/workspace" \
|
||||||
|
-v "$HOME/.claude:/root/.claude" \
|
||||||
|
-v "$HOME/.claude.json:/root/.claude.json" \
|
||||||
|
-w /workspace \
|
||||||
|
"$image_name"
|
||||||
Loading…
Reference in a new issue