/** * Analyze Command * * Indexes a repository and stores the knowledge graph in .codragraph/ * * Delegates core analysis to the shared runFullAnalysis orchestrator. * This CLI wrapper handles: heap management, progress bar, SIGINT, * skill generation (--skills), summary output, and process.exit(). */ import { type AnalyzeProfileOption, type CompressionOption, type EmbeddingMode } from '../core/adaptive-profile.js'; export interface AnalyzeOptions { force?: boolean; embeddings?: boolean; /** Adaptive runtime profile. `auto` detects CPU/RAM/heap and chooses lean/balanced/power. */ profile?: AnalyzeProfileOption; /** Embedding policy. `--embeddings` is kept as a shortcut for `on`. */ embeddingMode?: EmbeddingMode; skills?: boolean; verbose?: boolean; /** Skip AGENTS.md and CLAUDE.md codragraph block updates. */ skipAgentsMd?: boolean; /** Omit volatile symbol/relationship counts from AGENTS.md and CLAUDE.md. */ noStats?: boolean; /** Index the folder even when no .git directory is present. */ skipGit?: boolean; /** * Override the default basename-derived registry `name` with a * user-supplied alias (#829). Disambiguates repos whose paths share a * basename. Persisted — subsequent re-analyses of the same path without * `--name` preserve the alias. */ name?: string; /** * Allow registration even when another path already uses the same * `--name` alias (#829). Intentionally a distinct flag from `--force` * because the user may want to coexist under the same name WITHOUT * paying the cost of a pipeline re-index. Maps to registerRepo's * `allowDuplicateName` option end-to-end. */ allowDuplicateName?: boolean; /** * Override the walker's large-file skip threshold (#991). Value in KB; * clamped downstream to the tree-sitter 32 MB ceiling. Sets * `CODRAGRAPH_MAX_FILE_SIZE` for the rest of the pipeline. */ maxFileSize?: string; /** * First-run auto-setup gate. Default `true` (commander injects this from the * `--no-setup` flag — see CLI registration). When `true`, `analyze` detects a * missing `~/.codragraph/registry.json` and runs editor setup before indexing, * making `npx @codragraph/cli analyze` a true zero-install entry. Pass * `--no-setup` to opt out (CI, headless servers, automated pipelines). */ setup?: boolean; /** * Comma-separated list of editor targets for `--skills` output. Valid values * are `claude`, `cursor`, `opencode`, `codex`. Default: `claude` (matches * pre-flag behavior). Unknown values are reported and ignored. */ skillTargets?: string; /** * RFC 0001 Phase 2 - per-row content compression. Accepts `'auto'` * (default), `'none'`, `'brotli'` (Node >= 18), or `'zstd'` * (Node >= 22.15). Compressed indexes are still queryable via the standard * read path; decode happens at every external-consumer boundary * (MCP, HTTP API, embeddings, CLI tools). */ compress?: CompressionOption; } export declare const analyzeCommand: (inputPath?: string, options?: AnalyzeOptions) => Promise;