The klahaya Command Line
klahaya is a command-line tool for the admin API. It is built for bulk work that is tedious in the browser — loading a season of lesson classes from a spreadsheet, creating a month of volunteer shifts — and for scripting. It needs a personal access token from API Access.
Installing
Section titled “Installing”The tool is not published to a package registry; it is installed from the portal’s code repository. From a checkout of the repository, with Node 20 or newer:
npm run build -w packages/clinpm link -w packages/cli # puts `klahaya` on your PATHklahaya --versionIf you prefer not to install it, npm run cli -- <command> from the repository root runs the same thing.
Signing in
Section titled “Signing in”-
Create a personal access token at Admin > Settings > API Access and copy it.
-
Run
klahaya loginand paste the token when prompted. It is stored in your user config directory, readable only by you. -
Run
klahaya whoamito confirm which admin, which scopes and which deployment you are talking to.
Tokens are stored per deployment, so staging and production can coexist; pick one with --base-url <url>. With only one stored you never need the flag. klahaya logout forgets the local copy but does not revoke the token — do that on the API Access page.
For automation, set KLAHAYA_PAT (and optionally KLAHAYA_BASE_URL) in the environment instead; the credential file is then never read or written.
Running operations
Section titled “Running operations”klahaya ops list # every operation availableklahaya ops list lessons # filter by nameklahaya run lessons classes list --session-id <uuid>klahaya run lessons classes create --help # what it takesklahaya run lessons classes create --input @classes.jsonSimple inputs are flags (--session-id, --name). Anything structured — a list of rows, a nested filter — goes through --input, which takes @file.json, - for standard input, or inline JSON. Flags override the file, so --input @classes.json --session-id <other> reuses a document against a different session. Add --json to print the server’s raw response.
Plans, apply and undo
Section titled “Plans, apply and undo”A write does not write. Running a create or update operation returns a plan describing what it would do — the rows, the emails it would send, and anything it refuses — and nothing changes until you apply it:
klahaya run volunteer opportunities create --input @shifts.json # prints a plan and its idklahaya plans get <plan-id> # re-read itklahaya plans apply <plan-id> # perform itplans apply asks for confirmation unless you pass --yes. A plan lasts 15 minutes, holds at most 500 rows, and cannot be applied if it contains a single error row — fix the input and plan again. Apply also re-checks the records first and refuses if they changed underneath the plan.
Every apply is recorded as a batch, on the API Access page and here:
klahaya batches list # recent writes, newest firstklahaya batches get <batch-id> # one batch, row by rowklahaya batches revert <batch-id> # plan an undo, then apply itSee API Changes and Undo for what a revert can and cannot put back.