MCPcopy Create free account
hub / github.com/Eversmile12/sharedcontext / deleteCommand

Function deleteCommand

src/cli/delete.ts:4–19  ·  view source on GitHub ↗
(options: { key: string })

Source from the content-addressed store, hash-verified

2import { ensureInitialized } from "./util.js";
3
4export function deleteCommand(options: { key: string }): void {
5 const dbPath = ensureInitialized();
6 const db = openDatabase(dbPath);
7 const existing = getFact(db, options.key);
8
9 if (!existing) {
10 console.log(`No fact found with key: ${options.key}`);
11 db.close();
12 return;
13 }
14
15 deleteFact(db, options.key);
16 db.close();
17
18 console.log(`Deleted: ${options.key}`);
19}

Callers 1

index.tsFile · 0.85

Calls 4

ensureInitializedFunction · 0.85
openDatabaseFunction · 0.85
getFactFunction · 0.85
deleteFactFunction · 0.85

Tested by

no test coverage detected