@mirage-cli/radar-cli
v0.2.3
Published
ViewEngine Radar CLI — org-scoped AI visibility (projects, queries, game-plans, results, jobs, credits). Mirage-compatible command shape.
Maintainers
Readme
@mirage-cli/radar-cli
ViewEngine Radar CLI — org-scoped access to the ViewEngine AI Visibility API at
radar.viewengine.ai. Read projects, queries, query-results, execution-jobs,
and credits; manage game plans; switch between organizations.
bun add -g @mirage-cli/radar-cli
radar login # Clerk OAuth (browser)
radar login --api-key sk_... # headless / CI
radar orgs list # orgs you belong to
radar orgs use <id-or-slug> # set the active org (persisted)
radar projects list --search acme
radar queries list --project-id <id>
radar game-plans list --status open
radar game-plans complete-action <planId> <actionIndex>
radar results list --provider perplexity --query-id <id>
radar jobs list --status running
radar credits list
radar export game-plans > game-plans.jsonCommands
projects {list, get}queries {list}game-plans {list, get, update, complete-action}results {list, get}(query-results)jobs {list}(execution-jobs)credits {list}export <entity>— page through every row of an entityorgs {list, use, current, clear}— multi-tenant switchinglogin / whoami / logout
All list commands accept --page, --limit, --sort <field>, --dir <asc|desc>.
Output is JSON (ideal for piping / bot consumption).
Auth & org scoping
radar login— Clerk OAuth (PKCE + RFC 7591 DCR + loopback). Persists to~/.config/radar/session.json(0600).radar login --api-key sk_...— Clerk machine API key for headless use.- Env override:
RADAR_API_KEY(preferred) orRADAR_OAUTH_ACCESS_TOKEN.RADAR_API_BASE_URLoverrides the base URL. - Active org:
radar orgs use <id-or-slug>persists it; override per-command with--org <id-or-slug>or theRADAR_ACTIVE_ORG_IDenv var. It rides on every request as theX-Active-Org-Idheader, which the API resolves by id or slug server-side. - Shared projects:
projects,queries,results, andgame-plansscoped to the active org include projects shared into it (agency access), not just ones it owns. Each project row carries anaccessfield —"owner"(your org owns/pays) or"shared"(shared in for view/run/edit; billing hidden). Jobs and credits stay owner-org-only.
Programmatic use
import { buildProgram, ApiClient, loadSession } from "@mirage-cli/radar-cli";
// As a Commander program (drives the same CLI surface):
const program = buildProgram();
await program.parseAsync(["node", "radar", "projects", "list"]);
// As a typed API client:
const session = loadSession();
if (session) {
const client = new ApiClient(session);
const { rows, total } = await client.list("projects", { search: "acme" });
const plan = await client.get("game-plans", "<id>");
}Drop-in for mirage: see @mirage-cli/radar.
