Skip to content
Docs / Installation

Getting started

Installation

Install the kairo command globally with npm, check it's on your PATH, and see what it can do.

Requirements#

RequirementWhy
Node.js 20.10 or newerThe CLI is a Node program, and uses the fetch built into Node 20.
gitEvery command that reads a commit or a hook runs git itself.
A browser, on any deviceOnly to approve the sign-in once. It doesn’t need to be on the same machine.

Check your Node version:

node --version

Install#

  1. Install the package globally

    npm install -g kairo-cli
    

    This puts a kairo command on your PATH.

  2. Verify the installation

    kairo --version
    

    It prints the installed version, for example 0.1.0. kairo -v does the same.

  3. Run it for the first time

    kairo
    

    A bare kairo (or kairo --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 off
    

    Each 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.

PlatformDirectory
macOS~/Library/Application Support/kairo/
Linux$XDG_CONFIG_HOME/kairo/, else ~/.config/kairo/
Windows%APPDATA%\kairo\
  • credentials.json — your sign-in token. kairo logout deletes it.
  • drafts/ — unpublished drafts, one file per repository. See Draft recovery.

Set KAIRO_CONFIG_DIR to keep them somewhere else.

Environment variables#

VariableWhat it does
KAIRO_API_URLThe Kairo server to talk to. Defaults to production.
KAIRO_TOKENUse this token instead of a stored sign-in, for CI.
KAIRO_CONFIG_DIRKeep credentials and drafts in this directory instead.
KAIRO_SKIP_HOOKSet to 1 to skip the post-commit review for one commit.
NO_COLORTurn 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.

  1. Remove the post-commit hook

    In each repository where you ran kairo install:

    kairo uninstall
    

    Otherwise the hook stays behind and prints kairo: not found on PATH after every commit.

  2. Sign out

    kairo logout
    

    This revokes the token on Kairo and deletes it from this machine.

  3. Uninstall the package

    npm uninstall -g kairo-cli
    

    Check it’s gone: kairo --version should 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.