You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add 'codescan root' CLI subcommand and MCP tool
Reports the resolved project root from CWD (CLI) or from the MCP
server's project_root (MCP). Bare absolute path on stdout for
scripting; --json or MCP-tool form returns a richer object with
project_root, codescan_dir, db_path, watcher_pid, watcher_status,
walk_up_steps.
Use case: dispatch / worktree co-location scripts that need to ask
"which .codescan/ does codescan resolve to?" instead of duplicating
the walk-up logic in bash. Also handy for human debugging when an
edit lands in an unexpected project.
Factors a new pub fn findRepoRootInfo() helper alongside the existing
findRepoRoot() so both CLI and MCP share the same walk-up
implementation.
Also broadens .gitignore zig-cache/ and zig-out/ patterns to match
anywhere in the tree (was root-only) so a stray src/zig-cache/ from
a sub-directory build doesn't pollute git status.
Closes inbox/2026-05-04-feature-request-codescan-root.md.
tryout.writer.print("{{\"root\":null,\"error\":\"no .codescan/ directory found walking up from {s}\"}}", .{settings.root_path});
698
+
}
659
699
} else {
660
700
returnerror.UnknownTool;
661
701
}
@@ -855,7 +895,8 @@ const tools_list_json =
855
895
\\{"name":"rename","description":"Rename a symbol across the workspace (via LSP)","inputSchema":{"type":"object","properties":{"file":{"type":"string","description":"File path"},"pattern":{"type":"string","description":"Symbol name path"},"to":{"type":"string","description":"New name"},"dry_run":{"type":"boolean","description":"Preview changes without applying"}},"required":["file","pattern","to"]}},
856
896
\\{"name":"config","description":"Show current codescan configuration","inputSchema":{"type":"object","properties":{}}},
857
897
\\{"name":"status","description":"Show index and watcher status","inputSchema":{"type":"object","properties":{}}},
858
-
\\{"name":"logs","description":"Read recent watcher logs from the OS log (macOS unified log / Linux journald), filtered to codescan and optionally to a project root.","inputSchema":{"type":"object","properties":{"root":{"type":"string","description":"Absolute project root path; filters messages to this project"},"since":{"type":"string","description":"Time window (e.g. '1h', '15m'). Default 1h."},"limit":{"type":"integer","description":"Max lines to return (last N after filter)"},"all":{"type":"boolean","description":"If true, show logs from all codescan projects"}}}}
898
+
\\{"name":"logs","description":"Read recent watcher logs from the OS log (macOS unified log / Linux journald), filtered to codescan and optionally to a project root.","inputSchema":{"type":"object","properties":{"root":{"type":"string","description":"Absolute project root path; filters messages to this project"},"since":{"type":"string","description":"Time window (e.g. '1h', '15m'). Default 1h."},"limit":{"type":"integer","description":"Max lines to return (last N after filter)"},"all":{"type":"boolean","description":"If true, show logs from all codescan projects"}}}},
899
+
\\{"name":"root","description":"Report which .codescan/ directory codescan resolves to from the server's project root. Returns absolute path of project root, the .codescan dir, db_path, watcher pid/status, and how many directory levels were walked up.","inputSchema":{"type":"object","properties":{}}}
0 commit comments