Skip to content

docs: add cookbook of installable agtermctl recipes - #305

Merged
umputun merged 13 commits into
masterfrom
cookbook
Jul 28, 2026
Merged

docs: add cookbook of installable agtermctl recipes#305
umputun merged 13 commits into
masterfrom
cookbook

Conversation

@umputun

@umputun umputun commented Jul 28, 2026

Copy link
Copy Markdown
Owner

adds cookbook/, a collection of installable agtermctl workflows, plus the repo's first CONTRIBUTING.md. Asked for in #293, where olfway closed with "a small repository with scripts like these might be useful as a collection of practical recipes". #71 was already that, in the wrong place.

no Swift, no compiled code, no tests. Docs, shell recipes and one CI job.

Seven recipes

recipe what it does from
project-switcher show only one project's workspaces #293
park-and-resume snapshot a project's workspaces, close them, bring them back #293
window-per-project park every other window in the Dock, raise one #293
fzf-path-picker pick a path in an overlay, type it into the session my keymap
overlay-and-split Smart Split plus TUI launchers, keymap-only my keymap
claude-session-resume per-tab Claude Code resume @ssgreg
codex-session-resume per-tab Codex resume @brusnigin

each is a directory with a six-heading README (What it does / Requirements / Setup / Usage / How it works / Limits) and its scripts. cookbook/README.md indexes them; cookbook/CONTRIBUTING.md covers submissions.

Recipes are pinned snapshots, not a keep-in-sync surface. Each names the minimum version it needs and is fixed reactively when someone reports breakage. A control-API change carries no obligation to sweep cookbook/, and CLAUDE.md now says so explicitly, so nobody adds it as a sixth surface by reflex.

CI: a cookbook paths filter and job on ubuntu, checking index consistency both directions, the six headings, kebab-case names, shebangs, shellcheck over .sh, and zsh -n over .zsh. Recipe-only changes still run zero Swift jobs. Editing ci.yml runs the macOS jobs once, which is why they fire on this PR.

Root CONTRIBUTING.md follows revdiff's structure with ralphex's AI-assisted section, retargeted at Swift 6, host-free agtermCore, and swiftlint --strict. It adds the question those two don't need: does this belong in agterm or upstream in ghostty.

Defects found and fixed while building this, nine across three review passes. Four are in the scripts as published in #293, so that thread needs a correction either way:

  • agt-park.sh with no argument matched every workspace and deleted the window
  • agt-park.sh overwrote a good snapshot with [] when nothing matched, silently, after the shells were already gone
  • agt-win.sh errored on every closed window in the bundle
  • agt-win.sh with a name matching nothing parked everything and raised nothing

five more were found here. The replay claimed captured argv was absolute, when it is argv as typed, so a Homebrew binary died with 127; it now goes through zsh -lc. Snapshots were world-readable while holding full argv, secrets included, so the script sets umask 077. codex-resume.zsh's rollout guard never fired, since [[ … && $#s ]] is a string test in zsh. The cookbook filter could not see its own workflow. The shellcheck step ran without pipefail.

Not verified by running. No recipe was executed at any point, since several delete workspaces and close shells and the only agterm on this machine is the live one. Every command, flag, jq path and version pin was checked against ControlProtocol, agtermctlKit, the bundled reference and CHANGELOG.md instead. The one thing that needed a live answer, whether --command survives shell quoting, was settled on a throwaway isolated instance: it runs as /bin/bash --noprofile --norc -c 'exec -l <value>', so quoting applies.

@ssgreg, @brusnigin: your functions from #71 are in here with credit and a link back. Say the word if you'd rather they weren't.

Copilot AI review requested due to automatic review settings July 28, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umputun
umputun merged commit 2882632 into master Jul 28, 2026
8 checks passed
@umputun
umputun deleted the cookbook branch July 28, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants