Skip to content

feat: add 5 missing entire CLI tools (16 total) - #2

Merged
terry90918 merged 3 commits into
mainfrom
develop
May 14, 2026
Merged

feat: add 5 missing entire CLI tools (16 total)#2
terry90918 merged 3 commits into
mainfrom
develop

Conversation

@terry90918

@terry90918 terry90918 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add entire_version — verify CLI installation (explain skill prerequisite)
  • Add entire_status — get active session ID (session-handoff workflow core)
  • Add entire_search — stable entire search with repo/branch/author/date filters (excludes unreliable checkpoint search --json)
  • Add entire_explain_commit — retrieve transcript by git commit SHA (entire explain --commit <SHA> --no-pager)
  • Add entire_explain_checkpoint — checkpoint transcript with default/full/raw modes
  • Fix eslint.config.js tsconfigRootDir for worktree isolation

Total tools: 11 → 16. All 21 tests pass, typecheck + lint + build clean.

Test plan

  • bun run test — 21/21 pass
  • bun run typecheck — no errors
  • bun run lint — no warnings
  • bun run build — dist/ generated

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added explain tools for analyzing commits and checkpoints
    • Added search tool for querying checkpoint history
    • Added version and status reporting tools
  • Documentation

    • Updated documentation reflecting expanded tool set (16 tools total)
  • Tests

    • Added comprehensive test coverage for explain, search, and miscellaneous tools
  • Chores

    • Enhanced ESLint configuration for TypeScript project-aware parsing

Review Change Stack

RED — tools not yet registered/implemented:
- entire_version, entire_status (misc.ts)
- entire_search (search.ts)
- entire_explain_commit, entire_explain_checkpoint (explain.ts)
…in_commit, explain_checkpoint

Add tools identified by gap analysis against entireio/skills:
- entire_version: verify CLI installation (explain skill prerequisite)
- entire_status: get active session ID (session-handoff workflow core)
- entire_search: stable `entire search` command with repo/branch/author/date filters
- entire_explain_commit: retrieve transcript by git commit SHA
- entire_explain_checkpoint: retrieve checkpoint transcript with default/full/raw modes

Also fix eslint.config.js tsconfigRootDir for worktree isolation.
Total tools: 11 → 16
Copilot AI review requested due to automatic review settings May 14, 2026 13:17
@terry90918 terry90918 added the enhancement New feature or request label May 14, 2026
@terry90918 terry90918 self-assigned this May 14, 2026
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR expands the Entire CLI MCP server with three new tool groups—explain, search, and extended misc tools—bringing the total from 11 to 16 registered tools. Implementation, Vitest suites, and integration are included alongside ESLint infrastructure upgrades and documentation updates reflecting the expanded toolset.

Changes

Entire MCP Tool Expansion and Integration

