fix(coding-agent): add uninstall alias

closes #2051
This commit is contained in:
Mario Zechner
2026-03-14 05:44:39 +01:00
parent 4f81c3c28d
commit c3fc724887
3 changed files with 25 additions and 14 deletions

View File

@@ -343,6 +343,7 @@ pi install https://github.com/user/repo@v1 # tag or commit
pi install ssh://git@github.com/user/repo pi install ssh://git@github.com/user/repo
pi install ssh://git@github.com/user/repo@v1 # tag or commit pi install ssh://git@github.com/user/repo@v1 # tag or commit
pi remove npm:@foo/pi-tools pi remove npm:@foo/pi-tools
pi uninstall npm:@foo/pi-tools # alias for remove
pi list pi list
pi update # skips pinned packages pi update # skips pinned packages
pi config # enable/disable extensions, skills, prompts, themes pi config # enable/disable extensions, skills, prompts, themes
@@ -432,11 +433,12 @@ pi [options] [@files...] [messages...]
### Package Commands ### Package Commands
```bash ```bash
pi install <source> [-l] # Install package, -l for project-local pi install <source> [-l] # Install package, -l for project-local
pi remove <source> [-l] # Remove package pi remove <source> [-l] # Remove package
pi update [source] # Update packages (skips pinned) pi uninstall <source> [-l] # Alias for remove
pi list # List installed packages pi update [source] # Update packages (skips pinned)
pi config # Enable/disable package resources pi list # List installed packages
pi config # Enable/disable package resources
``` ```
### Modes ### Modes

View File

@@ -183,12 +183,13 @@ ${chalk.bold("Usage:")}
${APP_NAME} [options] [@files...] [messages...] ${APP_NAME} [options] [@files...] [messages...]
${chalk.bold("Commands:")} ${chalk.bold("Commands:")}
${APP_NAME} install <source> [-l] Install extension source and add to settings ${APP_NAME} install <source> [-l] Install extension source and add to settings
${APP_NAME} remove <source> [-l] Remove extension source from settings ${APP_NAME} remove <source> [-l] Remove extension source from settings
${APP_NAME} update [source] Update installed extensions (skips pinned sources) ${APP_NAME} uninstall <source> [-l] Alias for remove
${APP_NAME} list List installed extensions from settings ${APP_NAME} update [source] Update installed extensions (skips pinned sources)
${APP_NAME} config Open TUI to enable/disable package resources ${APP_NAME} list List installed extensions from settings
${APP_NAME} <command> --help Show help for install/remove/update/list ${APP_NAME} config Open TUI to enable/disable package resources
${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list
${chalk.bold("Options:")} ${chalk.bold("Options:")}
--provider <name> Provider name (default: google) --provider <name> Provider name (default: google)

View File

@@ -118,12 +118,14 @@ Examples:
${getPackageCommandUsage("remove")} ${getPackageCommandUsage("remove")}
Remove a package and its source from settings. Remove a package and its source from settings.
Alias: ${APP_NAME} uninstall <source> [-l]
Options: Options:
-l, --local Remove from project settings (.pi/settings.json) -l, --local Remove from project settings (.pi/settings.json)
Example: Examples:
${APP_NAME} remove npm:@foo/bar ${APP_NAME} remove npm:@foo/bar
${APP_NAME} uninstall npm:@foo/bar
`); `);
return; return;
@@ -147,8 +149,14 @@ List installed packages from user and project settings.
} }
function parsePackageCommand(args: string[]): PackageCommandOptions | undefined { function parsePackageCommand(args: string[]): PackageCommandOptions | undefined {
const [command, ...rest] = args; const [rawCommand, ...rest] = args;
if (command !== "install" && command !== "remove" && command !== "update" && command !== "list") { let command: PackageCommand | undefined;
if (rawCommand === "uninstall") {
command = "remove";
} else if (rawCommand === "install" || rawCommand === "remove" || rawCommand === "update" || rawCommand === "list") {
command = rawCommand;
}
if (!command) {
return undefined; return undefined;
} }