Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

1.0 KB
Raw Blame
import { t } from "../i18n.mjs";

export function registerTray(program) {
  const cmd = program
    .command("tray")
    .description(t("tray.description") || "Control the system tray icon");

  cmd
    .command("show")
    .description(t("tray.show") || "Show the tray icon (if server is running with --tray)")
    .action(() => {
      process.stderr.write(
        "The tray is managed by `omniroute serve --tray`. Start the server with --tray to enable it.\n"
      );
    });

  cmd
    .command("hide")
    .description(t("tray.hide") || "Hide the tray icon")
    .action(() => {
      process.stderr.write(
        "Send SIGUSR1 to the serve process to toggle the tray, or restart without --tray.\n"
      );
    });

  cmd
    .command("quit")
    .description(t("tray.quit") || "Quit OmniRoute via tray")
    .action(async () => {
      const { default: pidUtils } = await import("../utils/pid.mjs").catch(() => ({
        default: null,
      }));
      process.stderr.write("Use `omniroute stop` to stop the server.\n");
      process.exit(0);
    });
}