### Create a Test Task with Beads (Shell) Source: https://docs.gastownhall.ai/installing Demonstrates creating a new test task using the 'bd create' command. This is a basic step for new users to get started with Beads. ```shell bd create "Test task" ``` -------------------------------- ### Install Gas Town CLI and Beads Source: https://docs.gastownhall.ai/installing Installs the Gas Town command-line interface (CLI) and the Beads issue tracker using the Go install command. Includes verification steps. ```bash # Install Gas Town CLI go install github.com/steveyegge/gastown/cmd/gt@latest # Install Beads (issue tracker) go install github.com/steveyegge/beads/cmd/bd@latest # Verify installation gt version bd version ``` -------------------------------- ### Install Git, Go, and tmux on Debian/Ubuntu Linux Source: https://docs.gastownhall.ai/installing Installs Git and tmux using apt, and Go using the official installer, ensuring a compatible version is used. It also configures the PATH environment variable. ```bash # Required sudo apt update sudo apt install -y git # Install Go (apt version may be outdated, use official installer) wget https://go.dev/dl/go1.24.12.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.24.12.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> ~/.bashrc source ~/.bashrc # Optional (for full stack mode) sudo apt install -y tmux ``` -------------------------------- ### Initialize and Login for Publishing (Shell) Source: https://docs.gastownhall.ai/other/mol-mall-design Guides through the initial setup for publishing formulas, including creating an account, generating a token, and logging into the Mol Mall registry. ```shell $ gt formula publish --init Setting up Mol Mall publishing... 1. Create account at https://molmall.gastown.io/signup 2. Generate API token at https://molmall.gastown.io/settings/tokens 3. Run: gt formula login $ gt formula login Token: ******** Logged in as: steve@gastown.io ``` -------------------------------- ### Install and List Formulas (Shell) Source: https://docs.gastownhall.ai/other/mol-mall-design Demonstrates how to install a specific version of a formula and list all installed formulas. This is useful for managing dependencies and ensuring reproducible builds. ```shell $ gt formula install mol-polecat-work@4.0.0 Installing mol-polecat-work@4.0.0 (pinned)... ✓ Installed $ gt formula list --installed mol-polecat-work 4.0.0 [pinned] mol-polecat-code-review 1.2.0 [latest] ``` -------------------------------- ### Install Git, Go, and tmux on Fedora/RHEL Linux Source: https://docs.gastownhall.ai/installing Installs required packages Git and Go, and optional package tmux using the dnf package manager. ```bash # Required sudo dnf install -y git golang # Optional sudo dnf install -y tmux ``` -------------------------------- ### CLI: Basic Formula Installation Flow Source: https://docs.gastownhall.ai/other/mol-mall-design Demonstrates the step-by-step process when using the `gt formula install` command. It shows the resolution of the formula, including registry, version, author, and skills, followed by the download and verification process, and finally the installation path. ```Shell $ gt formula install mol-polecat-code-review Resolving mol-polecat-code-review... Registry: molmall.gastown.io Version: 1.2.0 (latest) Author: steve@gastown.io Skills: code-review, security Downloading... ████████████████████ 100% Verifying checksum... ✓ Installed to: ~/gt/.beads/formulas/mol-polecat-code-review.formula.toml ``` -------------------------------- ### Polecat Environment Setup Example Source: https://docs.gastownhall.ai/concepts/identity Provides an example of environment variables automatically set for a polecat agent named 'toast' in the 'gastown' rig. Includes key variables like GT_ROLE, GT_RIG, BD_ACTOR, and GIT_AUTHOR_NAME. ```shell # Set automatically for polecat 'toast' in rig 'gastown' export GT_ROLE="polecat" export GT_RIG="gastown" export GT_POLECAT="toast" export BD_ACTOR="gastown/polecats/toast" export GIT_AUTHOR_NAME="gastown/polecats/toast" export GT_ROOT="/home/user/gt" export BEADS_DIR="/home/user/gt/gastown/.beads" export BEADS_AGENT_NAME="gastown/toast" export BEADS_NO_DAEMON="1" # Polecats use isolated beads context ``` -------------------------------- ### Install Beads CLI (Go) Source: https://docs.gastownhall.ai/installing Installs the Beads CLI tool using the Go package manager. This is required to resolve the 'bd: command not found' error. Ensure Go is installed and configured correctly. ```go go install github.com/steveyegge/beads/cmd/bd@latest ``` -------------------------------- ### Crew Environment Setup Example Source: https://docs.gastownhall.ai/concepts/identity Presents an example of environment variables automatically set for a crew member named 'joe' in the 'gastown' rig. Highlights essential variables such as GT_ROLE, GT_RIG, BD_ACTOR, and GIT_AUTHOR_NAME. ```shell # Set automatically for crew member 'joe' in rig 'gastown' export GT_ROLE="crew" export GT_RIG="gastown" export GT_CREW="joe" export BD_ACTOR="gastown/crew/joe" export GIT_AUTHOR_NAME="gastown/crew/joe" export GT_ROOT="/home/user/gt" export BEADS_DIR="/home/user/gt/gastown/.beads" export BEADS_AGENT_NAME="gastown/joe" export BEADS_NO_DAEMON="1" # Crew uses isolated beads context ``` -------------------------------- ### Verify Gas Town Prerequisites Source: https://docs.gastownhall.ai/installing Checks the installed versions of Go, Git, and tmux to ensure they meet the minimum requirements for Gas Town. ```bash # Check all prerequisites go version # Should show go1.24 or higher git --version # Should show 2.20 or higher tmux -V # (Optional) Should show 3.0 or higher ``` -------------------------------- ### Install Formula using HOP URI Source: https://docs.gastownhall.ai/other/mol-mall-design Installs a formula from a remote registry using the `hop://` URI scheme. This process involves parsing the URI, resolving the registry endpoint, authenticating, downloading the formula, verifying its integrity, and finally installing it. ```Shell gt formula install hop://molmall.acme.corp/formulas/@acme/mol-deploy@2.1.0 ``` -------------------------------- ### Install Homebrew and Go/Git on macOS Source: https://docs.gastownhall.ai/installing Installs Homebrew package manager and then uses it to install Go and Git, which are required for Gas Town. ```bash # Install Homebrew if needed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Required brew install go git # Optional (for full stack mode) brew install tmux ``` -------------------------------- ### Settings Configuration Example (settings/config.json) Source: https://docs.gastownhall.ai/reference Presents a sample settings configuration file for a rig, including theme, max workers, and merge queue settings. ```json { "theme": "desert", "max_workers": 5, "merge_queue": { "enabled": true } } ``` -------------------------------- ### Transition Output Example Source: https://docs.gastownhall.ai/concepts/molecules Example output after closing a step and automatically advancing to the next, showing the closed step and the newly claimed next step. ```text ✓ Closed gt-abc.3: Implement feature Next ready in molecule: gt-abc.4: Write tests → Marked in_progress (use --no-auto to skip) ``` -------------------------------- ### Create Gas Town Workspace Source: https://docs.gastownhall.ai/installing Initializes a new Gas Town workspace directory structure, including configuration files and directories for agents and projects. ```bash # Create a Gas Town workspace (HQ) gt install ~/gt # This creates: # ~/gt/ # ├── CLAUDE.md # Mayor role context # ├── mayor/ # Mayor config and state # ├── rigs/ # Project containers (initially empty) # └── .beads/ # Town-level issue tracking ``` -------------------------------- ### Go Daemon Rig Service Start Logic Source: https://docs.gastownhall.ai/design/property-layers A Go code snippet illustrating the logic within a Daemon's lifecycle manager to check rig configuration before starting services. It prevents starting services if the rig is 'parked' or 'docked'. ```go func (d *Daemon) maybeStartRigServices(rig string) { r := d.getRig(rig) status := r.GetConfig("status") if status == "parked" || status == "docked" { log.Info("Rig %s is offline, skipping auto-start", rig) return } d.ensureWitness(rig) d.ensureRefinery(rig) } ``` -------------------------------- ### CLI: Install Single File Formula Source: https://docs.gastownhall.ai/other/mol-mall-design Command-line instruction to install a formula that consists of a single `.formula.toml` file. This command downloads the specified formula and places it in the local formulas directory. ```Shell gt formula install mol-polecat-code-review # Downloads mol-polecat-code-review.formula.toml to ~/gt/.beads/formulas/ ``` -------------------------------- ### Verify Gas Town Installation Source: https://docs.gastownhall.ai/installing Runs health checks and displays the status of the Gas Town workspace to confirm a successful installation. ```bash cd ~/gt gt doctor # Run health checks gt status # Show workspace status ``` -------------------------------- ### Rebuild gt Binary from Source (Bash) Source: https://docs.gastownhall.ai/design/plugin-system This command sequence navigates to the Gastown source directory, builds the gt binary using 'make build', and then installs it using 'make install'. This is executed when the binary is detected as stale. ```bash cd ~/gt/gastown/crew/george && make build && make install ``` -------------------------------- ### CLI: Install Formula Bundle Source: https://docs.gastownhall.ai/other/mol-mall-design Command-line instruction to install a formula that is distributed as a bundle (e.g., a tarball containing multiple files like templates and scripts). The command handles downloading and extracting the bundle to the appropriate local directory. ```Shell gt formula install mol-deploy-k8s # Extracts to ~/gt/.beads/formulas/mol-deploy-k8s/ # formula.toml is at mol-deploy-k8s/formula.toml ``` -------------------------------- ### Install Formula from Mol Mall (Shell) Source: https://docs.gastownhall.ai/other/formula-resolution Installs formulas from the remote Mol Mall registry, supporting installation by name or specific version. This command facilitates the adoption of shared or community formulas. ```shell # Install from Mol Mall gt formula install mol-code-review-strict gt formula install mol-code-review-strict@2.0.0 gt formula install hop://acme.corp/formulas/mol-deploy ``` -------------------------------- ### Wisp Storage Configuration Example Source: https://docs.gastownhall.ai/design/property-layers An example JSON structure representing the configuration stored in the `.beads-wisp/config/.json` file. It includes rig name, values, and blocked configurations. ```json { "rig": "gastown", "values": { "status": "parked", "priority_adjustment": 10 }, "blocked": ["auto_restart"] } ``` -------------------------------- ### Create a Convoy with Gas Town (Shell) Source: https://docs.gastownhall.ai/installing Shows how to create a new convoy in Gas Town, linking it to a specific bead ID. This is part of trying a simple workflow after installation. ```shell gt convoy create "Test" ``` -------------------------------- ### Update Gas Town and Beads (Go) Source: https://docs.gastownhall.ai/installing Updates both the Gas Town ('gt') and Beads ('bd') command-line tools to their latest versions using Go's install command. This is the standard procedure for updating the project's tools. ```go go install github.com/steveyegge/gastown/cmd/gt@latest go install github.com/steveyegge/beads/cmd/bd@latest ``` -------------------------------- ### Override Agent per Command Source: https://docs.gastownhall.ai/installing Demonstrates how to specify a different agent for individual Gas Town commands without altering the default configuration. ```bash gt start --agent codex-low gt sling gt-abc12 myproject --agent claude-haiku ``` -------------------------------- ### Add Go Bin to PATH Source: https://docs.gastownhall.ai/installing Appends the Go binary directory to the PATH environment variable in shell configuration files, ensuring the `gt` command is accessible. ```bash # Add to ~/.bashrc, ~/.zshrc, or equivalent export PATH="$PATH:$HOME/go/bin" ``` -------------------------------- ### Escalation Routing Configuration Example Source: https://docs.gastownhall.ai/design/plugin-system Provides an example JSON configuration for escalation routing rules. This defines how different severity levels are mapped to contact channels and specifies contact details and stale thresholds. ```json { "escalation": { "routes": { "low": ["bead"], "medium": ["bead", "mail:mayor"], "high": ["bead", "mail:mayor", "email:human"], "critical": ["bead", "mail:mayor", "email:human", "sms:human"] }, "contacts": { "human_email": "steve@example.com", "human_sms": "+1234567890" }, "stale_threshold": "4h" } } ``` -------------------------------- ### Formula Composition Example Source: https://docs.gastownhall.ai/reference Illustrates how Gas Town formulas can be composed, extending base formulas and composing aspects or expanding steps with macros. ```toml extends = ["base-formula"] [compose] aspects = ["cross-cutting"] [[compose.expand]] target = "step-id" with = "macro-formula" ``` -------------------------------- ### Audit Query Examples Source: https://docs.gastownhall.ai/concepts/identity Provides examples of audit queries using the 'bd audit' command and 'git log' to retrieve information based on agent attribution. Demonstrates filtering by actor, rig, and role. ```shell # All work by an agent bd audit --actor=gastown/crew/joe # All work in a rig bd audit --actor=gastown/* # All polecat work bd audit --actor=*/polecats/* # Git history by agent git log --author="gastown/crew/joe" ``` -------------------------------- ### Set Custom Agents (CLI) Source: https://docs.gastownhall.ai/reference Examples of setting custom agents using the CLI, including overriding built-in agents and setting a default agent. ```bash gt config agent set claude-glm "claude-glm --model glm-4" gt config agent set claude "claude-opus" # Override built-in gt config default-agent claude-glm # Set default ``` -------------------------------- ### Sending Mail Command (Basic) Source: https://docs.gastownhall.ai/design/mail-protocol A basic command-line example for sending an email using the `gt mail send` command with a subject and body. ```bash gt mail send -s "Subject" -m "Body" ``` -------------------------------- ### Deploying and Evaluating Models with Gas Town CLI Source: https://docs.gastownhall.ai/index Demonstrates how to deploy different AI models for A/B testing and then analyze their performance using Gas Town's command-line interface. This allows for data-driven decisions on model selection, capability mapping, and cost optimization. ```bash # Deploy different models on similar tasks gt sling gt-abc gastown --model=claude-sonnet gt sling gt-def gastown --model=gpt-4 # Compare outcomes bd stats --actor=gastown/polecats/* --group-by=model ``` -------------------------------- ### Agent Overrides for Specific Commands (CLI) Source: https://docs.gastownhall.ai/reference Examples of overriding the default agent for specific commands like `start`, `mayor`, `deacon`, and `crew` operations. ```bash # Agent overrides: # * `gt start --agent ` overrides the Mayor/Deacon runtime for this launch. # * `gt mayor start|attach|restart --agent ` and `gt deacon start|attach|restart --agent ` do the same. # * `gt start crew --agent ` and `gt crew at --agent ` override the crew worker runtime. ``` -------------------------------- ### JSON: Active Dog State Representation Source: https://docs.gastownhall.ai/design/dog-pool-architecture An example JSON object representing the state of an active dog. It includes the dog's ID, associated warrant details, current state, attempt number, and timestamps for when it started and last communicated. ```json { "id": "dog-1704567890123", "warrant": { "id": "gt-abc123", "target": "gt-gastown-Toast", "reason": "no_response_health_check", "requester": "deacon", "filed_at": "2026-01-07T20:15:00Z" }, "state": "interrogating", "attempt": 2, "started_at": "2026-01-07T20:15:00Z", "last_message_at": "2026-01-07T20:16:00Z", "next_timeout": "2026-01-07T20:18:00Z" } ``` -------------------------------- ### Rig Configuration Example (config.json) Source: https://docs.gastownhall.ai/reference Shows the structure of a rig's identity configuration file, including its type, name, git URL, and beads prefix. ```json { "type": "rig", "name": "myproject", "git_url": "https://github.com/...", "beads": { "prefix": "mp" } } ``` -------------------------------- ### Test Tmux Installation and Functionality (Shell) Source: https://docs.gastownhall.ai/installing Checks if tmux is installed and operational by displaying its version and performing a quick session creation and destruction test. This is crucial for troubleshooting daemon startup issues. ```shell tmux -V # Should show version tmux new-session -d -s test && tmux kill-session -t test # Quick test ``` -------------------------------- ### Creating a Plugin Run Wisp Source: https://docs.gastownhall.ai/design/plugin-system Demonstrates the command-line interface for creating a wisp to record a plugin run on the ledger. This includes labels for type, plugin name, rig, and result, along with a descriptive body. ```bash bd wisp create \ --label type:plugin-run \ --label plugin:rebuild-gt \ --label rig:gastown \ --label result:success \ --body "Rebuilt gt: abc123 → def456 (5 commits)" ``` -------------------------------- ### Example Session Discovery Message Source: https://docs.gastownhall.ai/reference An example of a session discovery message, illustrating the format with specific values. ```text Example: [GAS TOWN] gastown/crew/gus <- human • 2025-12-30T15:42 • restart ``` -------------------------------- ### gt help Source: https://docs.gastownhall.ai/usage/diagnostics Provides help information for any command in the Gas Town CLI. ```APIDOC ## GET /websites/gastown_ai/help ### Description Help about any command. Provides help for any command in the application. Simply type gt help [path to command] for full details. ### Method GET ### Endpoint /websites/gastown_ai/help ### Query Parameters - **command** (string) - Optional - The specific command to get help for. ### Request Example ```json { "example": "gt help feed" } ``` ### Response #### Success Response (200) - **help_text** (string) - The help text for the specified command or general usage information. #### Response Example ```json { "help_text": "Usage: gt feed [flags]\n\nShow real-time activity feed from beads and gt events..." } ``` ``` -------------------------------- ### Polecat Branch Naming Template Examples (JSON) Source: https://docs.gastownhall.ai/reference Provides examples of custom branch name templates for polecats, illustrating different formatting options. ```json # GitHub enterprise format "adam/{year}/{month}/{description}" # Simple feature branches "feature/{issue}" # Include polecat name for clarity "work/{name}/{issue}" ``` -------------------------------- ### Uninstall Gas Town and Beads Binaries (Shell) Source: https://docs.gastownhall.ai/installing Removes the installed 'gt' and 'bd' executable binaries from the system. This command finds the binaries using 'which' and then deletes them. ```shell # Remove binaries rm $(which gt) $(which bd) ``` -------------------------------- ### Gas Town Minimal Mode Operations Source: https://docs.gastownhall.ai/installing Illustrates how to use Gas Town in Minimal Mode, which involves manually running agent runtimes and managing work through CLI commands. ```bash # Create and assign work gt convoy create "Fix bugs" gt-abc12 gt sling gt-abc12 myproject # Run runtime manually cd ~/gt/myproject/polecats/ claude --resume # Claude Code # or: codex # Codex CLI # Check progress gt convoy list ``` -------------------------------- ### Gas Town Beads Routing Examples Source: https://docs.gastownhall.ai/reference Demonstrates how Gas Town routes beads commands based on issue ID prefixes, directing them to the appropriate rig or town-level beads. ```bash bd show gp-xyz # Routes to greenplace rig's beads bd show hq-abc # Routes to town-level beads bd show wyv-123 # Routes to wyvern rig's beads ``` -------------------------------- ### Molecule Status Output Example Source: https://docs.gastownhall.ai/concepts/molecules Example output when checking the status of a molecule, indicating completed, in-progress, and pending steps, along with overall progress. ```text You're working on molecule gt-abc (Feature X) ✓ gt-abc.1: Design ✓ gt-abc.2: Scaffold ✓ gt-abc.3: Implement → gt-abc.4: Write tests [in_progress] <- YOU ARE HERE ○ gt-abc.5: Documentation ○ gt-abc.6: Exit decision Progress: 3/6 steps complete ``` -------------------------------- ### Lock File Structure (JSON) Source: https://docs.gastownhall.ai/other/mol-mall-design Represents the structure of a lock file used to record installed formulas, their versions, pinning status, checksums, and installation details. ```json { "version": 1, "formulas": { "mol-polecat-work": { "version": "4.0.0", "pinned": true, "checksum": "sha256:abc123...", "installed_at": "2026-01-10T00:00:00Z", "source": "hop://molmall.gastown.io/formulas/mol-polecat-work@4.0.0" }, "mol-polecat-code-review": { "version": "1.3.0", "pinned": false, "checksum": "sha256:def456...", "installed_at": "2026-01-10T12:00:00Z", "source": "hop://molmall.gastown.io/formulas/mol-polecat-code-review@1.3.0" } } } ``` -------------------------------- ### Configure Gas Town Agents Source: https://docs.gastownhall.ai/installing Manages agent configurations, including listing available agents, creating custom aliases with specific flags, and setting the default agent for the town. ```bash # List available agents gt config agent list # Create an alias (aliases can encode model/thinking flags) gt config agent set codex-low "codex --thinking low" gt config agent set claude-haiku "claude --model haiku --dangerously-skip-permissions" # Set the town default agent (used when a rig doesn't specify one) gt config default-agent codex-low ``` -------------------------------- ### Manage Installed Formulas (Shell) Source: https://docs.gastownhall.ai/other/formula-resolution Provides commands to manage locally installed formulas, including listing, upgrading, pinning to a specific version, and uninstalling. These commands ensure control over the formula environment. ```shell # Manage installed formulas gt formula list --installed # What's in town-level gt formula upgrade mol-polecat-work # Update to latest gt formula pin mol-polecat-work@4.0.0 # Lock version gt formula uninstall mol-code-review-strict ``` -------------------------------- ### Event Logging Attribution Example Source: https://docs.gastownhall.ai/concepts/identity Shows an example of an event log entry that includes actor attribution. The 'actor' field is populated with the agent's identity, linking the event to the responsible agent. ```json { "ts": "2025-01-15T10:30:00Z", "type": "sling", "actor": "gastown/crew/joe", "payload": { "bead": "gt-xyz", "target": "gastown/polecats/toast" } } ``` -------------------------------- ### URI Scheme Examples for Cross-Workspace References Source: https://docs.gastownhall.ai/design/federation Demonstrates various URI formats for referencing work units across different scopes, including full HOP protocol, cross-platform references (beads://), and within-workspace shortcuts. ```plaintext hop://entity/chain/rig/issue-id hop://steve@example.com/main-town/greenplace/gp-xyz beads://platform/org/repo/issue-id beads://github/acme/backend/ac-123 gp-xyz # Local (prefix routes via routes.jsonl) greenplace/gp-xyz # Different rig, same chain ./gp-xyz # Explicit current-rig ref ``` -------------------------------- ### Multi-Repo Project Structure Example Source: https://docs.gastownhall.ai/design/federation Visualizes a project spanning multiple repositories using HOP URIs to reference work units in each. ```plaintext Project X ├── hop://team/frontend/fe-123 ├── hop://team/backend/be-456 └── hop://team/infra/inf-789 ``` -------------------------------- ### Session Cycling - Start - Shell Source: https://docs.gastownhall.ai/examples/hanoi-demo Demonstrates the first session of a 'session cycling' scenario. It starts a wisp, closes some issues, and then uses `gt handoff` to save the current state before the session ends. ```shell # Session 1: Start the wisp, close some issues WISP=$(bd mol wisp towers-of-hanoi-10 --json | jq -r '.new_epic_id') # ... close some issues ... # Context fills, need to cycle gt handoff -s "Hanoi demo" -m "Wisp: $WISP, progress: 400/1025" ``` -------------------------------- ### Add Go Bin Directory to PATH (Shell Script) Source: https://docs.gastownhall.ai/installing This snippet shows how to add the Go binary directory to your system's PATH environment variable. This is necessary if the 'gt' command is not found. It involves modifying shell configuration files like .bashrc or .zshrc. ```shell # Add to your shell config (~/.bashrc, ~/.zshrc) export PATH="$PATH:$HOME/go/bin" source ~/.bashrc # or restart terminal ``` -------------------------------- ### Add Project (Rig) to Gas Town Source: https://docs.gastownhall.ai/installing Adds a new project to the Gas Town workspace by cloning a Git repository. Sets up necessary directories for different Gas Town components. ```bash # Add your first project gt rig add myproject https://github.com/you/repo.git # This clones the repo and sets up: # ~/gt/myproject/ # ├── .beads/ # Project issue tracking # ├── mayor/rig/ # Mayor's clone (canonical) # ├── refinery/rig/ # Merge queue processor # ├── witness/ # Worker monitor # └── polecats/ # Worker clones (created on demand) ```