Skip to content

feat(cli): mark the session and mirrors commands as cli-core's own - #3365

Merged
leemour merged 2 commits into
mainfrom
feat/mark-shared-session-commands
Nov 25, 2026
Merged

leemour merged 2 commits into
mainfrom
feat/mark-shared-session-commands

Conversation

@leemour

@leemour leemour commented Nov 25, 2026

Copy link
Copy Markdown
Member

Task

cli-base #727 added the lint rule reserved-shared-command (WC-CMD-34). It warns on correct CLIs, because four shared factories were not marked as cli-core's own: tokenSessionCommand, oauthSessionCommand, fileMirrorsCommand and a standalone accountRemoveCommand. The rule becomes an error on 2027-01-15, only after they are marked.

Why

A marked command is checked at startup (assertSharedContracts): any change to it after the factory returns stops the run. So before marking, I checked every CLI on origin/main that calls these factories.

  • tokenSessionCommand (attio, linear, slack, wordpress) and fileMirrorsCommand (notion): mounted as returned. Nothing edits them.
  • oauthSessionCommand: no CLI uses it yet. zm, drive and gcal will add their start flags through startOptions (feat(oauth): let oauthSessionCommand take the sign-ins a CLI kept before #3361), which the factory applies, so the contract holds.
  • accountRemoveCommand: asterisk, beeline, notion and yandex-disk wrap it in annotate(..., { effects: LOCAL_WRITE }). Marked, that would stop every run of those four CLIs at startup after their next bump.

What

  • tokenSessionCommand, oauthSessionCommand and fileMirrorsCommand go through sharedCommand, like appDoctorCommand. commands --json gives them origin: "cli-core".
  • accountRemoveCommand takes effects, so those four CLIs can pass LOCAL_WRITE instead of annotating. It stays unmarked until they do.

Testing

  • pnpm typecheck, pnpm lint, pnpm docs:check, the API report.
  • The session, mirrors, account removal, CRM, content and command lint tests run against the marked factories. New tests check the marker and that an option added after the factory is refused.

🤖 Generated with Claude Code

leemour and others added 2 commits November 25, 2026 22:33
cli-base's reserved-shared-command lint rule (WC-CMD-34) warns on CLIs
that mount tokenSessionCommand, oauthSessionCommand or fileMirrorsCommand,
because those were not marked as shared. They now are, so commands --json
gives them origin cli-core. A CLI changes them only through their
options. No CLI on main edits the returned commands.

accountRemoveCommand takes effects. asterisk, beeline, notion and
yandex-disk annotate the returned command with LOCAL_WRITE today, which
a marked command refuses at startup, so it stays unmarked until they
pass effects instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour force-pushed the feat/mark-shared-session-commands branch from 8cad392 to aead327 Compare November 25, 2026 21:37
@leemour
leemour merged commit d56229c into main Nov 25, 2026
40 of 41 checks passed
@leemour
leemour deleted the feat/mark-shared-session-commands branch November 25, 2026 21:48
leemour added a commit that referenced this pull request Nov 25, 2026
#3365 made session status and session list cli-core's own commands, so cli-template's MCP snapshot differs on
main. Its CI tests against npm, where #3365 is not out yet, so the snapshot can only change after the next release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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