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

Function listContextCommand

src/cli/list.ts:74–93  ·  view source on GitHub ↗
(options: ListContextOptions)

Source from the content-addressed store, hash-verified

72}
73
74export function listContextCommand(options: ListContextOptions): void {
75 const dbPath = ensureInitialized();
76 const db = openDatabase(dbPath);
77 const facts = options.scope ? getFactsByScope(db, options.scope) : getAllFacts(db);
78 db.close();
79
80 if (facts.length === 0) {
81 console.log("No context facts found.");
82 return;
83 }
84
85 console.log("Context facts:\n");
86 for (const fact of facts) {
87 console.log(`- ${fact.key}`);
88 console.log(` Scope: ${fact.scope}`);
89 console.log(` Updated: ${fact.last_confirmed}`);
90 console.log(` Tags: ${fact.tags.join(", ")}`);
91 console.log();
92 }
93}
94
95export async function discoverConversations(options?: {
96 localOnly?: boolean;

Callers 1

index.tsFile · 0.85

Calls 4

ensureInitializedFunction · 0.85
openDatabaseFunction · 0.85
getFactsByScopeFunction · 0.85
getAllFactsFunction · 0.85

Tested by

no test coverage detected