Files
oh-my-pi/packages/coding-agent/src/commands/update.ts
T
roboomp 7cb413988f fix(cli): routed update plugin shorthand
Added the documented update -l path for marketplace plugin upgrades and covered the dispatch contract with update command tests.

Fixes #4304
2026-07-02 11:48:42 +00:00

28 lines
963 B
TypeScript

/**
* Check for and install updates.
*/
import { Command, Flags } from "@oh-my-pi/pi-utils/cli";
import * as pluginCli from "../cli/plugin-cli";
import * as updateCli from "../cli/update-cli";
import { initTheme } from "../modes/theme/theme";
export default class Update extends Command {
static description = "Check for and install updates";
static flags = {
force: Flags.boolean({ char: "f", description: "Force update", default: false }),
check: Flags.boolean({ char: "c", description: "Check for updates without installing", default: false }),
plugins: Flags.boolean({ char: "l", description: "Update installed plugins", default: false }),
};
async run(): Promise<void> {
const { flags } = await this.parse(Update);
await initTheme();
if (flags.plugins) {
await pluginCli.runPluginCommand({ action: "upgrade", args: [], flags: {} });
} else {
await updateCli.runUpdateCommand({ force: flags.force, check: flags.check });
}
}
}