From b416ee852db7ed68595a281aed6a70adeba12db6 Mon Sep 17 00:00:00 2001 From: hannesreinsch Date: Fri, 11 Sep 2026 20:24:44 +0200 Subject: [PATCH] feat: office install runs install.sh The same verb as zyx and murmurflow: set it up, start nothing. `office install [--theme]` runs ./install.sh, which is idempotent. Before this the word fell through to the fuzzy repo match and looked for a repo called "install". CI's second fresh-HOME install now goes through `office install`. All eight probes in bin/ pass locally. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 3 ++- README.md | 1 + office.zsh | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc66a58..0566a87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,12 +100,13 @@ jobs: # A fresh HOME, so the installer is tested the way a stranger meets it: # nothing sourced yet, no ~/.tmux.conf, and it has to be safe to run twice. + # The second run goes through `office install`, so the verb is proven to reach the script. - name: install.sh on a fresh HOME, twice run: | export HOME="$RUNNER_TEMP/fresh" mkdir -p "$HOME" ./install.sh - ./install.sh + zsh -f -c 'bin/office install' test "$(grep -c 'office.zsh' "$HOME/.zshrc")" = 1 test "$(grep -c 'source-file' "$HOME/.tmux.conf")" = 1 test -L "$HOME/.local/bin/office" diff --git a/README.md b/README.md index d348b4b..f9c9346 100644 --- a/README.md +++ b/README.md @@ -408,6 +408,7 @@ live ones for exactly that reason. | `office clean` | pick panes to close, heaviest first (rarely needed) | | `office sweep [h]` | close offices you walked away from, and everything in them | | `office update` | pull the newest agent-office | +| `office install [--theme]` | wire office into zsh and tmux again — the same as `./install.sh`, safe to re-run, starts nothing | | `office clean --idle [h]` | no picker: close anything idle over `h` hours | | `office help` | all of the above, with the diagram | diff --git a/office.zsh b/office.zsh index f81e8f0..f61e9f6 100644 --- a/office.zsh +++ b/office.zsh @@ -25,6 +25,7 @@ # office clean pick panes to close and reclaim their RAM # office sweep close offices you walked away from, and all they run # office update pull the newest agent-office (never happens on its own) +# office install wire office into zsh + tmux again: ./install.sh [--theme] # # Bare `office` prints this. `ao` and `o` are the short aliases. # Key bindings live in office.tmux.conf; `office help` lists every one of them. @@ -1405,6 +1406,8 @@ ${r}" print -P " ${g}office list${r} Same as doctor." print -P " ${g}office update${r} Pull the newest agent-office. Never happens on its own:" print -P " ${d}'office on' only tells you when you are behind.${r}" + print -P " ${g}office install${r} Wire office into zsh and tmux again. Safe to re-run;" + print -P " ${d}starts nothing. Same as ./install.sh, and --theme works.${r}" print -P " ${g}office cd${r} ${d}[x]${r} Walk the shell into another worktree — yours, or the one an" print -P " ${d}agent is working in. Checks nothing out, so nothing collides;${r}" print -P " ${d}the file editor follows. 'office cd develop' when git says that${r}" @@ -1454,7 +1457,7 @@ office() { # a zoomed window does to the geometry underneath. The exemptions are the # verbs that only print, detach, or close the whole thing: those never read a # column, so taking the operator's zoom away for them would be rude. - [[ $cmd == (help|-h|--help|list|ls|status|doctor|check|update|upgrade|sweep|stale|break|pause|bg|away|brb|off|out|end|quit|stop|home|cd|goto|hop) ]] \ + [[ $cmd == (help|-h|--help|list|ls|status|doctor|check|install|update|upgrade|sweep|stale|break|pause|bg|away|brb|off|out|end|quit|stop|home|cd|goto|hop) ]] \ || _office_unzoom "$(_office_here)" case $cmd in on|up|in|back|work|resume) @@ -1513,6 +1516,11 @@ office() { (( back )) || _office_add_pane "$OFFICE_SESSION_LABEL" "$OFFICE_SESSION_CMD$_OFFICE_DESK_END" \ "$(_office_root "$PWD")" CLAUDE _office_number "$s" ;; + install) + # The verb every tool here shares (zyx, murmurflow): set it up, start nothing. + # Here that is install.sh, which is idempotent. Without this arm the word fell + # through to the fuzzy repo match below and looked for a repo called "install". + zsh "$_OFFICE_HOME/install.sh" "${@[2,-1]}" ;; update|upgrade) [[ -d $_OFFICE_HOME/.git ]] || { print -u2 "office: $_OFFICE_HOME is not a git checkout"; return 1 } if [[ -n $(git -C "$_OFFICE_HOME" status --porcelain) ]]; then