just-bash
Sandboxed bash execution using just-bash from Vercel Labs. Use when you need to run shell commands safely without modifying the real filesystem, process data files, or test scripts in an isolated sandbox with read-only FS, no network, and in-memory writes.
- License 许可
- MIT
- 最近更新
- 2026-07-29
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- just-bash
- description
- Sandboxed bash execution using just-bash from Vercel Labs. Use when you need to run shell commands safely without modifying the real filesystem, process data files, or test scripts in an isolated sandbox with read-only FS, no network, and in-memory writes.
- allowed-tools
- Bash(just-bash:*)
03 SKILL.md 正文
Just Bash Skill
Overview
Use this skill when you need to:
- Run bash commands safely without modifying the real filesystem
- Process and transform data files (CSV, JSON, YAML, text)
- Test shell scripts in an isolated sandbox
- Run exploratory commands where mistakes can't cause damage
- Execute complex pipelines (grep, awk, sed, jq, xan, rg)
- Validate scripts before running them for real
When to use just-bash vs the regular Bash tool:
- just-bash: Exploratory work, data processing, script testing, untrusted input, bulk file operations where you want safety
- Regular Bash: git operations, npm/pip commands, running servers, anything needing network or real writes
Prerequisites
# Install globally
npm install -g just-bash
# Or use via npx (no install needed)
npx just-bash -c 'echo hello'
Core Usage
Run Inline Commands
# Simple command
just-bash -c 'ls -la'
# Multi-line script
just-bash -c '
for f in *.ts; do
echo "$(wc -l < "$f") $f"
done | sort -rn | head -10
'
Run Script Files
just-bash ./scripts/analyze.sh
Pipe Scripts from Stdin
echo 'find . -name "*.ts" | head -5' | just-bash
Key Options
--root <path> # Mount a specific directory (default: cwd)
--cwd <path> # Set working directory inside sandbox
--allow-write # Enable in-memory writes (writes don't touch real FS)
--python # Enable python3 commands
--json # Output as JSON: {"stdout", "stderr", "exitCode"}
-e, --errexit # Exit on first error
Security Model
- Read-only by default - reads real files via OverlayFS, blocks writes
- No network access - cannot curl, wget, or make connections
- No escape - sandboxed to the root directory
- In-memory writes - with
--allow-write, writes go to memory only, not disk - Real filesystem is mounted at
/home/user/project
Available Commands (75+)
Text Processing
awk sed grep egrep fgrep rg cut tr sort uniq wc head tail tac rev nl fold expand unexpand column comm join paste split strings
Data Formats
jq (JSON - older build, lacks -R/-s flags) xan (CSV) html-to-markdown
Broken in v1.0.0
yq (YAML - "Dynamic require of process" error) sqlite3 (SQL - "DataView constructor" error)
File Operations
ls find cat cp mv rm mkdir rmdir ln touch chmod stat file tree du basename dirname readlink
Compression
gzip gunzip zcat tar
Checksums
md5sum sha1sum sha256sum base64
Utilities
date seq expr env printenv whoami hostname sleep timeout time which xargs tee diff
Workflow Patterns
Pattern 1: Data Analysis Pipeline
# Analyze a CSV file with xan
just-bash -c '
xan headers data.csv
xan count data.csv
xan frequency data.csv -s status
' --root /path/to/project
Pattern 2: JSON Processing
# Transform JSON data with jq
just-bash -c '
cat api-response.json | jq ".items[] | {name: .name, count: .total}" | head -20
'
Pattern 3: Codebase Exploration
# Find patterns across a project (safe, read-only)
just-bash -c '
echo "=== File counts by extension ==="
find . -type f | sed "s/.*\.//" | sort | uniq -c | sort -rn | head -10
echo "=== TODO/FIXME comments ==="
rg -c "TODO|FIXME" --type ts 2>/dev/null | sort -t: -k2 -rn | head -10
echo "=== Largest files ==="
find . -type f -name "*.ts" | xargs wc -l 2>/dev/null | sort -rn | head -10
'
Pattern 4: Script Testing with In-Memory Writes
# Test a script that writes files - nothing touches disk
just-bash --allow-write -c '
mkdir -p /tmp/output
for f in *.json; do
jq ".version = \"2.0\"" "$f" > "/tmp/output/$f"
done
ls -la /tmp/output/
cat /tmp/output/package.json
'
Pattern 5: Text Processing Pipeline
# Combine awk, sed, sort for analysis
just-bash -c '
echo "=== Functions per file ==="
rg -c "function " --type ts 2>/dev/null | sort -t: -k2 -rn | head -10
echo "=== Lines by extension ==="
find . -type f -not -path "./.git/*" | sed "s/.*\.//" | sort | uniq -c | sort -rn | head -10
' --root /path/to/project
Pattern 6: JSON Output for Programmatic Use
# Get structured output
just-bash --json -c 'echo "hello world"'
# Returns: {"stdout":"hello world\n","stderr":"","exitCode":0}
Tips for AI Usage
- Default to just-bash for exploration - when reading/analyzing files, use the sandbox for safety
- Use
--jsonflag when you need to parse the output programmatically - Use
--allow-writefor temp files - writes stay in memory, safe to experiment - Chain with pipes - all standard Unix pipelines work (grep | sort | uniq -c | head)
- Use
--rootto scope the sandbox to a specific project directory - Combine tools - jq for JSON, xan for CSV, rg for search, awk/sed for transforms
- Test destructive scripts safely - rm, mv, overwrites all happen in memory with --allow-write
Limitations
- No network access (no curl, wget, npm, git, pip, etc.)
- No persistent writes (in-memory only, lost when command exits)
- No interactive commands (no vim, nano, less, etc.)
- No package managers or language runtimes (except python with --python flag)
- No system administration commands (no sudo, systemctl, etc.)
- No process substitution (
<()syntax not supported) jqis an older build --R(raw input) and-s(slurp) flags are missingyqis broken in v1.0.0 ("Dynamic require of process" error)sqlite3is broken in v1.0.0 ("DataView constructor" error)treelacks some flags (e.g.--dirsfirst)
04 同仓库更多 Skills
using-agent-skills
Discovers and invokes the right @runecraft/spells skill for the current task. Use when starting a session, when a request is ambiguous about which workflow to apply, or when you need to pick among the 13-skill Arcanum catalog. EN triggers: /skill, which skill, pick a skill, what skill should I use, skill discovery, meta skill. PT triggers: qual skill, qual habilidade, descobrir skill, qual fluxo usar. Do NOT use for: actual implementation work (route to the specific skill instead), unrelated standalone tasks outside the Arcanum catalog, or runtime-specific configuration (e.g., opencode.json / Claude Code plugin paths).
typescript-patterns
TypeScript best practices and patterns for type-safe, maintainable code. Covers discriminated unions, generics, const assertions, type narrowing, and common anti-patterns. Extends (does not override) project tsconfig. EN triggers: /typescript, TypeScript patterns, TS best practices, type safety, discriminated unions, generics, type narrowing. PT triggers: /typescript, padrões TypeScript, boas práticas TS, segurança de tipos, unions discriminadas, genéricos. Do NOT use for: JavaScript-only projects, runtime performance, or replacing project tsconfig rules.
test-driven-development
Drives development with tests — fail first, then make them pass, then refactor. Use when implementing any logic, fixing any bug, or changing any behavior. EN triggers: /test, write tests first, TDD, prove it, 80/15/5 pyramid, Beyonce Rule. PT triggers: /teste, testes primeiro, provar com teste, pirâmide 80/15/5. Do NOT use for: production incident triage (use /debug), or cosmetic-only changes with no behavioral surface.
spec-driven
Feature planning and implementation with 4 adaptive phases — Specify, Design, Tasks, Execute. Auto-sizes depth by complexity. Creates atomic tasks with verification criteria, atomic git commits, and requirement traceability. Features an independent Verifier (author != verifier, evidence-or-zero), persistent decision log (STATE.md), and test-coverage-matrix-driven tests, plus a self-improving lessons layer that turns verification failures into reusable project-local guidance. Stack-agnostic. Use when planning features (requirements, design, task breakdown), implementing with verification and atomic commits, or validating/verifying an implementation against a spec. Triggers (PT/EN): "specify feature", "vamos especificar", "discutir feature", "discutir este caso", "design", "design da feature", "tarefas", "quebrar em tarefas", "implementar", "build", "validar", "verify work", "UAT", "validar implementação", "record decision", "pause work", "pausar trabalho", "resume work", "retomar trabalho". Do NOT use for architecture decomposition analysis (use architecture skills) or technical design docs (treat as Complex scope: discuss gray areas + architecture-focused design).
skill-forge
Designs, authors, validates, and optimizes new Agent Skills from scratch. Use when creating a new skill, packaging a workflow as a skill, improving a skill's triggering accuracy, or evaluating whether a skill improves output quality. Covers the full lifecycle: DISCOVER, DESIGN, AUTHOR, VALIDATE, OPTIMIZE, DELIVER. Produces skills that follow the open SKILL.md format (YAML frontmatter + Markdown body, progressive disclosure, validation loops). EN triggers: /forge, create a skill, write a skill, build a skill, new skill, author a skill, package this as a skill, validate a skill, improve skill triggering, optimize skill description, evaluate skill quality. PT triggers: /forge, criar uma skill, escrever uma skill, construir uma skill, nova skill, empacotar como skill, validar skill, melhorar disparo, otimizar descrição de skill. Do NOT use for: discovering which existing skill to apply (use a dispatch/meta skill), planning feature implementation, or designing software architecture.
shipping-and-launch
Prepares production launches with a pre-launch checklist, staged rollout, monitoring, and a rollback strategy — plus feature flag lifecycle (off → internal → beta → GA). Use when deploying a feature to production for the first time, releasing a significant change, or planning a rollout. EN triggers: /ship, pre-launch checklist, staged rollout, feature flag, rollback plan, monitoring. PT triggers: /shippar, checklist pré-lançamento, rollout gradual, feature flag, plano de rollback. Do NOT use for: pre-production development work, or one-off internal tools with no user exposure.