@stitchdb/cli 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +40 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -211,8 +211,46 @@ async function cmdWorkspace(args) {
|
|
|
211
211
|
saveConfig(cfg);
|
|
212
212
|
console.log(`Default workspace set: ${id}`);
|
|
213
213
|
}
|
|
214
|
+
else if (sub === 'rename') {
|
|
215
|
+
const positionals = positional(rest);
|
|
216
|
+
const id = positionals[0];
|
|
217
|
+
const name = positionals.slice(1).join(' ');
|
|
218
|
+
if (!id || !name) {
|
|
219
|
+
console.error('Usage: stitch workspace rename <id> <new-name>');
|
|
220
|
+
process.exit(2);
|
|
221
|
+
}
|
|
222
|
+
const w = await stitch.workspaces.update(id, { name });
|
|
223
|
+
console.log(`Renamed ${w.id} → ${w.name}`);
|
|
224
|
+
}
|
|
225
|
+
else if (sub === 'delete') {
|
|
226
|
+
const id = positional(rest)[0];
|
|
227
|
+
if (!id) {
|
|
228
|
+
console.error('Usage: stitch workspace delete <id> [--yes]');
|
|
229
|
+
process.exit(2);
|
|
230
|
+
}
|
|
231
|
+
if (!hasFlag(rest, ['--yes', '-y'])) {
|
|
232
|
+
// Show what will be lost so the user knows the blast radius.
|
|
233
|
+
try {
|
|
234
|
+
const w = await stitch.workspaces.get(id);
|
|
235
|
+
console.log(`This will permanently delete workspace "${w.name}" (${w.id})`);
|
|
236
|
+
console.log('and ALL its memories, threads, and conversation history.');
|
|
237
|
+
console.log('Re-run with --yes to confirm.');
|
|
238
|
+
}
|
|
239
|
+
catch (e) {
|
|
240
|
+
console.error(`Workspace ${id} not found: ${e?.message || e}`);
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const ok = await stitch.workspaces.delete(id);
|
|
246
|
+
console.log(ok ? `Deleted ${id}` : `Workspace ${id} not found`);
|
|
247
|
+
if (cfg.defaultWorkspace === id) {
|
|
248
|
+
delete cfg.defaultWorkspace;
|
|
249
|
+
saveConfig(cfg);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
214
252
|
else {
|
|
215
|
-
console.error('Usage: stitch workspace [list|create <name
|
|
253
|
+
console.error('Usage: stitch workspace [list | create <name> | use <id> | rename <id> <name> | delete <id> --yes]');
|
|
216
254
|
process.exit(2);
|
|
217
255
|
}
|
|
218
256
|
}
|
|
@@ -1860,7 +1898,7 @@ function help() {
|
|
|
1860
1898
|
stitch thread current Print the auto-derived thread name
|
|
1861
1899
|
for the current repo / cwd.
|
|
1862
1900
|
|
|
1863
|
-
stitch workspace [list | create <name> | use <id>]
|
|
1901
|
+
stitch workspace [list | create <name> | use <id> | rename <id> <name> | delete <id> --yes]
|
|
1864
1902
|
|
|
1865
1903
|
stitch agent register <name> Create an agent identity (id only).
|
|
1866
1904
|
stitch agent list
|