Initial commit: Cortex — AI project memory & knowledge graph
SQLite-backed knowledge graph with CLI interface. Supports nodes (memory, component, task, decision) connected by typed edges, with hybrid search (BM25 + Ollama embeddings).
This commit is contained in:
37
src/cli/index.ts
Normal file
37
src/cli/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env node
|
||||
import { Command } from 'commander';
|
||||
import { addCommand } from './commands/add';
|
||||
import { queryCommand } from './commands/query';
|
||||
import { linkCommand } from './commands/link';
|
||||
import { showCommand } from './commands/show';
|
||||
import { listCommand } from './commands/list';
|
||||
import { updateCommand } from './commands/update';
|
||||
import { removeCommand } from './commands/remove';
|
||||
import { graphCommand } from './commands/graph';
|
||||
import { closeDb } from '../core/db';
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.name('memory')
|
||||
.description('Cortex — AI project memory & knowledge graph')
|
||||
.version('1.0.0');
|
||||
|
||||
program.addCommand(addCommand);
|
||||
program.addCommand(queryCommand);
|
||||
program.addCommand(linkCommand);
|
||||
program.addCommand(showCommand);
|
||||
program.addCommand(listCommand);
|
||||
program.addCommand(updateCommand);
|
||||
program.addCommand(removeCommand);
|
||||
program.addCommand(graphCommand);
|
||||
|
||||
program.hook('postAction', () => {
|
||||
closeDb();
|
||||
});
|
||||
|
||||
program.parseAsync(process.argv).catch((err) => {
|
||||
console.error(err);
|
||||
closeDb();
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user