Skip to content

Installation

  • Deno 2.7 or newer
  • A LokAI account
  • Access to Studio if you want to create a personal access token for automation
  1. Clone the repository

    Terminal window
    git clone https://github.com/78-North/LokAI.git
    cd LokAI
  2. Install the lokai command

    Terminal window
    deno task --cwd apps/cli install

    This installs the CLI as lokai using Deno’s standard installer.

  3. Verify the installation

    Terminal window
    lokai --help
  4. Authenticate

    Terminal window
    lokai auth login

    This prompts for your email address and password, validates the session with LokAI, and stores the session locally.

    If you prefer to sign in through Studio in the browser, use:

    Terminal window
    lokai auth login --browser

    For headless environments, create a token in Studio under AccountAccess Tokens and use:

    Terminal window
    lokai auth login --token <lok_pat_...>
  5. Confirm your identity

    Terminal window
    lokai auth whoami

By default the CLI uses the LokAI development API at https://api-dev.lokai.cloud.

Point the CLI somewhere else when needed:

Terminal window
lokai auth login --api-url https://your-api.example.com

You can also set API_URL to make that endpoint the default for future commands. For browser login, use --studio-url if your Studio app lives at a different origin than the inferred default.

Session data is stored in ~/.lokai/credentials.json, and the selected API URL is stored in ~/.lokai/config.json. On Unix-like systems those files are written with 0600 permissions.

Set LOKAI_CLI_HOME if you need the CLI to use a different directory.