okaeDocs

CLI

Connect a GitHub repository and check its Okae status from your terminal or coding agent.

View Markdown

Install the CLI

Use Node.js 24 or newer. Install the official package and check the command:

cd ~
npm install --global @okae/cli
okae --help

If you prefer to skip a global install, run the CLI on demand with npx. Choose your repo with --repo:

cd ~
npx @okae/cli init --repo OWNER/NAME

An agent can reuse the same npx prefix from your home directory for subsequent commands, with --repo OWNER/NAME for repository operations. This keeps your repo’s packages and registry settings out of CLI installation.

Set up your repo

With the Okae CLI and Node.js 24 or newer installed, open your repository and run:

okae init

The CLI reads your Git remote and reuses your workspace session. On first use, it opens Okae in your browser. Choose Continue with GitHub if you're signed out, select the workspace, and authorise access as its GitHub organisation owner. Return to your terminal to see the repository's configured mode and latest assessment.

If the repository still needs connecting, follow the browser setup link. You can rerun okae init after connecting it. With multiple remotes, use okae init --repo OWNER/NAME to select the repository.

Commands

CommandWhen to use it
okae initConnect your repo or verify its existing setup.
okae loginAuthorise a workspace from any directory. The CLI saves the credential in your OS keychain.
okae auth statusSee your signed-in account, workspace and session expiry.
okae workspace statusCheck available and reserved credits, the number of connected repositories you can access, and whether processing is enabled. Works from any directory.
okae repo listList repositories you can manage. Use --limit and --offset to page through results.
okae statusSee the repository's setup state, mode and latest assessment link.
okae config showRead effective settings from the working copy. Use --live for the default branch.
okae config show --briefSummarise the default-branch policy in plain language, for you or your coding agent.
okae preflightCheck your committed changes against the repository's rules before you push. It sends metadata only and uses no credits.
okae hook session-startAdd the policy summary from a Claude Code or Codex hook. See use Okae with a coding agent.
okae config previewValidate your working copy of okae.yml and preview its changes. For a managed settings draft, pass --file changes.json.
okae config apply --file changes.jsonSave managed repository settings from a JSON draft. Changes to okae.yml go through Git.
okae assessments listSee recent assessments in your repo. Use --workspace to include every repository you can access or --repo OWNER/NAME to select one.
okae assessments runPick an open PR interactively. Pass a number or GitHub PR URL to submit directly. Use --no-wait to return after acceptance.
okae assessments show IDInspect an assessment in the authorised workspace, including after you interrupt a waiting terminal.
okae logoutRevoke the session and remove the saved credential.

For a coding agent or script, use okae status --json. To open the sign-in link yourself, use okae login --no-browser. You can manage repository settings in the dashboard.

Use okae assessments list --json or okae assessments show ID --json to read the full reasons array. The dashboard and CLI text show Multiple reasons when a run has more than one.

Configure a repository

Keep the defaults if they fit. Use managed settings for changes you want to save directly in Okae. Choose okae.yml when your team wants policy changes reviewed in Git.

After writing or editing a root-level okae.yml, run okae config preview in your repo to compare its effective settings with the default branch. Run okae config show to read the full proposed policy. Both work before staging or committing. Invalid settings produce an error and exit code 1. To use the file in an assessment, commit it on the PR branch. Removing the file previews the inherited settings. Use okae config show --live for the live default-branch policy. Selecting a repository explicitly with --repo also reads its live policy. When running npx outside your repo, use config preview --repo OWNER/NAME --file /path/to/your-repo/okae.yml.

To prepare a settings draft, read storage.repository.revision from okae config show --json. Use that exact value for expected_revision. For example, for a repo whose revision is currently null:

{ "expected_revision": null, "updates": { "enable_approvals": false }, "removals": [] }

Preview the file, review the effective changes together, then apply it. In a script use okae config apply --file changes.json --yes after the owner has agreed. When a field is controlled by okae.yml, propose the change in Git.

Sessions expire after seven days. If you lose a device or expose a token, open workspace Settings → Your API sessions → Revoke sessions. This signs your API clients out of that workspace.

Assess a pull request

okae assessments run           # Pick an open PR in the terminal
okae assessments run --json    # List candidates for an agent
okae assessments run 42        # Submit PR 42 and wait for the result

Listing candidates spends no credits. Once you submit a PR, the usual assessment credit rules apply. Ctrl-C stops the local wait. Use okae assessments show ID to inspect the accepted run later.

Use Okae with a coding agent

Your coding agent can learn the repository's policy and check its work before it opens a PR. That way it can keep routine PRs approvable and tell you when a change will need human review.

Install the Okae skill for any agent that supports skills:

npx skills add Okae-AI/skills --skill okae

For an agent without skills, add a line to your AGENTS.md asking it to run okae config show --brief before it starts and okae preflight before it pushes.

Run a preflight before you push

Run okae preflight in your repo after you commit:

okae preflight                   # Compare with the remote default branch
okae preflight --base origin/dev # Compare with another branch
okae preflight --json            # Read rule results in a script or agent

The CLI compares your commits with the branch your PR will target, the same way GitHub does. It sends each changed file's path, previous path, status, line counts and Git mode. File contents never leave your machine. A preflight applies your repository's rules: size limits, protected and ignored paths, and the changes that always need human review, such as lockfiles or CI configuration. The policy comes from okae.yml on the default branch and your managed settings.

A preflight is free. It doesn't create an assessment or use credits, and it's rate-limited per user. A clean result means no rule matched. The assessment still reviews the diff itself, so a clean preflight doesn't promise approval.

okae preflight and okae config show --brief need a signed-in session for the workspace owner. Cloud agents without your session can rely on the PR result.

Add a hook to Claude Code or Codex

A session-start hook gives the agent the policy summary automatically. It never blocks the agent or asks for permission. If Okae is unreachable or you're signed out, it prints nothing and exits 0.

For Claude Code, add this to .claude/settings.json in your repo or ~/.claude/settings.json:

{
  "hooks": {
    "SessionStart": [{ "hooks": [{ "type": "command", "command": "okae hook session-start", "timeout": 30 }] }]
  }
}

For Codex, add this to .codex/hooks.json in your repo or ~/.codex/hooks.json, then review and trust the hook with /hooks:

{
  "hooks": {
    "SessionStart": [{ "hooks": [{ "type": "command", "command": "okae hook session-start", "timeout": 30 }] }]
  }
}

The hook runs the globally installed okae command. Sign in with okae login first.

On this page