Files
oh-my-pi/packages/coding-agent/src/commands/shell.ts
T
can1357 3cdc10a73b feat(cli): replaced oclif with lightweight custom CLI framework in pi-utils
- Created lightweight CLI framework in @oh-my-pi/pi-utils/cli as drop-in replacement for oclif with zero dependencies.
- Migrated coding-agent CLI from oclif framework to @oh-my-pi/pi-utils/cli with lazy command loading and simplified architecture.
- Changed default root command from 'index' to 'launch' for improved UX.
- Removed @oclif/core and @oclif/plugin-autocomplete dependencies from coding-agent package.
- Deleted custom oclif help renderer (oclif-help.ts) as help rendering is now integrated into the new CLI framework.
- Moved launch command from nested index/index.ts to top-level launch.ts for clearer command structure.
2026-02-10 19:18:12 +01:00

30 lines
869 B
TypeScript

/**
* Interactive shell console.
*/
import { Command, Flags } from "@oh-my-pi/pi-utils/cli";
import { runShellCommand, type ShellCommandArgs } from "../cli/shell-cli";
import { initTheme } from "../modes/theme/theme";
export default class Shell extends Command {
static description = "Interactive shell console";
static flags = {
cwd: Flags.string({ char: "C", description: "Set working directory for commands" }),
timeout: Flags.integer({ char: "t", description: "Timeout per command in milliseconds" }),
"no-snapshot": Flags.boolean({ description: "Skip sourcing snapshot from user shell" }),
};
async run(): Promise<void> {
const { flags } = await this.parse(Shell);
const cmd: ShellCommandArgs = {
cwd: flags.cwd,
timeoutMs: flags.timeout,
noSnapshot: flags["no-snapshot"],
};
await initTheme();
await runShellCommand(cmd);
}
}