Small agent heavily inspired by mini-swe-agent, the 100-line Python agent that scores 74% on SWE-bench. This is a Go implementation of the same philosophy.
Instead of implementing custom tools for every task (file reading, searching, git operations), the agent focuses on letting the LLM use the shell with limited access and resources, e.g., want it to open a PR? Don't implement a GitHub tool. Tell it to use gh pr create.
Each command runs in a fresh bash process:
exec.CommandContext(ctx, "bash", "-c", command)No persistent shell session. This gives you:
- Stability — no shell state corruption between commands
- Sandboxing — easy to swap
exec.Commandwithdocker exec - Debugging — each command is independent and reproducible
Every step appends to the message list. No branching, no complex state management. The trajectory is the conversation — great for debugging and understanding what the LLM sees.
go install github.com/j0lvera/wise@latestOr build from source:
git clone https://github.com/j0lvera/wise
cd wise
go build -o wise .Only works with OpenRouter-compatible models. If you need support for other providers, please submit an pull request, but ideally, you'd fork it and make it your own.
export OPENROUTER_API_KEY="your-api-key"
export OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"
# Optional settings with defaults
export MODEL="anthropic/claude-3.5-sonnet" # Default model
export MAX_STEPS=25 # Max iterations
export COMMAND_TIMEOUT=30s # Command timeout
export ENV=dev # dev, test, or prodCopy the example and customize:
cp config.example.toml config.tomlSee config.example.toml for all options.
wise run "List all Go files in this directory"echo "Create a file called hello.txt with 'Hello World'" | wise run -wise run "your task" -v # Verbose (debug logging)
wise run "your task" -q # Quiet (errors only)
wise run "your task" --json # JSON output| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Misuse (missing args, bad config) |
| 126 | Permission denied |
| 127 | Command not found |
The agent blocks dangerous commands by default:
rm -rf /and similar destructive patternsmkfs,ddto devicescurl | shpatterns- System commands (
shutdown,reboot,halt) - Fork bombs
See agent/executor.go for the full blocklist.
MIT