- 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.
30 lines
872 B
TypeScript
30 lines
872 B
TypeScript
/**
|
|
* View usage statistics dashboard.
|
|
*/
|
|
import { Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
import { runStatsCommand, type StatsCommandArgs } from "../cli/stats-cli";
|
|
import { initTheme } from "../modes/theme/theme";
|
|
|
|
export default class Stats extends Command {
|
|
static description = "View usage statistics";
|
|
|
|
static flags = {
|
|
port: Flags.integer({ char: "p", description: "Port for the dashboard server", default: 3847 }),
|
|
json: Flags.boolean({ char: "j", description: "Output stats as JSON", default: false }),
|
|
summary: Flags.boolean({ char: "s", description: "Print summary to console", default: false }),
|
|
};
|
|
|
|
async run(): Promise<void> {
|
|
const { flags } = await this.parse(Stats);
|
|
|
|
const cmd: StatsCommandArgs = {
|
|
port: flags.port,
|
|
json: flags.json,
|
|
summary: flags.summary,
|
|
};
|
|
|
|
await initTheme();
|
|
await runStatsCommand(cmd);
|
|
}
|
|
}
|