Files
oh-my-pi/packages/coding-agent/src/commands/setup.ts
T
can1357 d1f41ae553 merge: PR #51 — speech-to-text with Alt+H (closes #51)
- Moved /stt slash command to 'omp setup stt' CLI command
- Fixed pip install blocking TUI (sync -> async)
- Fixed 'Transcribing...' status not clearing after success
2026-02-15 10:30:47 +01:00

43 lines
1.1 KiB
TypeScript

/**
* Install dependencies for optional features.
*/
import { Args, Command, Flags, renderCommandHelp } from "@oh-my-pi/pi-utils/cli";
import { runSetupCommand, type SetupCommandArgs, type SetupComponent } from "../cli/setup-cli";
import { initTheme } from "../modes/theme/theme";
const COMPONENTS: SetupComponent[] = ["python", "stt"];
export default class Setup extends Command {
static description = "Install dependencies for optional features";
static args = {
component: Args.string({
description: "Component to install",
required: false,
options: COMPONENTS,
}),
};
static flags = {
check: Flags.boolean({ char: "c", description: "Check if dependencies are installed" }),
json: Flags.boolean({ description: "Output status as JSON" }),
};
async run(): Promise<void> {
const { args, flags } = await this.parse(Setup);
if (!args.component) {
renderCommandHelp("omp", "setup", Setup);
return;
}
const cmd: SetupCommandArgs = {
component: args.component as SetupComponent,
flags: {
json: flags.json,
check: flags.check,
},
};
await initTheme();
await runSetupCommand(cmd);
}
}