loccon
Version:
A simple local context storage and management tool with CLI and web interfaces. Store, search, and organize code snippets, notes, and development contexts with sharded JSON storage.
29 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWebCommand = createWebCommand;
const commander_1 = require("commander");
const server_1 = require("../../web/server");
function createWebCommand() {
const command = new commander_1.Command('web');
command
.description('Start the web interface')
.option('-s, --storage-path <path>', 'Custom storage path')
.option('-p, --port <port>', 'Port number (default: 5069)', '5069')
.option('--no-open', 'Do not automatically open browser')
.action(async (options) => {
try {
const port = parseInt(options.port);
if (isNaN(port) || port < 1 || port > 65535) {
console.error('Invalid port number');
process.exit(1);
}
await (0, server_1.startWebServer)(port, options.storagePath, options.open);
}
catch (error) {
console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
process.exit(1);
}
});
return command;
}
//# sourceMappingURL=web.js.map