/** * Analyze Command * * Indexes a repository and stores the knowledge graph in .gitnexus/ * * 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(). */ /** * RAM-aware re-exec heap cap (MB): `0.75 × effective RAM`, clamped to * `>= DEFAULT_HEAP_MB`. Kept BELOW physical RAM on purpose — a cap `>=` RAM makes * V8 collect lazily and inflate the heap into swap-thrash (observed analyzing the * Linux kernel at a 30GB cap on a 31GB box). `constrainedBytes` is the cgroup * limit or `null`; it is honored only as a real, smaller-than-physical cap, because * `process.constrainedMemory()` returns a huge sentinel when UNCONSTRAINED. */ export declare function computeHeapCapMb(totalBytes: number, constrainedBytes: number | null): number; export interface AnalyzeOptions { force?: boolean; repairFts?: boolean; /** * Embedding generation toggle. Commander parses `--embeddings [limit]` as: * - `undefined` when the flag is omitted * - `true` when passed without an argument (use default 50K node cap) * - a string when passed with an argument (`--embeddings 0` disables the * cap, `--embeddings ` uses `` as the cap) */ embeddings?: boolean | string; /** * Explicitly drop existing embeddings on rebuild instead of preserving * them. Without this flag, a routine `analyze` keeps any embeddings * already present in the index even when `--embeddings` is omitted. */ dropEmbeddings?: boolean; skills?: boolean; verbose?: boolean; /** Skip AGENTS.md and CLAUDE.md gitnexus block updates. */ skipAgentsMd?: boolean; /** * Stats inclusion in AGENTS.md and CLAUDE.md. * * Commander.js represents `--no-stats` as `stats: boolean` (default * `true`; `false` when the user passes `--no-stats`), NOT as * `noStats: boolean`. Reading the negated form would always be * `undefined` and the flag would silently no-op (#1477). Consumers * that want "did the user request --no-stats?" should compare with * `=== false` to distinguish the explicit-off case from the * default-on case. */ stats?: boolean; /** Skip installing standard GitNexus skill files to .claude/skills/gitnexus/. */ skipSkills?: boolean; /** * Default branch for the generated regression-compare example (#243). From * `--default-branch`; may also be supplied via `.gitnexusrc`. Resolved to a * concrete branch (CLI > `.gitnexusrc` > auto-detected origin/HEAD > "main") * before being threaded into the generated AGENTS.md / CLAUDE.md content. */ defaultBranch?: string; /** Pure index mode: skip all file injection (AGENTS.md, CLAUDE.md, skills). */ indexOnly?: 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 * `GITNEXUS_MAX_FILE_SIZE` for the rest of the pipeline. */ maxFileSize?: string; /** Override worker sub-batch idle timeout in seconds. */ workerTimeout?: string; /** Control LadybugDB WAL auto-checkpoint threshold during analyze. */ walCheckpointThreshold?: string; /** Parse worker pool size (>=1); 0 is rejected (no sequential mode). */ workers?: string; embeddingThreads?: string; embeddingBatchSize?: string; embeddingSubBatchSize?: string; embeddingDevice?: string; } /** * Whether the post-index skill step should run. * * The gated block does two things in sequence: (1) generates the community * skill files from `--skills`, and (2) re-runs `generateAIContextFiles` so * AGENTS.md/CLAUDE.md can reference the freshly written skills. Both are * suppressed together — `--index-only` drops the entire step, not just the * community-skill write. Name retained for the test contract; see call site * in `analyzeCommand` for the AGENTS.md/CLAUDE.md re-generation it also gates. * * Kept as a pure helper so the `--index-only --skills` contract is unit-tested * without booting the full analyze pipeline (#742 review). */ export declare const shouldGenerateCommunitySkillFiles: (options: Pick | undefined, pipelineResult: unknown) => boolean; export declare const analyzeCommand: (inputPath?: string, options?: AnalyzeOptions) => Promise;