* Print the "no index here" guidance. * * The viewer READS an index; it never builds one — indexing stays the user's * decision, exactly as it is for the MCP tools. So a missing index is normal * input, not a failure to apologize for: say what is missing, say the one * command that fixes it, an
(projectPath: string)
| 2276 | * command that fixes it, and never print a stack trace. |
| 2277 | */ |
| 2278 | function printNoIndexGuidance(projectPath: string): void { |
| 2279 | error(`No CodeGraph index found for ${projectPath}`); |
| 2280 | console.error(''); |
| 2281 | // getGlyphs() (not a literal em dash): a legacy Windows console decodes raw |
| 2282 | // UTF-8 with its OEM codepage and renders one as mojibake (#168). |
| 2283 | console.error(` The viewer reads an index that already exists ${getGlyphs().dash} it never creates one.`); |
| 2284 | console.error(' To index this project:'); |
| 2285 | console.error(''); |
| 2286 | console.error(` ${chalk.cyan('codegraph init')}`); |
| 2287 | console.error(''); |
| 2288 | console.error(' Already indexed somewhere else? Point the viewer at it:'); |
| 2289 | console.error(''); |
| 2290 | console.error(` ${chalk.cyan('codegraph ui /path/to/indexed/project')}`); |
| 2291 | console.error(''); |
| 2292 | } |
| 2293 | |
| 2294 | /** |
| 2295 | * codegraph ui [path] (alias: web) |