buttons
Deterministic workflow engine for AI agents. Create and press reusable buttons (shell scripts, HTTP APIs, prompt instructions) with typed inputs and structured JSON output. Use when wrapping repeatable actions, calling HTTP endpoints, or building multi-step workflows where each step is a named, typed, pressable button.
- License 许可
- Apache-2.0
- 所属仓库
- autonoco/buttons
- 最近更新
- 2026-09-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- buttons
- license
- Apache-2.0
- metadata
- { "author": "autonoco", "repository": "https://github.com/autonoco/buttons" }
- description
- Deterministic workflow engine for AI agents. Create and press reusable buttons (shell scripts, HTTP APIs, prompt instructions) with typed inputs and structured JSON output. Use when wrapping repeatable actions, calling HTTP endpoints, or building multi-step workflows where each step is a named, typed, pressable button.
- compatibility
- Requires the buttons CLI binary installed (go install github.com/autonoco/buttons@latest or curl installer).
03 SKILL.md 正文
Buttons CLI
Deterministic workflow engine for AI agents. Create reusable, composable actions with typed inputs and structured JSON output.
When to use
- Wrap a repeatable action (shell script, HTTP API call, prompt instruction) as a named, typed, pressable button
- Get structured JSON output from shell commands or HTTP endpoints
- Create self-documenting actions that other agents can discover and press
- Build multi-step workflows where each step is a button with typed args
Quick reference
# Default: scaffold + edit + press. Creates main.sh with placeholder you edit.
buttons create deploy --arg env:string:required
# → edit ~/.buttons/buttons/deploy/main.sh, then: buttons press deploy --arg env=staging
# Shortcuts for known content (skip the scaffold):
buttons create greet --code 'echo "Hello, $BUTTONS_ARG_NAME"' --arg name:string:required
buttons create weather --url 'https://wttr.in/{{city}}?format=j1' --arg city:string:required
buttons create deploy-checklist --prompt "Verify: tests pass, staging green, team notified"
buttons create etl -f ./scripts/transform.sh --arg source:string:required
# Press buttons
buttons press weather --arg city=Miami
buttons press weather --arg city=Miami --json
buttons press deploy --dry-run
# Discover and manage
buttons list
buttons weather # detail view for a single button
buttons history weather
buttons delete weather
buttons version --json
Commands
buttons
Deterministic workflow engine for agents
buttons [command]
| Flag | Type | Description |
|---|---|---|
--json |
bool | output in JSON format |
--no-input |
bool | disable all interactive prompts |
--summary |
bool | show a read-only plan/snapshot instead of mutating |
buttons add
Add a registry package dependency
buttons add [flags]
| Flag | Type | Description |
|---|---|---|
--no-refresh |
bool | keep other floating (latest) dependencies at their locked versions |
buttons agent
Set up this agent's identity and public URL
buttons agent [command]
buttons agent setup
Register this agent under a slug and print its URLs (enrolls on first run)
buttons agent setup [flags]
| Flag | Type | Description |
|---|---|---|
--principal |
string | optional principal this agent serves |
--tunnel |
string | tunnel id backing this agent (defaults to the named webhook tunnel) |
buttons agent status
Show this device's identity (no secrets)
buttons agent status
buttons batteries
Manage environment variables and secrets
buttons batteries [command]
buttons batteries get
Print a battery value
buttons batteries get
buttons batteries list
List every battery
buttons batteries list [flags]
| Flag | Type | Description |
|---|---|---|
--reveal |
bool | print values in full instead of redacted |
buttons batteries rm
Remove a battery
buttons batteries rm [flags]
| Flag | Type | Description |
|---|---|---|
--global |
bool | target the global batteries file (~/.buttons/batteries.json) |
--local |
bool | target the project-local batteries file (.buttons/batteries.json) |
buttons batteries set
Set a battery
buttons batteries set [flags]
| Flag | Type | Description |
|---|---|---|
--global |
bool | target the global batteries file (~/.buttons/batteries.json) |
--local |
bool | target the project-local batteries file (.buttons/batteries.json) |
buttons board
Open the button board in a new terminal window
buttons board [flags]
| Flag | Type | Description |
|---|---|---|
--inline |
bool | render the board in the current terminal instead of spawning a new window |
buttons config
Read and write per-user settings
buttons config [command]
buttons config set
Set a setting
buttons config set
buttons config unset
Clear a setting (revert to built-in default)
buttons config unset
buttons create
Create a new button
buttons create [flags]
| Flag | Type | Description |
|---|---|---|
--allow-private-networks |
bool | allow --url buttons to reach private network addresses (localhost, 10/8, 172.16/12, 192.168/16, 169.254/16, IPv6 private ranges). Required for local dev targets. |
--app |
string | create an app-kind button under apps/ from a git URL (cloned) or local path (copied) |
--arg |
stringArray | argument definition (name:type:required |
--body |
string | HTTP request body (supports {{arg}} templates) |
--code |
string | inline script code (shortcut for one-liners) |
-d, --description |
string | button description |
-f, --file |
string | copy an existing script file into the button folder |
--header |
stringArray | HTTP header as 'Key: Value' (repeatable) |
--ignore |
bool | add this button to .buttons/.gitignore so git won't track it (good for scratch/test buttons) |
--max-response-size |
string | max HTTP response body size for --url buttons (e.g. 10M, 1G). default: 10M |
--method |
string | HTTP method for --url (default: GET) |
--prompt |
string | prompt/instruction for the consuming agent (written to AGENTS.md) |
--runtime |
string | code runtime: shell, bash, python, node (default: shell) |
--timeout |
int | execution timeout in seconds |
--url |
string | HTTP API endpoint URL (supports {{arg}} templates) |
buttons delete
Delete a button
buttons delete [flags]
| Flag | Type | Description |
|---|---|---|
-F, --force |
bool | delete without confirmation |
buttons drawer
Manage drawer workflows (chains of buttons)
buttons drawer
buttons flow
Buttons Flow — pressable boards for drawer_kind:flow
buttons flow [command]
buttons flow approve
Approve a gated transition
buttons flow approve
buttons flow ensure-buttons
Install shared flow pipeline buttons for a provider
buttons flow ensure-buttons [flags]
| Flag | Type | Description |
|---|---|---|
--on |
string | provider: local |
buttons flow init
Register triggers and prove a flow board presses
buttons flow init [flags]
| Flag | Type | Description |
|---|---|---|
--manager |
string | manager agent ref |
--no-verify |
bool | skip proof press |
--on |
string | provider: local |
--worker |
string | worker agent ref |
buttons flow logs
Recent press history for a board
buttons flow logs [flags]
| Flag | Type | Description |
|---|---|---|
--failed |
bool | only failed presses |
--limit |
int | max history entries |
--task |
string | filter by task id (best-effort) |
buttons flow reject
Reject a gated transition
buttons flow reject [flags]
| Flag | Type | Description |
|---|---|---|
--reason |
string | rejection reason |
buttons flow rm
Remove webhook trigger and schedule for a board
buttons flow rm [flags]
| Flag | Type | Description |
|---|---|---|
--purge |
bool | also delete local tasks |
buttons flow status
Board status summary
buttons flow status
buttons flow task
Task CRUD against a board's provider
buttons flow task [command]
| Flag | Type | Description |
|---|---|---|
--filter |
string | key=value filter (list) |
buttons history
Show run history
buttons history [flags]
| Flag | Type | Description |
|---|---|---|
--last |
int | number of runs to show |
buttons ignore
Keep a button or drawer out of git (writes .buttons/.gitignore)
buttons ignore
buttons import
Create buttons from external sources (skill, code, url)
buttons import [command]
| Flag | Type | Description |
|---|---|---|
--name |
string | override the generated button name (code/url) |
-y, --yes |
bool | skip the confirmation prompt |
buttons import code
Wrap a script file as a button
buttons import code
buttons import mcp
Create buttons from an MCP server's tools (planned)
buttons import mcp
buttons import skill
Create buttons from an AgentSkills skill directory
buttons import skill
buttons import url
Create a button from a spec fetched over HTTP
buttons import url
buttons init
Initialize a project-local .buttons directory
buttons init [flags]
| Flag | Type | Description |
|---|---|---|
--agent |
stringSlice | agent integrations to install (cursor,claude,cline,copilot,agents-md,openclaw,hermes); 'none' skips |
buttons install
Install packages from .buttons/buttons.json
buttons install
buttons list
List all buttons
buttons list
buttons login
Connect this machine to the Buttons platform
buttons login [flags]
| Flag | Type | Description |
|---|---|---|
--desk |
string | Buttons console URL that hosts the authorization page |
--no-browser |
bool | print the authorization URL instead of opening a browser |
--registry |
string | registry base URL the token is issued for |
buttons logout
Disconnect this machine from the Buttons platform
buttons logout
buttons logs
View past runs for a button or tail the live progress stream
buttons logs [flags]
| Flag | Type | Description |
|---|---|---|
--failed |
bool | only return runs that failed |
-f, --follow |
bool | stream the latest press's progress events live (agent-friendly, no TUI) |
--limit |
int | max runs to return |
buttons mcp
Run an MCP server over stdio (expose buttons to agents)
buttons mcp [flags]
| Flag | Type | Description |
|---|---|---|
--allow-create |
bool | expose the buttons_create tool (off by default) |
buttons press
Run a button
buttons press [flags]
| Flag | Type | Description |
|---|---|---|
--arg |
stringArray | argument as key=value |
--dry-run |
bool | show what would execute without running |
-f, --follow |
bool | stream stdout/stderr to stderr as the press runs (final Result still goes to stdout) |
--idempotency-key |
string | reuse the cached result for this key if present (cross-run dedup) |
--idempotency-ttl |
duration | how long idempotency entries stay valid (e.g. 1h, 24h) |
--timeout |
int | override timeout in seconds |
buttons publish
Publish a local button or drawer to the registry
buttons publish
buttons remove
Remove a registry package dependency
buttons remove
buttons serve
Run a REST API server exposing buttons over HTTP
buttons serve [flags]
| Flag | Type | Description |
|---|---|---|
--allow-http-buttons |
bool | allow pressing http (outbound-request) buttons over the API (SSRF surface; off by default) |
--api-key |
string | bearer key required on all endpoints (else the 'API_KEY' battery or $BUTTONS_API_KEY) |
--host |
string | host/interface to bind (use 0.0.0.0 to expose; requires an API key) |
--no-triggers |
bool | do not run the trigger engine (cron/watch/webhook) alongside the API |
--port |
int | port to listen on |
buttons smash
Run multiple buttons in parallel
buttons smash [flags]
| Flag | Type | Description |
|---|---|---|
--concurrency |
int | max buttons running at once (0 = NumCPU; hard cap 50) |
--on-failure |
string | stop |
--timeout |
int | per-button timeout override (seconds) |
buttons status
Show available CLI and package updates
buttons status
buttons summary
Print a workspace snapshot (buttons, drawers, recent runs)
buttons summary [flags]
| Flag | Type | Description |
|---|---|---|
--deep |
bool | inline full schemas + all recent runs |
buttons tail
Follow the progress JSONL of a press
buttons tail [flags]
| Flag | Type | Description |
|---|---|---|
-f, --follow |
bool | keep tailing as new lines arrive |
buttons trigger
Manage button triggers (cron, watch, webhook)
buttons trigger [command]
buttons trigger add
Add a trigger to a button
buttons trigger add [flags]
| Flag | Type | Description |
|---|---|---|
--arg |
stringArray | argument key=value passed when the trigger fires (repeatable) |
--cron |
bool | cron-scheduled trigger |
--path |
string | file path to watch |
--schedule |
string | cron schedule, 5-field (e.g. "0 */6 * * *") |
--token |
string | shared secret required on webhook POSTs (X-Buttons-Token or ?token=) |
--watch |
bool | file-watch trigger |
--webhook |
bool | webhook (HTTP POST) trigger |
--webhook-path |
string | URL path for the webhook (e.g. /hooks/deploy) |
buttons trigger list
List triggers (all buttons, or one)
buttons trigger list
buttons trigger rm
Remove a trigger from a button
buttons trigger rm
buttons unignore
Re-include a previously-ignored button or drawer in git
buttons unignore
buttons update
Update the CLI and floating package dependencies
buttons update
buttons version
Print build version, commit, and date
buttons version
buttons webhook
Expose a local URL via Cloudflare to receive webhook callbacks
buttons webhook [command]
buttons webhook listen
Run the webhook listener — presses drawers when trigger paths are hit
buttons webhook listen [flags]
| Flag | Type | Description |
|---|---|---|
--no-tunnel |
bool | skip cloudflared; listen on 127.0.0.1 only (local testing) |
--port |
int | bind local listener on this port (0 = random) |
buttons webhook logout
Clear named-tunnel config (falls back to quick mode)
buttons webhook logout
buttons webhook setup
One-time Cloudflare login + named-tunnel config
buttons webhook setup [flags]
| Flag | Type | Description |
|---|---|---|
--allow-apex |
bool | allow an apex hostname (e.g. example.com); DANGEROUS — overrides root DNS |
--api-account-id |
string | pin the CF account id when the token is authorized on several |
--api-token |
string | Cloudflare API token (recommended); or set $BUTTONS_CF_API_TOKEN |
--hostname |
string | hostname for webhooks (e.g. webhooks.yourdomain.com) |
--overwrite-dns |
bool | replace any pre-existing Cloudflare DNS record at the hostname; DESTRUCTIVE |
--tunnel |
string | Cloudflare tunnel name |
buttons webhook status
Show current webhook mode and URL
buttons webhook status
buttons webhook test
Round-trip verify: spin up a tunnel, self-POST, observe delivery
buttons webhook test
JSON output contract
Every command supports --json. Piped/non-TTY output auto-detects and switches to JSON.
Success:
{"ok": true, "data": { ... }}
Error:
{"ok": false, "error": {"code": "NOT_FOUND", "message": "button not found: deploy"}}
Error codes: NOT_FOUND, MISSING_ARG, VALIDATION_ERROR, TIMEOUT, SCRIPT_ERROR, RUNTIME_MISSING, INTERNAL_ERROR, NOT_IMPLEMENTED.
Argument types
Define at create time: --arg name:type:required|optional
| Type | Values | Example |
|---|---|---|
string |
Any text | --arg city:string:required |
int |
Integer | --arg count:int:optional |
bool |
true/false/1/0 |
--arg verbose:bool:optional |
Pass at press time: --arg key=value
- Code buttons: args become
BUTTONS_ARG_<NAME>environment variables - HTTP buttons: args substitute into
{{arg}}URL/body templates (context-aware encoded)
Button sources
buttons create <name> scaffolds a shell button with a placeholder main.sh the agent edits, then presses. Use a shortcut flag to skip the scaffold:
| Flag | Source | Runtime |
|---|---|---|
| (none) | Scaffold main.<ext> with shebang + TODO |
--runtime shell|bash|python|node (default: shell) |
--code |
Inline script body (one-liners) | Same as above |
-f/--file |
Existing script file (copied into button folder) | Detected from shebang |
--url |
HTTP endpoint with {{arg}} templates |
HTTP client |
--prompt |
Instruction for the consuming agent | Returns text, no execution |
--prompt can be combined with any other source as a modifier.
Common patterns
Create, press, inspect lifecycle
buttons create check-health --url 'https://api.example.com/health' -d "Health check"
buttons press check-health --json
buttons check-health # detail view: args, last run, usage examples
buttons history check-health # all past runs
Code button with prompt context
buttons create check-logs \
--code 'tail -100 /var/log/app.log' \
--prompt "Summarize any errors or warnings from these logs"
The prompt field appears in --json output so the calling agent knows what to do with the stdout.
HTTP button hitting a local dev server
buttons create local-api \
--url 'http://localhost:3000/api/{{endpoint}}' \
--arg endpoint:string:required \
--allow-private-networks
--allow-private-networks is required for localhost/private-IP targets (blocked by default for SSRF protection).
Storage
All data lives under ~/.buttons/ (override with BUTTONS_HOME):
~/.buttons/buttons/<name>/
button.json # spec (args, runtime, timeout)
main.sh # code file (.sh, .py, .js)
AGENTS.md # prompt instruction
pressed/ # run history as JSON files
04 同仓库更多 Skills
buttons
暂无简介
mintlify
Build and maintain documentation sites with Mintlify. Use when creating docs pages, configuring navigation, adding components, or setting up API references.
mintlify
Build and maintain documentation sites with Mintlify. Use when creating docs pages, configuring navigation, adding components, or setting up API references.
cobra
Build Go CLI applications with Cobra framework. Covers command structure, flags (local/persistent/required), hooks (PreRun/PostRun), shell completions, Viper config integration, error handling, and doc generation. Use when: building Go CLIs, adding Cobra commands or subcommands, working with flags, generating shell completions, or troubleshooting "unknown command" or flag parsing errors.
cli-design-guidelines
Design human-first CLI tools following clig.dev best practices. Covers help text, output formatting, error handling, flags/args, subcommands, interactivity, configuration, signals, naming, and distribution. Use when: building CLI tools, designing command interfaces, adding flags or subcommands, writing help text, formatting CLI output, handling CLI errors, or reviewing CLI UX.
bubble-tea
Build terminal UIs in Go with Bubble Tea v2 (Elm Architecture). Covers Model/Update/View lifecycle, commands (Batch, Sequence, Tick), key/mouse handling, Program options, and Charm ecosystem (Bubbles, Lip Gloss, Huh). Use when: building Go TUI apps, creating terminal interfaces, handling keyboard/mouse input in TUI, using Bubble Tea or Charm libraries, or troubleshooting "tea.Model" or "tea.Cmd" issues.