/** * 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 { const { flags } = await this.parse(Shell); const cmd: ShellCommandArgs = { cwd: flags.cwd, timeoutMs: flags.timeout, noSnapshot: flags["no-snapshot"], }; await initTheme(); await runShellCommand(cmd); } }