Skip to content

feat(cli)!: cli-core's shared mcp and doctor; session list, guide and first screen - #17

Merged
leemour merged 2 commits into
mainfrom
refactor/shared-commands
Oct 29, 2026
Merged

leemour merged 2 commits into
mainfrom
refactor/shared-commands

Conversation

@leemour

@leemour leemour commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Task

Move gcal onto cli-core 0.471.0's shared commands for CLIs that are not messengers (cli-core #2129), and close the alignment-review gaps: session list (NEED-1884), the first help screen and guide, the MCP catalogue snapshot.

Why

gcal had its own bare mcp (no serve | revoke | server | config | add | check, no --profiles, no --http) and its own doctor, both near copies of drive's. The handbook asks for session list (WC-ACCT-12) and a pinned command catalogue (H-8); gcal had neither.

What

  • mcp — appMcpCommand(IDENTITY, configuration, { name: "Google Calendar", untrusted: [...], permissionExample, skill, signedIn }). src/mcp.ts, src/commands/mcp.ts and the old test are deleted. gcal <profile> mcp → gcal <profile> mcp serve (WC-MCP-9: no profile picked; WC-MCP-11: instructions name event titles, descriptions, locations, attendee and organizer names, shared calendar names). gcal's rules hold: api call and calendars.clear are never offered (mcp: false), sharing at ask, events.notify / sharing.notify apply over MCP — all still asserted in api.test.ts, calendar*.test.ts.
  • doctor — cli-core's appDoctorReport (store, oauth_client, profile_lock) plus gcal's credential_file (keyring|file, fix: sign-in kept in a file, typed sign-in reasons, store closed before the answer, Google token leak rules #15). The command stays in gcal: AppDoctorOptions has no hook for a CLI's own field. oauth_client is own with GCAL_GOOGLE_CLIENT_ID, otherwise null with a reason that says a profile signed in with --client-file keeps its own client.
  • gcal session list — every profile here (config or signed in once) with signed_in, account, credential_storage; takes no profile, picks none (WC-ACCT-1, WC-ACCT-12). gcal's own: cli-core has no helper for non-messengers. "Signed in" = the sign-in is in the file or keyring; the account file survives session end, so it is not used. The same definition feeds mcp check.
  • First screen and guide — cli-core's installHelp (via firstScreen) and guideCommand, with scenarios/ (set-up, agent-access, find-time), as drive does; checkGuide runs in src/mcp.test.ts.
  • Contracts — new contracts/mcp-catalogue.json (H-8); help.snap, mcp-tools.json, docs/commands.md, test matrix regenerated. @modelcontextprotocol/server dropped (no gcal code serves MCP any more); biome.json's rule now exempts only the test harness src/testing/mcp.ts.
  • Docs — every gcal <profile> mcp → mcp serve; CHANGELOG under "Changed — may break callers" says how to re-add an agent entry.

Testing

  • pnpm release:check passes locally: standards, lint, typecheck, test:coverage (266 tests), lint:commands, cross-CLI audit (0 new), contracts, test matrix (0 missing), docs, generate:check, version, no-leak, package smoke (now also runs guide from the installed package).
  • Ran the built CLI: guide, guide set-up --json, mcp config --permission api=readonly, mcp config --profiles all, mcp serve --profiles nope (exit 2), session list --json, --help.

🤖 Generated with Claude Code

leemour and others added 2 commits October 27, 2026 23:24
… first screen

gcal moves onto cli-core 0.471.0's commands for CLIs that are not messengers,
so its mcp and doctor match drive's and zoom's.

- mcp: cli-core's appMcpCommand replaces src/mcp.ts and src/commands/mcp.ts.
  `gcal <profile> mcp` is now `mcp serve`, with revoke, server, config, add,
  check, --profiles, --http; no profile is ever picked (WC-MCP-9, WC-ACCT-1).
  The instructions name the untrusted text (WC-MCP-11). api call and
  calendars.clear stay hidden (mcp: false); sharing stays at ask;
  events.notify and sharing.notify still apply.
- doctor: cli-core's appDoctorReport (store, oauth_client, profile_lock) plus
  gcal's credential_file. appDoctorCommand has no hook for a field of the
  CLI's own, so the command stays in gcal.
- session list (WC-ACCT-12, NEED-1884): every profile here with signed_in,
  account and credential_storage; no profile taken or picked. cli-core has
  no helper for non-messengers, so it is gcal's own. Signed in means the
  sign-in is in the file or the keyring; session end keeps the account file.
- guide with scenarios/ and the first help screen, through cli-core's
  guideCommand and installHelp, as drive does.
- contracts/mcp-catalogue.json pins the commands agents can find (H-8);
  help.snap, mcp-tools.json, docs/commands.md and the test matrix are
  regenerated.
- Tests reach MCP through `gcal personal mcp serve` (src/testing/mcp.ts),
  keeping every gcal-only MCP assertion.

BREAKING CHANGE: `gcal <profile> mcp` is `gcal <profile> mcp serve`; add the
agent entry again with `mcp add` or `mcp config`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​wirecat/​cli-core@​0.469.0 ⏵ 0.471.080 +1100100 +19690

View full report

@leemour
leemour merged commit 9565bd1 into main Oct 29, 2026
12 checks passed
@leemour
leemour deleted the refactor/shared-commands branch October 31, 2026 00:39
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