Installation
Prerequisites
Section titled “Prerequisites”- Deno 2.7 or newer
- A LokAI account
- Access to Studio if you want to create a personal access token for automation
Install the CLI
Section titled “Install the CLI”-
Clone the repository
Terminal window git clone https://github.com/78-North/LokAI.gitcd LokAI -
Install the
lokaicommandTerminal window deno task --cwd apps/cli installThis installs the CLI as
lokaiusing Deno’s standard installer. -
Verify the installation
Terminal window lokai --help -
Authenticate
Terminal window lokai auth loginThis 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 --browserFor headless environments, create a token in Studio under Account → Access Tokens and use:
Terminal window lokai auth login --token <lok_pat_...> -
Confirm your identity
Terminal window lokai auth whoami
API endpoint selection
Section titled “API endpoint selection”By default the CLI uses the LokAI development API at https://api-dev.lokai.cloud.
Point the CLI somewhere else when needed:
lokai auth login --api-url https://your-api.example.comYou 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.
Credentials storage
Section titled “Credentials storage”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.
Next steps
Section titled “Next steps”- Follow the Quickstart to connect the CLI to your account
- Browse the CLI Reference for all available commands