Commit Graph

42 Commits

Author SHA1 Message Date
joshuavial
1afe3fb823 feat: add --all to gt crew list 2026-01-09 02:22:20 +13:00
jv
6afd85df4b feat: add --agent overrides to start/attach 2026-01-06 19:11:58 -08:00
gastown/crew/max
688624ca6b feat(crew): add --purge flag for full crew obliteration
- Add --purge flag to gt crew remove that:
  - Deletes the agent bead (not just closes it)
  - Unassigns any beads assigned to the crew member
  - Properly handles git worktrees (not just regular clones)
- Add gt doctor crew-worktrees check to detect stale cross-rig worktrees
- Worktrees in crew/ with hyphenated names are now properly cleaned up
  using git worktree remove instead of rm -rf

The --purge flag is for accidental/test crew that should leave no trace
in the capability ledger. Normal crew removal closes the agent bead to
preserve CV history per HOP architecture.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:11:14 -08:00
joe
d34e9b006c fix(crew): default to --all when only rig name provided (gt-s8mpt)
gt crew start beads and gt crew stop beads now default to --all
behavior when no crew names are specified, matching user expectations.

- crew start: accepts 0-1 args (rig only) and starts all crew
- crew stop: detects if single arg is a rig name vs crew name
- Updated help text with new examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 16:32:22 -08:00
Steve Yegge
1508177d9a fix(crew): infer rig from cwd for 'gt crew start --all'
The crew start command now infers the rig name from the current
working directory when using --all without specifying a rig. This
matches the behavior of crew stop and other commands.

Before: gt crew start gastown --all (required)
After:  gt crew start --all (infers from cwd)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 22:10:47 -08:00
toast
9683744b53 feat: Add 'spawn' as alias for 'start' subcommand across roles
Added 'spawn' as an alias for 'start' in the following commands:
- gt witness start → also gt witness spawn
- gt refinery start → also gt refinery spawn
- gt deacon start → also gt deacon spawn
- gt crew start → also gt crew spawn

This improves discoverability since agents are guessing 'spawn'
when trying to start roles.

Note: gt polecat does not have a 'start' command - polecat spawning
is handled via 'gt sling'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:30:24 -08:00
rictus
8ce52f166c feat(crew): Add gt crew stop command for stopping crew sessions
Implements gt crew stop with the following features:
- Stop individual crew members: gt crew stop dave
- Stop multiple: gt crew stop beads/emma beads/grip
- Stop all: gt crew stop --all
- Filter by rig: gt crew stop --all --rig beads
- Dry-run mode: gt crew stop --all --dry-run
- Force mode (skip output capture): gt crew stop dave --force

Uses same semantics as gt shutdown: captures output before stopping,
logs kill events to town log, provides clear status reporting.

(gt-q2am4)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:11:08 -08:00
slit
db316b0c3f feat(crew): Update gt crew start to use rig-first positional arg (gt-okk2z)
Changed command signature from `gt crew start [name...]` to
`gt crew start <rig> [name]` with --all flag support:

- Takes rig as first required positional argument
- Optional crew member name(s) as subsequent arguments
- --all flag to start all crew members in the rig
- Validates that either name or --all must be provided

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:55:08 -08:00
gastown/crew/joe
df46e75a51 Fix: Unknown subcommands now error instead of silently showing help
Parent commands (mol, mail, crew, polecat, etc.) previously showed help
and exited 0 for unknown subcommands like "gt mol foobar". This masked
errors in scripts and confused users.

Added requireSubcommand() helper to root.go and applied it to all parent
commands. Now unknown subcommands properly error with exit code 1.

Example before: gt mol unhook → shows help, exits 0
Example after:  gt mol unhook → "Error: unknown command "unhook"", exits 1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:52:23 -08:00
Steve Yegge
db07394dbe Support multiple names in gt crew add
Examples:
  gt crew add murgen croaker goblin    # Create all three
  gt crew add dave                     # Still works for single

