feat(docx-mcp): CLI subcommands with full MCP tool parity#28
Open
stevenobiajulu wants to merge 1 commit intomainfrom
Open
feat(docx-mcp): CLI subcommands with full MCP tool parity#28stevenobiajulu wants to merge 1 commit intomainfrom
stevenobiajulu wants to merge 1 commit intomainfrom
Conversation
Safe-docx is advertised as both an MCP server and a CLI tool, but currently only exposes `serve` and `compare` as CLI commands. This proposal adds CLI subcommands for all 20+ MCP tools with ergonomic `--flag value` syntax, a batched `edit` command for multi-operation workflows, and session persistence across sequential CLI invocations. Key design decisions (informed by user preferences): - Full CLI parity: every MCP tool maps to a kebab-case subcommand - Session-aware: filesystem-based session store persists across commands - Batched `edit` as primary interface (avoids concurrent race issues) - Schema-driven flag generation from existing Zod tool catalog - Bookmark IDs only for paragraph targeting (consistent with MCP) - JSON output to stdout (consistent with existing `compare` command) Includes proposal.md, design.md, tasks.md, and spec delta for mcp-server. Validated with `openspec validate add-cli-tool-subcommands --strict`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
add-cli-tool-subcommands) for full CLI parity with MCP toolssafe-docx <tool-name>CLI subcommand with--flag valuesyntaxeditcommand as the primary editing interface:safe-docx edit file.docx --replace _bk_a "old" "new" --replace _bk_b "old2" "new2" -o out.docxContext
Inspired by the ergonomic
--set key=valueCLI syntax in open-agreements. Safe-docx currently requires raw JSON-RPC over MCP stdio for all operations beyondserveandcompare, which is impractical for terminal usage, scripting, and debugging.Files
openspec/changes/add-cli-tool-subcommands/proposal.mdopenspec/changes/add-cli-tool-subcommands/design.mdopenspec/changes/add-cli-tool-subcommands/tasks.mdopenspec/changes/add-cli-tool-subcommands/specs/mcp-server/spec.mdTest plan
openspec validate add-cli-tool-subcommands --strictpasses