feat(tools): enhance CLI tool descriptions and add remote handling option

- Updated `cleanupTool` description to include detailed usage and arguments.
- Added optional `noRemote` flag to `cleanupTool` for local‑only tag deletion.
- Adjusted remote handling logic to respect the new `noRemote` flag.
- Expanded `closeTool` description with clear argument documentation.
- Expanded `openTool` description with detailed argument documentation.
This commit is contained in:
2026-03-23 10:24:49 +05:30
parent c6d6c889d8
commit 46d81b4162
3 changed files with 23 additions and 11 deletions
+12 -8
View File
@@ -8,8 +8,11 @@ import { cleanupMultiModel } from "../core/cleanup";
* Used to clean up recovery tags created by the close command.
*/
export const cleanupTool = tool({
description:
"Delete all archive tags from local and optionally remote repository",
description: `Delete all archive tags from the local repository and, optionally, from a remote.
Arguments:
-\`remote\` (string, optional): Specify a remote name to which deletions should be pushed. If omitted, the first available remote is used.
- \`noRemote\` (boolean, optional): When true, only delete local tags and do not push deletions to any remote.`,
args: {
remote: tool.schema
.union([
@@ -17,21 +20,22 @@ export const cleanupTool = tool({
.string()
.describe(
"Remote name to push deletions to. Error if doesn't exist.",
),
tool.schema
.literal(false)
.describe("Only delete local tags, don't push to remote."),
)
])
.optional()
.describe(
"Remote handling: string=specific remote, false=local-only, undefined=first available remote",
"Remote handling: string=specific remote, undefined=first available remote",
),
noRemote: tool.schema
.literal(true)
.describe("Only delete local tags, don't push to remote.")
.optional(),
},
async execute(args, _context) {
// In plugin mode, we skip confirmation (force=true)
const result = await cleanupMultiModel({
force: true,
remote: args.remote,
remote: args.noRemote ? false : args.remote,
});
if (!result.success) {