- Continues on failure (warns but doesn't abort)
- Shows summary at end
- Existing workspaces skipped with warning
2025-12-30 19:43:17 -08:00
Steve Yegge
91fa5e63dc Replace 'gastown' with 'greenplace' in user-facing docs/examples
Using "greenplace" (The Green Place from Mad Max: Fury Road) as the
canonical example project/rig name in documentation and help text.
This provides a clearer distinction from the actual gastown repo name.

Changes:
- docs/*.md: Updated all example paths and commands
- internal/cmd/*.go: Updated help text examples
- internal/templates/: Updated example references
- Tests: Updated to use greenplace in example session names

Note: Import paths (github.com/steveyegge/gastown) and actual code
paths referencing the gastown repo structure are unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:03:06 -08:00
Steve Yegge
5204dd0eb4 feat: Allow remove and restart to take multiple crew names 2025-12-30 10:29:53 -08:00
Steve Yegge
f492aac19b feat: Allow starting multiple crew members at once
gt crew start beads/grip beads/fang beads/wolf now works
2025-12-30 10:23:45 -08:00
Steve Yegge
1b20e1bd2c feat: Auto-detect crew name in gt crew start from cwd
When run from inside a crew directory like gastown/crew/joe, the command
now auto-detects the crew workspace name instead of requiring it as an
argument. This matches the existing behavior of 'gt crew at'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:51:26 -08:00
Steve Yegge
67e1b1b06e Add gt crew restart --all for batch crew restarts
- Add --all flag to restart all running crew sessions
- Add --dry-run flag to preview without restarting
- Add --rig filter to target specific rig
- Extract restartCrewSession helper for reuse

🤝 Filed gt-1kljv for adding tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:50:35 -08:00
Steve Yegge
fa0dfc324e feat: Add crew session cycling fix and daemon exponential backoff (gt-ws8ol)
- Fix crew next/prev: Pass session name via key binding to avoid run-shell context issue
- Add TouchTownActivity() for town-level activity signaling
- Implement daemon exponential backoff based on activity.json:
  - 0-5 min idle → 5 min heartbeat
  - 5-15 min idle → 10 min heartbeat
  - 15-45 min idle → 30 min heartbeat
  - 45+ min idle → 60 min heartbeat (max)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 21:15:08 -08:00
Steve Yegge
b4a90ead72 feat: Add gt crew start command as alias for gt start crew
Users naturally expect "gt crew start <name>" to work alongside
"gt start crew <name>". This adds the alias, handling all input
formats: "name", "rig/name", and "rig/crew/name".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 13:41:49 -08:00
Steve Yegge
62f603bbe1 feat: Add C-b n/p keybindings for crew session cycling
When multiple crew sessions exist in the same rig, C-b n cycles to next
and C-b p cycles to previous. Sessions are sorted alphabetically and
wrap around.

Implementation:
- crew_cycle.go: Hidden `gt crew next/prev` commands for tmux to call
- crew_helpers.go: parseCrewSessionName and findRigCrewSessions helpers
- crew_at.go: Calls SetCrewCycleBindings on session creation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 11:51:48 -08:00
Steve Yegge
9446cd4806 Add mol-polecat-work, mol-polecat-lease, mol-gastown-boot formulas; fix spawn.go to use catalog ID 2025-12-25 11:47:06 -08:00
Steve Yegge
f86a73c2f0 feat: Add gcloud-style command grouping to gt help output
Organize 43 commands into 7 logical groups using cobra's built-in
AddGroup/GroupID feature:

- Work Management: spawn, sling, hook, handoff, done, mol, mq, etc.
- Agent Management: mayor, witness, refinery, deacon, polecat, etc.
- Communication: mail, nudge, broadcast, peek
- Services: daemon, start, stop, up, down, shutdown
- Workspace: rig, crew, init, install, git-init, namepool
- Configuration: account, theme, hooks, issue, completion
- Diagnostics: status, doctor, prime, version, help

Also renamed molecule to mol as the primary command name
(molecule is now an alias).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 02:32:01 -08:00
Steve Yegge
e8dff71b37 crew at: don't link windows by default, add --detached flag
When running `gt crew at` from inside tmux:
- No longer auto-links the target session as a tab
- Just prints "Started X. Use C-b s to switch."
- User stays in their current pane

When running from outside tmux:
- Default: attach to the session (existing behavior)
- With -d/--detached: start session without attaching

This gives users more control over tmux session navigation and
reduces confusion for tmux newcomers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 15:22:12 -08:00
Steve Yegge
ba2db2bc11 feat: implement account management for multi-account Claude Code (gt-3133)
Adds support for managing multiple Claude Code accounts in Gas Town:

- accounts.json config parsing in mayor/ directory
- gt account list/add/default commands
- GT_ACCOUNT env var support with priority resolution
- --account flag on gt spawn and gt crew at commands
- CLAUDE_CONFIG_DIR injection into tmux sessions

Priority order: GT_ACCOUNT env var > --account flag > default from config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:05:14 -08:00
Steve Yegge
5d7291962a Rename ephemeral -> wisp terminology throughout Gas Town
- .beads-ephemeral/ -> .beads-wisp/
- Rename doctor checks: EphemeralCheck -> WispCheck
- Update all docs to use 'transient' for polecats, 'wisp' for molecules
- Preserve 'ephemeral' only as descriptive adjective for wisps
- Steam engine metaphor: wisps are steam vapors that dissipate

Part of Christmas launch wisp terminology unification.
2025-12-22 00:55:31 -08:00
Steve Yegge
9c3cc0255c refactor(cmd): split crew.go into focused modules
Break down 1184-line crew.go into 8 smaller, focused files:
- crew.go: command definitions, flags, init (229 lines)
- crew_helpers.go: shared utilities (235 lines)
- crew_lifecycle.go: remove/refresh/restart (219 lines)
- crew_status.go: status command (154 lines)
- crew_at.go: session attachment (142 lines)
- crew_maintenance.go: rename/pristine (121 lines)
- crew_list.go: list command (89 lines)
- crew_add.go: add command (74 lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:46:12 -08:00
Steve Yegge
8efaa59446 feat: gt doctor checks for branch hygiene
Add two new doctor checks:

1. persistent-role-branches: Detects crew/*, witness/rig, refinery/rig
   directories not on main branch. Persistent roles should work directly
   on main to avoid orphaned work.

2. beads-sync-orphans: Detects code changes on beads-sync branch that
   weren't merged to main, catching cases where merges lose code changes.

Also adds ensureMainBranch() to crew attach to auto-switch persistent
roles to main at session start.

Closes gt-p9zh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:19:32 -08:00
Steve Yegge
c7e83b1619 Add persistent theme config and fix crew session theming
- Fix crew sessions missing theme application (ConfigureGasTownSession)
- Add theme persistence to .gastown/config.json
- gt theme <name> now saves to config
- gt theme apply reads from config, falls back to hash-based default
- Improve rig detection using GT_RIG env var and path parsing
- gt theme shows whether theme is configured or default

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 20:43:34 -08:00
Steve Yegge
88c6279906 Improve crew resume prompt with gt prime reminder
Add explicit "Run gt prime" to the crew resume prompt and mention
checking in-progress issues for better context recovery.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 17:22:52 -08:00
Steve Yegge
d8f01171c8 feat(deacon): design and beads for Deacon health orchestrator
- Update gt-5af with full Deacon design (AI agent, not just Go daemon)
- Create 8 implementation tasks as children of gt-5af
- Add AGENTS.md for agent onboarding
- Fix crew restart timing (add debounce, delay for Claude init)
- Add SendKeysDelayedDebounced to tmux for better prompt injection

Deacon will monitor Mayor/Witnesses proactively and handle lifecycle
requests from Mayor/Witnesses/Crew reactively.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 17:19:28 -08:00
Steve Yegge
3942152d92 fix(crew): exec claude when already in target session 2025-12-19 15:11:49 -08:00
Steve Yegge
f106752149 fix(crew): detect when already in target session, skip attach 2025-12-19 15:09:07 -08:00
Steve Yegge
8e56a075a7 feat(crew): add resume prompt when restarting Claude
When `gt crew at` detects Claude has exited (shell running), or when
`gt crew restart` is used, now sends a crew-specific prompt after priming:

"Read your mail, act on anything urgent, else await instructions."

This gives crew workers clear direction on resume without requiring
manual prompting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:06:14 -08:00
Steve Yegge
8b853ac4d2 bd sync: merge queue swarm launched, molecules complete 2025-12-19 14:47:08 -08:00
Steve Yegge
4d0492fdf6 feat(tmux): add per-rig color themes and dynamic status line (gt-vc1n)
Add tmux status bar theming for Gas Town sessions:

- Per-rig color themes auto-assigned via consistent hashing
- 10 curated dark themes (ocean, forest, rust, plum, etc.)
- Special gold/dark theme for Mayor
- Dynamic status line showing current issue and mail count
- Mayor status shows polecat/rig counts

New commands:
- gt theme --list: show available themes
- gt theme apply: apply to running sessions
- gt issue set/clear: agents update their current issue
- gt status-line: internal command for tmux refresh

Status bar format:
- Left: [rig/worker] role
- Right: <issue> | <mail> | HH:MM

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 14:17:39 -08:00
Steve Yegge
4048cdc373 fix(lint): resolve all errcheck warnings
Fix ~50 errcheck warnings across the codebase:

- Add explicit `_ =` for intentionally ignored error returns (cleanup,
  best-effort operations, etc.)
- Use `defer func() { _ = ... }()` pattern for defer statements
- Handle tmux SetEnvironment, KillSession, SendKeysRaw returns
- Handle mail router.Send returns
- Handle os.RemoveAll, os.Rename in cleanup paths
- Handle rand.Read returns for ID generation
- Handle fmt.Fprint* returns when writing to io.Writer
- Fix for-select with single case to use for-range
- Handle cobra MarkFlagRequired returns

All tests pass. Code compiles without errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 12:44:42 -08:00
Steve Yegge
c8d27f2f3e feat(crew): add restart command to kill and restart session fresh
Add `gt crew restart <name>` command that kills the tmux session and
starts fresh with Claude. Unlike `refresh`, this does not send handoff
mail - it is a clean slate restart. Useful when a crew member gets
confused or needs context cleared.

Alias: gt crew rs

Resolves: gt-1fl

🤝 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 12:07:00 -08:00
Steve Yegge
2edf2358dd fix: session start timing and MR type issues
- Add 200ms delay after NewSession before sending keys to fix race
  condition where shell is not ready (mayor.go, crew.go)
- Use merge-request type instead of task for gt mq submit (mq.go)

Fixes gt-tulx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 22:17:13 -08:00
Steve Yegge
c1954b3431 fix(crew): use strings.Split instead of filepath.SplitList for path parsing
filepath.SplitList is for PATH-like env vars (colon/semicolon separated),
not for splitting file paths. This caused inferRigFromCwd to always fail
since SplitList returns the whole path as one element, making the fallback
logic never trigger.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 20:42:03 -08:00
Steve Yegge
915594c44c Add crew rename, pristine commands and status integration
- gt crew rename: Rename crew workspace (kills session, renames dir)
- gt crew pristine: Sync crew workspaces with git pull + bd sync
- gt status: Show crew workers per rig with 👤 indicator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 19:20:41 -08:00
Steve Yegge
c4b942b7e9 fix: gt crew at restarts Claude if it has exited
- Check pane_current_command to detect if Claude is still running
- If shell is detected (bash, zsh, etc.), Claude exited - restart it
- Re-prime after restart with gt prime

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 20:10:05 -08:00
Steve Yegge
691971a16a feat: crew attach auto-detection, worktree polecats, beads mail
- gt crew at: auto-detect crew from cwd, run gt prime after launch
- Polecats now use git worktrees from refinery (faster than clones)
- Updated architecture.md for two-tier beads mail model
- Town beads (gm-*) for Mayor mail/coordination
- Rig .beads/ symlinks to refinery/rig/.beads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:51:36 -08:00
Steve Yegge
b56977218b feat: add gt crew commands (list, attach, remove, refresh, status)
Add remaining crew subcommands for user-managed workspaces:

- gt crew list: List crew workspaces with session/git status
- gt crew at/attach: Start or attach to tmux session
- gt crew remove: Remove workspace with safety checks
- gt crew refresh: Context cycling with mail-to-self handoff
- gt crew status: Show detailed workspace status with mail info

All commands support --rig flag for explicit rig selection and
--json output where appropriate.

Closes: gt-cik.9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 20:57:26 -08:00
Steve Yegge
887c0f19d1 feat: add gt crew add command for user-managed workspaces
Implements gt-cik.2: Create crew workspace command with:
- internal/crew/types.go: CrewWorker type definition
- internal/crew/manager.go: Manager for crew lifecycle
- internal/crew/manager_test.go: Unit tests
- internal/cmd/crew.go: CLI command with --rig and --branch flags

Crew workers are user-managed persistent workspaces that:
- Clone repo into <rig>/crew/<name>/
- Create optional feature branch (crew/<name>)
- Set up mail directory for delivery
- Initialize CLAUDE.md with crew worker prompting
- Are NOT registered with witness (user-managed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 20:46:52 -08:00