Getting started
Installation
Install the kairo command globally with npm, check it's on your PATH, and see what it can do.
Requirements#
| Requirement | Why |
|---|---|
| Node.js 20.10 or newer | The CLI is a Node program, and uses the fetch built into Node 20. |
| git | Every command that reads a commit or a hook runs git itself. |
| A browser, on any device | Only to approve the sign-in once. It doesn’t need to be on the same machine. |
Check your Node version:
node --version
Install#
Install the package globally
npm install -g kairo-cliThis puts a
kairocommand on yourPATH.Verify the installation
kairo --versionIt prints the installed version, for example
0.1.0.kairo -vdoes the same.Run it for the first time
kairoA bare
kairo(orkairo --help) prints every command, followed by a short guide:Getting started: $ kairo login Connect this machine to your account $ kairo whoami Check which account it is signed in as $ kairo review Draft a build log from your latest commit $ kairo install Offer one after every commit in this repository Environment: KAIRO_API_URL The Kairo server to talk to (default: production) KAIRO_TOKEN A token to use instead of signing in, for CI KAIRO_CONFIG_DIR Where credentials are kept KAIRO_SKIP_HOOK=1 Skip the post-commit review for one commit NO_COLOR Turn colour offEach command has its own help too, for example
kairo review --help.
Where the CLI keeps its files#
The CLI stores your sign-in and any unpublished drafts in your platform’s config directory. On macOS and Linux, these files are readable only by you.
| Platform | Directory |
|---|---|
| macOS | ~/Library/Application Support/kairo/ |
| Linux | $XDG_CONFIG_HOME/kairo/, else ~/.config/kairo/ |
| Windows | %APPDATA%\kairo\ |
credentials.json— your sign-in token.kairo logoutdeletes it.drafts/— unpublished drafts, one file per repository. See Draft recovery.
Set KAIRO_CONFIG_DIR to keep them somewhere else.
Environment variables#
| Variable | What it does |
|---|---|
KAIRO_API_URL | The Kairo server to talk to. Defaults to production. |
KAIRO_TOKEN | Use this token instead of a stored sign-in, for CI. |
KAIRO_CONFIG_DIR | Keep credentials and drafts in this directory instead. |
KAIRO_SKIP_HOOK | Set to 1 to skip the post-commit review for one commit. |
NO_COLOR | Turn colour off. Colour is also off when output isn’t a terminal, or with TERM=dumb. |
Uninstall#
Do the first two steps while kairo is still installed — once the package is gone, it can’t revoke your token or tidy up its hooks.
Remove the post-commit hook
In each repository where you ran
kairo install:kairo uninstallOtherwise the hook stays behind and prints kairo: not found on PATH after every commit.
Sign out
kairo logoutThis revokes the token on Kairo and deletes it from this machine.
Uninstall the package
npm uninstall -g kairo-cliCheck it’s gone:
kairo --versionshould now fail with a “command not found” error.
Unpublished drafts stay in the config directory. Delete its kairo folder if you don’t want to keep them.
Next: sign in.