mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-19 00:33:20 +00:00
feat: add multi-model cleanup tool and CLI command
- Bump `@opencode-ai/plugin` dependency from 1.2.27 to 1.3.0. - Introduce `cleanup` command in CLI with force and remote options. - Export `cleanupMultiModel` from core index. - Register `multi-model-cleanup` tool in plugin and update exports. - Add `CleanupOptions` and `CleanupResult` types to define cleanup behavior and results.
This commit is contained in:
+29
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bun
|
||||
import { Command } from "commander";
|
||||
import { cleanupMultiModel } from "./core/cleanup";
|
||||
import { closeMultiModel } from "./core/close";
|
||||
import { openMultiModel } from "./core/open";
|
||||
import { getBinaryName } from "./core/utils";
|
||||
@@ -91,4 +92,32 @@ program
|
||||
},
|
||||
);
|
||||
|
||||
program
|
||||
.command("cleanup")
|
||||
.description("Delete all archive tags from local and remote")
|
||||
.option("-f, --force", "Skip confirmation prompts", false)
|
||||
.option(
|
||||
"-r, --remote <remote>",
|
||||
"Remote name to push deletions to (default: first remote from git remote -v)",
|
||||
)
|
||||
.option("--no-remote", "Only delete local tags, skip remote")
|
||||
.action(async (options: { force: boolean; remote?: string | boolean }) => {
|
||||
try {
|
||||
const result = await cleanupMultiModel({
|
||||
force: options.force,
|
||||
remote: options.remote === true ? undefined : options.remote,
|
||||
});
|
||||
|
||||
if (result.success) {
|
||||
console.log(result.instructions);
|
||||
} else {
|
||||
console.error(`Failed: ${result.error}`);
|
||||
process.exit(1);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error: ${error}`);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
program.parse();
|
||||
|
||||
Reference in New Issue
Block a user