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. Executes 'review --version' (preferring bundle exec if available) in the given cwd and returns the version as JSON text content.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:253-261 (schema)Schema definition for the 'review.version' tool, including name, description, and input schema requiring 'cwd'.{ 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)Registration of the listTools handler which returns the tools array including 'review.version' schema.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools }; });
- src/index.ts:51-61 (helper)Helper function 'withBundle' used by the handler to execute the 'review' command, preferring bundle exec if available.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 }); } }