niiko/developers

Packages TypeScript Latest 0.3.0

niiko-cli

The niiko API from the terminal: actions with a key, reads with an OAuth token, JSON output and the outcome in the exit code.

Last updated

Runtime
Node 20+
License
MIT
Source
vorluno/niiko-cli
Registry
www.npmjs.com/package/niiko-cli

Install

npm install -g niiko-cli

Use

Output is always JSON and the outcome is the exit code: 0 done · 2 refused · 3 pending approval · 1 error — so niiko run … && next does the right thing without parsing anything. Actions take a key; reads take an OAuth token a person granted.

npm install -g niiko-cli

niiko login --key nk_…        # stored in ~/.config/niiko/config.json (0600)
niiko actions                 # what is open today, with its purpose
niiko describe crm.note_added
niiko run crm.note_added --input '{ "client": "Casa Mestiza", "note": "Prefers WhatsApp." }' && echo saved

niiko login --token …         # an OAuth access token: reads are done on behalf of a person
niiko reads                   # the declared reads, read-only
niiko read kiipu.collections_get
Two permissions, not one

Both are needed: a key with that scope, and the workspace owner having switched the permission on. Holding the key is not enough — they are two decisions made by different people.

What it does not do

  • Client-side validation or pagination — the server validates, and a read answers in a single reply.
  • The OAuth flow — it takes a token a person already granted (niiko login --token).

Versions

Every version published to the registry, newest first, with the moment it became installable. Each one has its own page.