review.version
Check the Re:VIEW CLI version to ensure proper setup for validating and correcting manuscript files, preventing common writing errors.
Instructions
Return Re:VIEW CLI version (prefers bundle exec).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes |
Implementation Reference
- src/index.ts:440-447 (handler)Handler for the 'review.version' tool: runs 'review --version' via withBundle helper and returns the version string as JSON.case "review.version": { const { stdout } = await withBundle(args.cwd as string, ["review", "--version"]); return { content: [ { type: "text", text: JSON.stringify({ version: stdout.trim() }) } ] }; }
- src/index.ts:256-260 (schema)Input schema for 'review.version' tool requiring 'cwd' parameter.inputSchema: { type: "object", properties: { cwd: { type: "string" } }, required: ["cwd"] }
- src/index.ts:253-261 (registration)Tool definition object for 'review.version' included in the tools array returned by listTools.{ name: "review.version", description: "Return Re:VIEW CLI version (prefers bundle exec).", inputSchema: { type: "object", properties: { cwd: { type: "string" } }, required: ["cwd"] } },
- src/index.ts:425-429 (registration)ListTools request handler registration that exposes the tools list including 'review.version'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools }; });
- src/index.ts:51-61 (helper)Helper function 'withBundle' used by the 'review.version' handler to prefer bundled 'review' command execution.async function withBundle(cwd: string, argv: string[]) { try { // If Bundler works, prefer bundle exec to respect project Gemfile await execp("bundle", ["exec", "ruby", "-v"], { cwd, timeout: 8000 }); return await execp("bundle", ["exec", ...argv], { cwd, timeout: 60000, maxBuffer: 10*1024*1024 }); } catch { // Fallback to direct command const [cmd, ...rest] = argv; return await execp(cmd, rest, { cwd, timeout: 60000, maxBuffer: 10*1024*1024 }); } }