Documentation
¶
Overview ¶
Package main demonstrates a bash/shell execution tool driven by the model.
This gives any tool-capable LM Studio model the ability to run shell commands — similar to Claude Code's Bash tool. The tool:
- Accepts a command string and optional description.
- Captures stdout + stderr and returns them alongside the exit code.
- Enforces a per-call timeout (default 30s, overridable per request).
- Rejects a configurable denylist of obviously-dangerous commands before exec (best-effort — do not rely on this for untrusted input).
- Runs every call through a permission callback so the operator can approve/deny/patch each command before it's executed.
Run it with:
LM_API_KEY=... LM_MODEL=qwen/qwen3.6-35b-a3b go run ./examples/bash_tool
Click to show internal directories.
Click to hide internal directories.