Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
10 changes: 9 additions & 1 deletion office.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Loading