Skip to content

fix(cli): mark commands that change only this computer as local writes - #360

Merged
leemour merged 1 commit into
mainfrom
fix/local-writes
Oct 1, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/local-writes

Conversation

@leemour

@leemour leemour commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Task

tg-cli's command page says "Changes something in Telegram" under commands that change only local files. (max-cli builds its own versions of these commands and never showed the label; it gets its own fix.)

Why

mutates: true was on commands that write to the messenger and on ones that write only the config file, the group-rules file, the recipient lists or the keyring.

What

Every mutates: true in src/ classified. These 12 change only this computer and now carry local: true (cli-core 0.15.0, leemour/cli-core#37):

  • config set, config unset — the config file
  • chats rules set, chats rules unset — the group-rules file (src/moderation/rules.ts)
  • recipients add|remove|clear — the recipient list file (add reads the messenger to resolve the chat, changes nothing there)
  • bot auth set|remove — the keyring (auth set checks the token with the messenger, a read)
  • bot recipients add|remove|clear — the bot's recipient list

Every other one stays a messenger write, including chats moderate (deletes messages, removes people).

mutates stays on all of them, so commands --json keeps writes: yes. cli-core devDependency 0.15.0; peer range widened to <0.16.0 (an older cli-core ignores local and shows the old line).

Decision: a second annotation (local) instead of dropping mutates — agents read writes to tell reads from writes, and a local write is still a write.

Not released: under ## Unreleased, per the one-release-a-day rule (0.97.0 shipped today).

Testing

pnpm lint && pnpm typecheck && pnpm test && pnpm docs:check — all pass. Checked against tg-cli with a local build of this branch: pnpm generate swaps exactly these 12 labels to "Changes something on this computer only."; chats moderate and session end keep the Telegram line; commands --json shows all 12 with mutates: true; pnpm parity:check passes.

🤖 Generated with Claude Code

`config set|unset`, `chats rules set|unset`, `recipients add|remove|clear`,
and the bot's `auth set|remove` and `recipients add|remove|clear` were marked
`mutates` like a send, so the commands pages of tg-cli and max-cli said they
change Telegram or MAX. They write the config file, the group-rules file, the
recipient lists and the keyring, nothing else.

They now carry `local: true` from cli-core 0.15.0 beside `mutates: true`, so
`commands --json` still shows `writes: yes`. `chats moderate` keeps the
messenger label: it deletes messages and removes people. The peer range
widens to cli-core <0.16.0; an older cli-core ignores `local`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour
leemour merged commit aac73ec into main Oct 1, 2026
6 checks passed
leemour added a commit that referenced this pull request Oct 1, 2026
bin/release: 0.97.0 is already on npm. Released early: tg-cli and max-cli: their command pages label config set, chats rules set and the recipient lists as changing the messenger; the fix (#360) needs this release, owner approved the early release (NEED-513)
@leemour
leemour deleted the fix/local-writes branch October 1, 2026 21:49
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.

1 participant