Files
OmniRoute/bin/cli/commands/repl.mjs
diegosouzapw d28d756e80 feat(cli): fase 8.11 — REPL interativo multi-turn com Ink (runRepl, session, slash commands)
Adiciona REPL Ink com painel lateral de tokens/custo, 16 slash commands (/model, /combo,
/system, /clear, /save, /load, /list, /export, /history, /tokens, /help, /exit etc.),
persistência de sessão em ~/.omniroute/repl-sessions/, autosave ao sair, e comando
`omniroute repl` com flags --model, --combo, --system, --resume.
2026-05-15 04:51:23 -03:00

20 lines
761 B
JavaScript

import { t } from "../i18n.mjs";
export function registerRepl(program) {
program
.command("repl")
.description(t("repl.description"))
.option("-m, --model <id>", t("repl.model"))
.option("--combo <name>", t("repl.combo"))
.option("-s, --system <prompt>", t("repl.system"))
.option("--resume <session>", t("repl.resume"))
.action(async (opts, cmd) => {
const globalOpts = cmd.optsWithGlobals();
const port = globalOpts.port ? parseInt(String(globalOpts.port), 10) : 20128;
const baseUrl = globalOpts.baseUrl ?? `http://localhost:${port}`;
const apiKey = globalOpts.apiKey ?? null;
const { runRepl } = await import("../tui/Repl.jsx");
await runRepl({ ...opts, baseUrl, apiKey, port });
});
}