research-cli
Version:
AI-powered research assistant with web search capabilities and beautiful terminal UI
69 lines • 2.39 kB
JavaScript
/**
* research-cli - Modern Clipanion CLI implementation
*
* This implements a TypeScript CLI that follows Clipanion's design patterns:
* - Type-safe argument parsing
* - Subcommand architecture
* - Auto-generated help
* - Backward compatibility
*/
import { Builtins, Cli } from "clipanion";
import { AuthCommand, AuthKeyringStatusCommand, AuthListCommand, AuthLoginCommand, AuthLogoutCommand, AuthMigrateCommand, AuthRemoveCommand, AuthSetupCommand, AuthStatusCommand, AuthTestCommand, } from "./commands/auth.js";
import { ConfigCommand, ConfigGetCommand, ConfigInitCommand, ConfigResetCommand, ConfigSetCommand, ConfigShowCommand, } from "./commands/config.js";
import { EasymodeCommand } from "./commands/easymode-clipanion.js";
import { ResearchCommand } from "./commands/research.js";
/**
* Create and configure the Clipanion CLI
*/
function createCli() {
const cli = new Cli({
binaryLabel: "🔍 AI-powered research assistant with web search capabilities",
binaryName: "research-cli",
binaryVersion: "0.1.2",
});
// Register built-in commands
cli.register(Builtins.HelpCommand);
cli.register(Builtins.VersionCommand);
// Register our application commands
cli.register(ResearchCommand);
cli.register(EasymodeCommand);
// Register all auth commands
cli.register(AuthCommand);
cli.register(AuthStatusCommand);
cli.register(AuthSetupCommand);
cli.register(AuthRemoveCommand);
cli.register(AuthLoginCommand);
cli.register(AuthLogoutCommand);
cli.register(AuthListCommand);
cli.register(AuthTestCommand);
cli.register(AuthMigrateCommand);
cli.register(AuthKeyringStatusCommand);
// Register all config commands
cli.register(ConfigCommand);
cli.register(ConfigInitCommand);
cli.register(ConfigShowCommand);
cli.register(ConfigResetCommand);
cli.register(ConfigSetCommand);
cli.register(ConfigGetCommand);
return cli;
}
/**
* Application factory function (Clipanion-style)
*/
export function createApp() {
return createCli();
}
/**
* Main entry point
*/
async function main() {
const cli = createCli();
await cli.runExit(process.argv.slice(2));
}
// Always run main when this file is executed
main().catch((error) => {
console.error("Fatal error:", error);
process.exit(1);
});
//# sourceMappingURL=cli.js.map