bash_tool

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL