Repository navigation
MCP: cloudpin_switch_plan, the plan a person would run on a mismatch (#112) - #178
Merged
Merged
Conversation
…112) A fourth read-only tool: what `cloudpin switch --json` prints without --yes, from planSwitch, plus a note saying who the plan is for. Nothing is run. switch.ts and the tool build the answer with one function, so the shapes can't drift. Commands and pinned IDs stay whole, since they come from the pin file and have to run. What the active login said is shortened in the text, as in cloudpin_doctor, and only as a whole value, so a pinned ID that contains it stays runnable. A CLI's own switch command passes the hook and cloudpin_check by design, so the description, the note and the server's instructions all say to show a plan to the user and never run it, including the lines that say "yourself". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README, docs/mcp.md, docs/agent-sdk.md, SECURITY.md, the CLI help and the Cursor demo's setup list name cloudpin_switch_plan or the new count (the demo still said two). docs/mcp.md says what a plan holds and that "show it, don't run it" is advice. README stays at its size. CHANGELOG's #112 line now covers both tools, shorter than it was, and ROADMAP marks #112 done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…112) On a mismatch the agent shows the user the plan and never runs it. When cloudpin seems not to be guarding, it calls cloudpin_doctor and passes on what it finds and the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The one manual line that printed a variable's value, for a configuration name cloudpin won't pass on. A plan now reaches an agent too, so the line names the variable only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.1 move out CHANGELOG was over its size limit, so 1.0.0 to 1.1.2 move to docs/changelog-1.0-1.1.md, as 0.x did. THREAT_MODEL names what the switch work found: an agent can run a CLI's own switch command, and Cursor's matcher is a text filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #112.
cloudpin_switch_plan, the fourth read-only MCP tool. On a mismatch it gives the commands that move each CLI to its pinned account, or what to do by hand, for the user to run. Nothing is run, and no tool switches accounts (#15).cloudpin switch --jsonprints without--yes, from one shared function, plus anote. A test compares the rest torunSwitch's output.reason, as incloudpin_doctor. No variable's value is printed: the one line that did (CLOUDSDK_ACTIVE_CONFIG_NAME) now names the variable only, in the terminal too.cloudpin_checkby design, so an agent could run these commands unasked. The tool's description, the note, the server's instructions and the plugin skill all say to show the plan and not run it. That is advice, anddocs/mcp.mdsays so; whether the hook should ask on those commands is a separate question for the maintainer.cloudpin_doctorandcloudpin_switch_plan.Also in this PR
cloudpin execfix from cloudpin switch: plan, confirm once, run, re-check (#14) #102 under Security. It was over its size limit, so 1.0.0 to 1.1.2 move todocs/changelog-1.0-1.1.md, as 0.x did.Evidence
test/mcp-switch-plan.test.ts, 29 tests, seen failing first. The nothing-runs test has a control:switch --yesdoes run the switch commands through the same fake CLIs.npm run typecheckexit 0;npx vitest runpasses (3007 before the docs commit).matchwith no commands; a made-up pin givesmismatchwithmanuallines naming that pin;ranempty,afternull, accounts unchanged.Not tested
A real
runline on a real account (no second login here); it is covered with fake CLIs.🤖 Generated with Claude Code