Buttons stores all its data underDocumentation Index
Fetch the complete documentation index at: https://docs.buttons.sh/llms.txt
Use this file to discover all available pages before exploring further.
~/.buttons/. Each button gets its own subdirectory with a spec file, an optional code file, optional agent context, and a run history folder.
Directory layout
button.json
The spec file for a button. It describes the button type, arguments, runtime, and all other configuration. Every spec includes"schema_version": 1.
main.*
The script file for code buttons. The extension matches the runtime:main.sh for shell, main.py for Python, main.js for Node. HTTP and prompt-only buttons do not have a main.* file.
AGENT.md
Present on every button. For prompt buttons, contains the raw instruction text stored at create time via--prompt; when pressed, the contents are returned in the prompt field of the JSON output. For other button types, AGENT.md holds notes and context an agent can read to understand when and how to press the button.
pressed/
One JSON file per run, named by timestamp. Each file records the input arguments, exit code, stdout, stderr, duration, and whether the run succeeded.state.db
A SQLite database (WAL mode,busy_timeout=5000) that mirrors the run history for indexed queries. buttons history reads from this file. The JSON files in pressed/ are the authoritative record; state.db is the query index.
Overriding the home directory
SetBUTTONS_HOME to use a different base directory:
The
~/.buttons/ directory and all files inside it are created with mode 0700 / 0600. Other users on the same system cannot read button specs or run history.Related
- Button folder structure — this page
- JSON output — the shape of history records
- File buttons — how
main.*is populated from an imported script