@vigilbase/cli
Version:
Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.
49 lines (48 loc) • 1.73 kB
JavaScript
import { handleLogin, handleLogout, handleWhoami } from './auth.js';
import { handleAccount } from './account.js';
import { handleBilling } from './billing.js';
import { handleCloudflare } from './cloudflare.js';
import { handleCloudflareCheckup, handleLocal } from './local.js';
import { handleBadge, handleDescribe, handleDoctor, handleList, handleRun, handleSkill, } from './public-tools.js';
import { handleRuns } from './runs.js';
import { handleOne } from './one.js';
import { handleSecurity } from './security.js';
import { handleWatchdog } from './watchdog.js';
/**
* Modular command registry.
* Public tool commands never require auth. Auth-gated commands live under
* account / runs / cf / watchdog / billing / login. `local` runs on this
* machine with the user's own tools (Cloudflare's cf) and needs no login;
* `cloudflare-checkup` is the top-level alias of `local cloudflare-checkup`.
*/
export const COMMAND_HANDLERS = {
list: handleList,
tools: handleList,
run: handleRun,
headers: handleRun,
email: handleRun,
describe: handleDescribe,
skill: handleSkill,
badge: handleBadge,
doctor: handleDoctor,
login: handleLogin,
logout: handleLogout,
whoami: handleWhoami,
account: handleAccount,
runs: handleRuns,
runhistory: handleRuns,
cf: handleCloudflare,
cloudflare: handleCloudflare,
watchdog: handleWatchdog,
security: handleSecurity,
customers: handleOne,
orgs: handleOne,
monitoring: handleOne,
support: handleOne,
billing: handleBilling,
local: handleLocal,
'cloudflare-checkup': handleCloudflareCheckup,
};
export function getCommandHandler(command) {
return COMMAND_HANDLERS[command] ?? null;
}