Skip to main content

Akleao CLI

Unified command-line interface for Akleao apps.

Commands are scoped by app:

  • akleao dock … — Akleao Dock (projects, datasets, large-file uploads)
  • akleao research … — Akleao Research (workspace sync: init / sync / pull / watch / branch)
  • akleao <cmd> … — bare commands without an app scope default to research

Tracked in AKLEAO-43.

Install

cd cli
pip install -e .

Exposes the akleao command.

Authenticate once — every app

# Opens a browser on akleao.com (production, the default); mints ONE
# sk_akleao_* key valid on both Dock and Research.
akleao login

# Headless / SSH:
akleao login --no-browser        # RFC 8628 device flow
akleao login --api-key sk_akleao_...

akleao whoami
akleao logout

The default target is production (https://akleao.com). Other deployments are one flag away — both API bases (Research + Dock) are derived automatically from the auth base for akleao.com hosts:

akleao login --env staging --api-url https://staging.akleao.com
akleao login --env dev     --local     # local dev stack (localhost:3000)

Quickstart — Dock

# 1. Authenticate (one key for every app — auth is not app-scoped)
akleao login

# Or headless, with a pre-provisioned API key:
akleao login --api-key sk_akleao_...

# 2. List projects and datasets
akleao dock projects list
akleao dock datasets list --project <project-id>

# 3. Upload a large file directly to GCS
akleao dock datasets upload <dataset-id> ./huge-file.parquet

Configuration

akleao init (and akleao dock init) also drop an AKLEAO.md in the directory: a short, agent-focused orientation covering how to invoke the CLI (akleao vs uv run akleao vs uvx), how to check auth, and which akleao dock guide <section> to read for a given task. init adds it to .akleaoignore, so it stays local and never uploads to the project. It is deliberately not named AGENTS.md — that filename is the project's own instructions file, which does sync.

All CLI config lives at ~/.config/akleao/config.yaml in a single akleao: section holding named environments (default / staging / dev / …). Each environment stores the auth base (url) plus the derived dock_url / research_url API bases and one shared sk_akleao_* key. Defaults point at production.

Older layouts (a dock:/research: section in this file, or the pre-rename ~/.config/dock/config.yaml) are dropped, not migrated — the CLI prints a one-line notice and you re-run akleao login. The old migration guessed the auth base from the Dock URL and silently fell back to production for hosts it didn't recognize, which could send a staging credential to prod.

Env vars

Override values stored in the config file (highest precedence):

  • AKLEAO_API_KEY — unified API key
  • AKLEAO_API_URL — auth/login base URL
  • AKLEAO_DOCK_URL / AKLEAO_RESEARCH_URL — per-app API bases (the escape hatch for hosts the CLI can't derive)
  • AKLEAO_ENV — named environment to target
  • AKLEAO_MANAGED_SESSION — set by the platform inside an agent VM / CI runner. Marks the credentials as platform-issued: akleao login and akleao logout refuse to run, and 401 hints stop suggesting re-authentication.

There is one application key, so there are no per-app overrides. The old DOCK_API_KEY / DOCK_API_URL / RESEARCH_API_URL variables were removed in 0.3.0 — use AKLEAO_API_KEY / AKLEAO_DOCK_URL / AKLEAO_RESEARCH_URL.

Commands

Auth

  • akleao login — default: opens a browser on akleao.com (production)
  • akleao login --api-key KEY — headless, skip the browser
  • akleao login --no-browser — device-flow approval (see below)
  • akleao login --api-url URL — target another deployment (staging etc.)
  • akleao login --local — target a local dev stack (localhost:3000)
  • akleao logout — clear credentials for the active env
  • akleao whoami — print the user the stored key resolves to

Auth lives only at the root. There is no akleao dock login/logout/whoami — one sk_akleao_* key authorizes Dock and Research alike.

Env

Mounted at both akleao env … and akleao dock env …:

  • akleao env list — show all environments with their URL and auth state
  • akleao env show [NAME] — details for one env (masks the API key; defaults to current)
  • akleao env use <name> — switch which env is active
  • akleao env add <name> --url URL — register a new env (unauthenticated)
  • akleao env set <name> [--url URL] [--clear-auth] — update URL and/or wipe stored creds
  • akleao env remove <name> [--yes] — drop an env

Dock — Projects

  • akleao dock projects list [--limit N] [--status STATUS]
  • akleao dock projects get <project-id>

Dock — Datasets

  • akleao dock datasets list [--project PROJECT_ID]
  • akleao dock datasets get <dataset-id>
  • akleao dock datasets create <name> --project <project-id>
  • akleao dock datasets files list <dataset-id>
  • akleao dock datasets upload <dataset-id> <file> — direct-to-GCS upload

Dock — Data APIs

  • akleao dock apis create <name> -d <dataset-id> -m <model-id> — bind a LinkML model to a dataset
  • akleao dock apis build <slug> --wait — materialize validated, slot-named parquet
  • Serve — three tiers (fields are the model's slot names, never raw headers):
    • akleao dock apis rows <slug> <Class> [-n N] [--slots a,b] [--cursor C] [--jsonl] — the fast absolute-offset pager (≤500/page)
    • akleao dock apis query <slug> <Class> [--ops '<json>'] [--sort col[:desc]] [-n N] [--cursor C] — the dynamic ops[] contract (filter / range / sort, keyset paging)
    • akleao dock apis pages <slug> <Class> [--start-chunk K] — the bulk-collection fast path: a signed-URL manifest over the build's static row chunks (fetch them browser-direct, in parallel)
    • akleao dock apis collect <slug> [Class] [-o DIR] [-c N] — pull a whole class (or the whole API) to disk as JSONL via pages; ~8x a naive rows pull on large tables
  • akleao dock apis openapi <slug> [-o spec.json]
  • akleao dock apis keys mint <slug> <name> [--expires-in-days N] [--raw] — a dk_ key scoped to ONE API, so a portal can read a private API without a personal key. Shown once.
  • akleao dock apis keys list <slug> / akleao dock apis keys revoke <slug> <key-id>

Research

Workspace sync — mirror a project's file tree locally and keep it in step:

  • akleao init / akleao status / akleao sync / akleao pull <path> / akleao watch
  • akleao branch list|create|switch|delete

Admin

Site-admin accounts only (the stored key must belong to an admin; anyone else gets 403):

  • akleao admin debug <project> [--since 24h] [--run RUN] [--json] [--out FILE] — everything needed to debug a project's agent errors or worker VM in one call: project summary, live worker status, parallel runs settings, worker boots, run executions, machines seen, linked computers, runs, agent errors (full messages), VM lifecycle events and recent machine logs (warnings and errors first, plus the lines before each agent error). Markdown by default, so it can be pasted straight into Claude Code. <project> is a project id or a pasted /admin/v2/projects/<id> or /collab/<id> URL. --since takes 30m, 2h, 24h, 7d (at most 30 days) or an ISO timestamp. --run keeps only machine log lines tagged with that run (run=<first 8 characters>). Backed by GET /admin/v2/projects/:id/debug?since=&run=&format=markdown|json on the Research API.
  • akleao admin collab parallel <project> [--max N [--vm MEMxCPUS] | --off] [--json] — shows or sets a project's parallel runs. --max sets how many runs it takes at a time (1 to 8), --vm 4096x2 also sets its VM size (default 2 CPU / 2048 MB; the machine is resized in place only when no run is live), --off clears both. No option prints the current settings, the protocol and cap in force and the newest worker boot. The cap applies unless the backend's COLLAB_PARALLEL_RUNS is off (unset is on). Each change writes an admin.parallel_runs_set row to collab.events. Backed by GET|PUT /admin/v2/projects/:id/parallel-runs.
akleao admin debug https://akleao.com/admin/v2/projects/<id> --since 2h
akleao --env dev admin debug <id> --json --out debug.json   # local stack
akleao admin collab parallel <id> --max 2
akleao admin collab parallel <id> --max 2 --vm 4096x2   # the larger size, 2 CPU / 4 GB
akleao admin collab parallel <id> --off

Device-flow login (--no-browser)

For SSH sessions, containers, WSL, or anywhere a local browser isn't practical:

akleao login --no-browser

The CLI prints a short user code and a verification URL (e.g. a one-click approve page). Open it on any device you're already signed into Akleao with, confirm the code, and the CLI picks up the new API key automatically. RFC 8628 under the hood — POST /api/rest/v1/research/auth/cli/device-code → poll /device-token until the frontend's approve-page fires.

Env-var precedence

For every setting with an env-var counterpart, the order is: explicit CLI flag → AKLEAO_* env var → value stored in the active environment. The config file is the baseline.

Testing

cd cli
pip install -e '.[dev]'
pytest

Tests sandbox ~/.config/akleao/ into a tmpdir and mock HTTP via respx, so running them doesn't touch your real config or hit a live backend.

How large uploads work

akleao dock datasets upload does not send bytes through the Next.js API. Instead:

  1. CLI asks the backend for a v4 signed PUT URL (POST /datasets/{id}/files/upload-url)
  2. CLI streams the file directly to Google Cloud Storage with a progress bar
  3. CLI calls POST /datasets/{id}/files/finalize to register the file in the database

This means you can upload multi-gigabyte files without any proxy layer in the middle.

Package layout

cli/
├── pyproject.toml
├── README.md
└── akleao/
    ├── __init__.py
    ├── __main__.py           # entry point; rewrites argv for default-to-research
    ├── cli.py                # root Typer app, mounts dock + research
    ├── utils/
    │   └── config.py         # unified ~/.config/akleao/ config, per-app buckets
    ├── dock/
    │   ├── cli.py
    │   ├── api/
    │   └── commands/         # auth, datasets, projects, env_cmd
    └── research/
        └── cli.py            # scaffold — add commands here

When research commands are added, register them on akleao/research/cli.py::app — they'll be reachable at both akleao research <cmd> and (because research is the default scope) akleao <cmd>.

Metadata

Release files for akleao 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akleao 0.5.0
File Size Uploaded Provenance Actions
akleao-0.5.0.tar.gz 684.5 kB With provenance Details for akleao-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for akleao 0.5.0
File Interpreter ABI Platform Actions
akleao-0.5.0-py3-none-any.whl Python 3 none any Details for akleao-0.5.0-py3-none-any.whl

Total release size: 899.1 kB

Release files / akleao-0.5.0.tar.gz

Download URL akleao-0.5.0.tar.gz
Size 684.5 kB
Tags Source
SHA-256 checksum
How to use checksums
191be21f0f67e67c37ac693ae336c3c2f2dd10ae7cf31c2cc9a185fbe3917d33
BLAKE2b-256 checksum
How to use checksums
5b670e351da301473e4b1be6796b42ad31bdb3df1dfd06e31f3214e743243415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / akleao-0.5.0-py3-none-any.whl

Download URL akleao-0.5.0-py3-none-any.whl
Size 214.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20152bf379d85e2129f1143df00f3606892c92c4e70240988fad35e72bbac8fd
BLAKE2b-256 checksum
How to use checksums
6b172e56348c458b12ff7a1556d7694fd31497ff9351df467d25f9a55b3b24bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for akleao 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for akleao-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page