Layer / File(s) Summary
ESLint TypeScript Project Configuration
eslint.config.js
Configures ESLint to enable TypeScript project-aware parsing by computing __dirname from import.meta.url, wiring tsconfigRootDir and project: "./tsconfig.json" into parserOptions, and consolidating ignore patterns to include eslint.config.js and .worktrees/**.
Explain Tools: Commit and Checkpoint Commands
src/tools/explain.ts, src/__tests__/tools/explain.test.ts
Introduces registerExplainTools with two MCP tools: entire_explain_commit and entire_explain_checkpoint. Each tool accepts a SHA or checkpoint ID, runs the corresponding CLI command with optional flags (--full or --raw-transcript for checkpoint), and returns stdout as text with fallback messages and error handling. Vitest suites verify argument construction, response parsing, and error conditions.
Search Tools: Checkpoint Search with Filters
src/tools/search.ts, src/__tests__/tools/search.test.ts
Introduces registerSearchTools with the entire_search MCP tool that builds CLI arguments from optional filters (repo, branch, author, date), executes the search command, and returns results as text with a "No results found." fallback. Vitest suite verifies filter argument appending, stdout parsing, and error responses.
Misc Tools Extension: Version and Status Commands
src/tools/misc.ts, src/__tests__/tools/misc.test.ts
Extends registerMiscTools with entire_version and entire_status tools that invoke their respective CLI commands and return output as text with fallback messages. Both accept optional repo_dir to set the working directory. Vitest suites verify CLI invocation contracts, output parsing, and error conditions.
Server Integration and Documentation
src/index.ts, CLAUDE.md
Registers registerExplainTools(server) and registerSearchTools(server) during server startup. Updates CLAUDE.md to document the expanded project structure (adding __tests__/tools/ and reorganized tools/ layout) and tool inventory (16 tools: 4 checkpoint, 2 explain, 1 search, 2 session, 7 misc).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Sixteen tools now shine so bright,
From checkpoints explained to searches in flight,
With tests standing guard and schemas so tight,
The MCP server dances with TypeScript might!
—A rabbit engineer, hopping with delight

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding 5 missing tools to reach 16 total, which is the primary objective of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing Entire CLI MCP wrappers to bring the server to 16 tools, including search, explain, version, and status workflows, while updating registration, tests, lint config, and contributor documentation.

Changes:

  • Added new MCP tools for entire search, entire explain, entire version, and entire status.
  • Registered the new tool groups in the server entrypoint.
  • Added Vitest coverage and updated CLAUDE.md/tooling configuration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tools/search.ts Adds the entire_search MCP tool with optional filters.
src/tools/explain.ts Adds commit and checkpoint transcript explain tools.
src/tools/misc.ts Adds version and status tools to miscellaneous tooling.
src/index.ts Registers the new explain and search tool groups.
src/__tests__/tools/search.test.ts Covers search tool command construction and errors.
src/__tests__/tools/explain.test.ts Covers explain tool modes and error handling.
src/__tests__/tools/misc.test.ts Covers version and status tool behavior.
eslint.config.js Anchors TypeScript ESLint config to the repo root and updates ignores.
CLAUDE.md Updates tool counts, structure, and tool list documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/__tests__/tools/search.test.ts`:
- Around line 30-83: The tests currently use expect.arrayContaining which allows
out-of-order matches and doesn't verify the full command shape; update each test
(the ones calling registerSearchTools and server.callTool("entire_search", ...))
to assert the exact argv order passed to runEntire by constructing the full
expected command array (including "search", the query and any flags like
"--repo", "--branch", "--author", "--date" in the correct order) and replacing
expect.arrayContaining assertions with a strict equality check in the
toHaveBeenCalledWith call (e.g., pass the exact expectedArgs array as the first
arg and keep expect.any(Object) for the options) so the tests fail if argument
order or composition regresses.

In `@src/tools/explain.ts`:
- Around line 19-22: The schema currently allows empty strings for
commit/checkpoint IDs; update the Zod schemas to reject empty identifiers by
replacing z.string() for the commit field in inputSchema with
z.string().nonempty("commit must be a non-empty string") (or z.string().min(1,
...)) and do the same for the checkpoint-related field used later (the one
currently defined around lines 59-61) so both commit and checkpoint inputs are
validated as non-empty strings; leave RepoDirSchema as-is.

In `@src/tools/search.ts`:
- Around line 24-26: The inputSchema currently allows an empty string for the
"query" field; update the zod validator for query in inputSchema to reject
blank/whitespace-only values by adding trimming and a minimum length/non-empty
constraint (e.g., use z.string().trim().min(1) or
z.string().nonempty().transform/trim) so any "" or all-space input fails schema
validation before invoking a search.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a330f276-0ab8-4068-9793-7701329f9394

📥 Commits

Reviewing files that changed from the base of the PR and between a1bbff7 and a6a2831.

📒 Files selected for processing (9)
  • CLAUDE.md
  • eslint.config.js
  • src/__tests__/tools/explain.test.ts
  • src/__tests__/tools/misc.test.ts
  • src/__tests__/tools/search.test.ts
  • src/index.ts
  • src/tools/explain.ts
  • src/tools/misc.ts
  • src/tools/search.ts

Comment on lines +30 to +83
it("calls `entire search <query>` with query as first arg", async () => {
vi.mocked(runEntire).mockResolvedValueOnce({ stdout: "3 results\n", stderr: "" });
const server = makeServer();
registerSearchTools(server);
await server.callTool("entire_search", { query: "auth refactor" });
expect(runEntire).toHaveBeenCalledWith(
expect.arrayContaining(["search", "auth refactor"]),
expect.any(Object)
);
});

it("appends --repo when provided", async () => {
vi.mocked(runEntire).mockResolvedValueOnce({ stdout: "1 result\n", stderr: "" });
const server = makeServer();
registerSearchTools(server);
await server.callTool("entire_search", { query: "login", repo: "jurislm/entire" });
expect(runEntire).toHaveBeenCalledWith(
expect.arrayContaining(["--repo", "jurislm/entire"]),
expect.any(Object)
);
});

it("appends --branch when provided", async () => {
vi.mocked(runEntire).mockResolvedValueOnce({ stdout: "0 results\n", stderr: "" });
const server = makeServer();
registerSearchTools(server);
await server.callTool("entire_search", { query: "deploy", branch: "main" });
expect(runEntire).toHaveBeenCalledWith(
expect.arrayContaining(["--branch", "main"]),
expect.any(Object)
);
});

it("appends --author when provided", async () => {
vi.mocked(runEntire).mockResolvedValueOnce({ stdout: "2 results\n", stderr: "" });
const server = makeServer();
registerSearchTools(server);
await server.callTool("entire_search", { query: "fix", author: "Terry" });
expect(runEntire).toHaveBeenCalledWith(
expect.arrayContaining(["--author", "Terry"]),
expect.any(Object)
);
});

it("appends --date when provided", async () => {
vi.mocked(runEntire).mockResolvedValueOnce({ stdout: "1 result\n", stderr: "" });
const server = makeServer();
registerSearchTools(server);
await server.callTool("entire_search", { query: "refactor", date: "week" });
expect(runEntire).toHaveBeenCalledWith(
expect.arrayContaining(["--date", "week"]),
expect.any(Object)
);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Tighten CLI-arg assertions to catch order regressions.

Line 35 and similar checks use arrayContaining, so they don’t actually guarantee the command shape/order your test names claim.

💡 Suggested fix
-    expect(runEntire).toHaveBeenCalledWith(
-      expect.arrayContaining(["search", "auth refactor"]),
-      expect.any(Object)
-    );
+    expect(runEntire).toHaveBeenCalledWith(
+      ["search", "auth refactor"],
+      expect.any(Object)
+    );
-    expect(runEntire).toHaveBeenCalledWith(
-      expect.arrayContaining(["--repo", "jurislm/entire"]),
-      expect.any(Object)
-    );
+    expect(runEntire).toHaveBeenCalledWith(
+      ["search", "login", "--repo", "jurislm/entire"],
+      expect.any(Object)
+    );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/__tests__/tools/search.test.ts` around lines 30 - 83, The tests currently
use expect.arrayContaining which allows out-of-order matches and doesn't verify
the full command shape; update each test (the ones calling registerSearchTools
and server.callTool("entire_search", ...)) to assert the exact argv order passed
to runEntire by constructing the full expected command array (including
"search", the query and any flags like "--repo", "--branch", "--author",
"--date" in the correct order) and replacing expect.arrayContaining assertions
with a strict equality check in the toHaveBeenCalledWith call (e.g., pass the
exact expectedArgs array as the first arg and keep expect.any(Object) for the
options) so the tests fail if argument order or composition regresses.

Comment thread src/tools/explain.ts
Comment on lines +19 to +22
inputSchema: z.object({
commit: z.string().describe("Git commit SHA (full or short)"),
repo_dir: RepoDirSchema,
}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate non-empty identifiers for commit/checkpoint inputs.

Line 20 and Line 60 currently allow empty strings; reject these at schema level instead of invoking the CLI with invalid IDs.

💡 Suggested fix
-        commit: z.string().describe("Git commit SHA (full or short)"),
+        commit: z.string().trim().min(1, { error: "Commit SHA cannot be empty." }).describe("Git commit SHA (full or short)"),
@@
-        checkpoint_id: z.string().describe("Checkpoint ID"),
+        checkpoint_id: z.string().trim().min(1, { error: "Checkpoint ID cannot be empty." }).describe("Checkpoint ID"),

Also applies to: 59-61

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tools/explain.ts` around lines 19 - 22, The schema currently allows empty
strings for commit/checkpoint IDs; update the Zod schemas to reject empty
identifiers by replacing z.string() for the commit field in inputSchema with
z.string().nonempty("commit must be a non-empty string") (or z.string().min(1,
...)) and do the same for the checkpoint-related field used later (the one
currently defined around lines 59-61) so both commit and checkpoint inputs are
validated as non-empty strings; leave RepoDirSchema as-is.

Comment thread src/tools/search.ts
Comment on lines +24 to +26
inputSchema: z.object({
query: z.string().describe("Search query (topic, feature name, error text, file name, etc.)"),
repo: z.string().optional().describe('Repository filter, e.g. "jurislm/entire" or "owner/*"'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reject empty search queries at schema level.

Line 25 currently accepts "", which can trigger an unintended search invocation. Add trim + min-length validation to fail fast.

💡 Suggested fix
-        query: z.string().describe("Search query (topic, feature name, error text, file name, etc.)"),
+        query: z
+          .string()
+          .trim()
+          .min(1, { error: "Search query cannot be empty." })
+          .describe("Search query (topic, feature name, error text, file name, etc.)"),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
inputSchema: z.object({
query: z.string().describe("Search query (topic, feature name, error text, file name, etc.)"),
repo: z.string().optional().describe('Repository filter, e.g. "jurislm/entire" or "owner/*"'),
inputSchema: z.object({
query: z
.string()
.trim()
.min(1, { message: "Search query cannot be empty." })
.describe("Search query (topic, feature name, error text, file name, etc.)"),
repo: z.string().optional().describe('Repository filter, e.g. "jurislm/entire" or "owner/*"'),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tools/search.ts` around lines 24 - 26, The inputSchema currently allows
an empty string for the "query" field; update the zod validator for query in
inputSchema to reject blank/whitespace-only values by adding trimming and a
minimum length/non-empty constraint (e.g., use z.string().trim().min(1) or
z.string().nonempty().transform/trim) so any "" or all-space input fails schema
validation before invoking a search.

Bug fix: entire_search now always passes --json to avoid opening interactive
TUI in non-interactive MCP subprocess (per entire-search agent spec).
Also adds --limit and --page pagination params.

New tools:
- entire_session_current: active session JSON for current worktree
  (used by session-to-skill workflow)
- entire_dispatch: generate recent agent work summary (cloud/local modes)
- entire_activity: display activity overview and repo breakdown

37/37 tests pass, typecheck + lint + build clean.
@terry90918
terry90918 merged commit f4d7096 into main May 14, 2026
3 of 4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants