Files
waggle-os/packages/cli/src/index.ts
shumeiko.it 697517d378 refactor(cli): run local mode only (P1.1)
Team mode is not part of the community edition (ADR-0003), so the CLI
no longer detects or switches to it.

- Remove the mode detector, the --local and --team flags, the Clerk
  browser login (/login, /logout, /whoami) and /mode.
- Remove the /admin command and its team-server REST client.
- The welcome banner drops the Mode line.
- The installed-REPL test starts plain `waggle` and checks that the team
  commands are gone.
2026-10-24 17:35:48 +02:00

54 lines
1.3 KiB
TypeScript

/**
* Waggle CLI entry point.
*
* Usage:
* waggle Start interactive REPL
* waggle --model <name> Start with a specific model
* waggle --help Show help
*/
function printHelp(): void {
console.log(`
Waggle CLI — interactive AI agent with persistent memory
Usage:
waggle Start interactive REPL
waggle --model <name> Start with a specific model
waggle --help Show this help message
Configuration:
Edit ~/.waggle/config.json to set up providers and API keys.
Commands (inside REPL):
/model <name> Switch model
/models List available models
/identity Show agent identity
/clear Clear conversation
/help Show commands
/exit Quit
`);
}
const args = process.argv.slice(2);
if (args.includes('--help') || args.includes('-h')) {
printHelp();
process.exit(0);
}
let model: string | undefined;
const modelIdx = args.indexOf('--model');
if (modelIdx !== -1 && args[modelIdx + 1]) {
model = args[modelIdx + 1];
}
async function main(): Promise<void> {
const { startRepl } = await import('./repl.js');
await startRepl({ model });
}
main().catch((err) => {
console.error('Fatal error:', (err as Error).message);
process.exit(1);
});