-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathjustfile
More file actions
68 lines (60 loc) · 2.38 KB
/
justfile
File metadata and controls
68 lines (60 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Default: list available targets
default:
@just --list
# Format staged files and commit — avoids pre-commit stash conflicts with ruff auto-fixes
commit message:
uv run ruff format .
git add -u
git commit -m "{{message}}"
image := "claude-sandbox"
env_file := "sandbox/myenv"
sandbox_dir := "sandbox"
workspace := "demo/workspace"
trace := "false"
learn := "false"
# Build the sandbox Docker image
sandbox-build:
docker build -t {{image}} {{sandbox_dir}}
# Copy sample.env to myenv if it doesn't already exist
sandbox-setup:
@if [ ! -f {{env_file}} ]; then \
cp sandbox/sample.env {{env_file}}; \
echo "Created {{env_file}} — edit it and set your ANTHROPIC_API_KEY"; \
else \
echo "{{env_file}} already exists, skipping"; \
fi
# Run an interactive Claude Code shell in the sandbox
sandbox-run:
docker run --rm -it --env-file {{env_file}} -v "$(cd {{workspace}} && pwd)":/workspace -v "$(pwd)/platform-integrations/claude/plugins":/plugins {{image}}
# Run a one-shot prompt in the sandbox (trace=true to summarize session, learn=true to run /evolve-lite:learn)
sandbox-prompt prompt:
#!/usr/bin/env sh
export SANDBOX_PROMPT="$(cat <<'PROMPT_EOF'
{{prompt}}
PROMPT_EOF
)"
TRACE_CMD=""
LEARN_CMD=""
if [ "{{trace}}" = "true" ]; then
TRACE_CMD="
echo; echo; echo Summarizing the session...; echo
claude --plugin-dir /plugins/evolve-lite/ --dangerously-skip-permissions --no-session-persistence -p 'tell me what happened in the newest json file in /home/sandbox/.claude/projects/-workspace/'
"
fi
if [ "{{learn}}" = "true" ]; then
LEARN_CMD="
echo; echo; echo Learning...; echo
claude --plugin-dir /plugins/evolve-lite/ --dangerously-skip-permissions --continue -p '/evolve-lite:learn'
"
fi
docker run --rm -it --env SANDBOX_PROMPT --env-file {{env_file}} -v "$(cd {{workspace}} && pwd)":/workspace -v "$(pwd)/platform-integrations/claude/plugins":/plugins {{image}} sh -c "
claude --plugin-dir /plugins/evolve-lite/ --dangerously-skip-permissions -p \"\$SANDBOX_PROMPT\"
$TRACE_CMD
$LEARN_CMD
"
# Smoke-test that Claude Code is installed and working
sandbox-test:
docker run --rm --env-file {{env_file}} {{image}} claude -p "who are you"
# Remove the sandbox Docker image
sandbox-clean:
docker rmi {{image}}