* 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)
| 2197 | * command that fixes it, and never print a stack trace. |
| 2198 | */ |
| 2199 | function printNoIndexGuidance(projectPath: string): void { |
| 2200 | error(`No CodeGraph index found for ${projectPath}`); |
| 2201 | console.error(''); |
| 2202 | // getGlyphs() (not a literal em dash): a legacy Windows console decodes raw |
| 2203 | // UTF-8 with its OEM codepage and renders one as mojibake (#168). |
| 2204 | console.error(` The viewer reads an index that already exists ${getGlyphs().dash} it never creates one.`); |
| 2205 | console.error(' To index this project:'); |
| 2206 | console.error(''); |
| 2207 | console.error(` ${chalk.cyan('codegraph init')}`); |
| 2208 | console.error(''); |
| 2209 | console.error(' Already indexed somewhere else? Point the viewer at it:'); |
| 2210 | console.error(''); |
| 2211 | console.error(` ${chalk.cyan('codegraph ui /path/to/indexed/project')}`); |
| 2212 | console.error(''); |
| 2213 | } |
| 2214 | |
| 2215 | /** |
| 2216 | * codegraph ui [path] (alias: web) |