@hpbyte/h-codex-core
Version:
Core indexing and search functionality for h-codex
39 lines (38 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ingestion_1 = require("./ingestion");
const search_1 = require("./search");
const helpMesg = `
Usage: h-codexx <command> <path>
Commands:
index <path> Index a directory of code
search <query> Search for a query
`;
async function main() {
const args = process.argv.slice(2);
if (args.length === 0) {
console.log('No arguments provided');
return;
}
const [command, arg] = args;
if (!command || !arg) {
console.log(helpMesg);
return;
}
if (!['index', 'search', 'clear'].includes(command)) {
console.log('Invalid command');
return;
}
if (command === 'index') {
return ingestion_1.indexer.index(arg);
}
if (command === 'search') {
return search_1.semanticSearch.search(arg);
}
if (command === 'clear') {
return ingestion_1.indexer.clear(arg);
}
}
main();
//# sourceMappingURL=script.js.map