Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ gitnexus mcp # Start MCP server (stdio) — serves all index
gitnexus serve # Start local HTTP server (multi-repo) for web UI connection
gitnexus list # List all indexed repositories
gitnexus status # Show index status for current repo
gitnexus governance [path] # Detect advisory governance surfaces and sensitive operations
gitnexus governance --json # Emit governance report as JSON for agent/tool consumption
gitnexus clean # Delete index for current repo
gitnexus clean --all --force # Delete all indexes
gitnexus wiki [path] # Generate repository wiki from knowledge graph
Expand Down
2 changes: 2 additions & 0 deletions gitnexus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ gitnexus serve # Start local HTTP server (multi-repo) for web
gitnexus index # Register an existing .gitnexus/ folder into the global registry
gitnexus list # List all indexed repositories
gitnexus status # Show index status for current repo
gitnexus governance [path] # Detect advisory governance surfaces and sensitive operations
gitnexus governance --json # Emit governance report as JSON for agent/tool consumption
gitnexus clean # Delete index for current repo
gitnexus clean --all --force # Delete all indexes
gitnexus wiki [path] # Generate LLM-powered docs from knowledge graph
Expand Down
25 changes: 25 additions & 0 deletions gitnexus/src/cli/governance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import path from 'node:path';
import { detectGovernance } from '../core/governance/detector.js';

export interface GovernanceOptions {
json?: boolean;
maxFiles?: string;
}

export async function governanceCommand(
targetPath = '.',
options: GovernanceOptions = {},
): Promise<void> {
const root = path.resolve(targetPath);
const maxFiles = options.maxFiles ? Number.parseInt(options.maxFiles, 10) : undefined;
const report = detectGovernance(root, {
maxFiles: Number.isFinite(maxFiles) ? maxFiles : undefined,
});

if (options.json) {
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
return;
}

process.stdout.write(report.contextMarkdown);
}
7 changes: 7 additions & 0 deletions gitnexus/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ program
.description('Show runtime platform capabilities and embedding configuration')
.action(createLazyAction(() => import('./doctor.js'), 'doctorCommand'));

program
.command('governance [path]')
.description('Detect repository governance boundaries and sensitive operation paths')
.option('--json', 'Emit the governance report as JSON')
.option('--max-files <n>', 'Maximum files to scan (default: 5000)')
.action(createLazyAction(() => import('./governance.js'), 'governanceCommand'));

program
.command('clean')
.description('Delete GitNexus index for current repo')
Expand Down
Loading