Add Cortex Portal — web visualization for knowledge graph
Express API server wrapping existing store/graph core with REST endpoints for nodes, edges, graph, and search. React + Vite portal with React Flow for interactive graph visualization, Tailwind CSS styling, and full CRUD UI (sidebar, node panel, add/link modals, search bar, toast notifications).
This commit is contained in:
9
src/cli/commands/serve.ts
Normal file
9
src/cli/commands/serve.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Command } from 'commander';
|
||||
|
||||
export const serveCommand = new Command('serve')
|
||||
.description('Start the Cortex Portal web server')
|
||||
.option('-p, --port <number>', 'Port number', '3100')
|
||||
.action((opts) => {
|
||||
process.env.PORT = opts.port;
|
||||
require('../../server/index');
|
||||
});
|
||||
@@ -8,6 +8,7 @@ import { listCommand } from './commands/list';
|
||||
import { updateCommand } from './commands/update';
|
||||
import { removeCommand } from './commands/remove';
|
||||
import { graphCommand } from './commands/graph';
|
||||
import { serveCommand } from './commands/serve';
|
||||
import { closeDb } from '../core/db';
|
||||
|
||||
const program = new Command();
|
||||
@@ -25,6 +26,7 @@ program.addCommand(listCommand);
|
||||
program.addCommand(updateCommand);
|
||||
program.addCommand(removeCommand);
|
||||
program.addCommand(graphCommand);
|
||||
program.addCommand(serveCommand);
|
||||
|
||||
program.hook('postAction', () => {
|
||||
closeDb();
|
||||
|
||||
Reference in New Issue
Block a user