Skip to main content

naas-abi-cli

Command Line Interface (CLI) tool for building and managing ABI (Agentic Brain Infrastructure) projects.

Overview

naas-abi-cli provides a comprehensive set of commands to create, configure, deploy, and interact with ABI projects. It serves as the primary entry point for developers working with the ABI framework, enabling quick project setup, agent interaction, and cloud deployment.

Since 3.0, abi new project creates projects that run on NATS and abi new module creates remote modules (naas-abi-sdk). Dagster and RabbitMQ are legacy extras for projects without NATS, removed in the next major. Upgrading a 2.x project: Migrate from 2.x to 3.0. Every command: CLI Reference. Start with Install and prerequisites and the Quickstart; deploy with Docker, Dokploy or production.

Installation

Install the CLI tool using pip:

pip install naas-abi-cli

Available Commands

Project Management

abi new project <project-name> [project-path] [--with-local-deploy/--without-local-deploy] [--without-nats] [--abi-source <url|path>]

Creates a new ABI project with all necessary starter files and dependencies.

What it does:

  • Creates a new project directory (must be empty or non-existent)
  • Generates project structure with configuration files, Docker setup, and Python package structure
  • Generates local deployment scaffolding (docker-compose.yml, .deploy/, and local .env values) by default
  • Automatically installs required dependencies (naas-abi-core, naas-abi-marketplace, naas-abi, and naas-abi-cli; naas-abi-sdk and naas-abi-proto in NATS mode)
  • Customizes project files with your project name

NATS by default. The project runs the engine on NATS: every config has a nats: block with discovery on (project = the project name), the bus is JetStream, and .env holds the broker passwords of the engine and of its auth callout (NATS_ENGINE_PASSWORD, NATS_AUTH_PASSWORD) and the callout's signing seed (NATS_AUTH_CALLOUT_SEED, NATS_AUTH_CALLOUT_ISSUER). Modules log in with their own service keys, and the engine gives each connection the subjects its approved policy allows. The Docker stack starts the nats service, keeps RabbitMQ behind the rabbitmq profile and runs no Dagster: one engine hosts discovery, and module jobs replace Dagster's schedules. The broker's monitoring port answers on the stack's nats-monitor network only: docker compose exec nats wget -qO- http://nats-monitor:8222/healthz (or /connz).

NATS mode installs naas-abi-proto and naas-abi-sdk from the .abi submodule, at the framework's revision, so it refuses --without-abi-submodule. --abi-source clones that submodule from another git URL or a local ABI checkout (its HEAD) instead of GitHub, to try framework changes not published yet. --without-nats creates the classic in-process project (RabbitMQ in Docker, no broker for abi dev). The project's own module (src/<project>/, holding the default agent) is an in-engine module either way.

Example:

abi new project my-abi-project
abi new project my-abi-project --without-local-deploy
abi new project my-abi-project --without-nats   # classic, in-process

abi new module <name> [path] [--in-engine | --remote] [--standalone] [--abi-ref <ref>]

Creates a module. By default a remote module: a naas-abi-sdk package that runs in its own process, reaches the engine only through NATS, and never imports naas_abi_core. It has an agent (an SDK IntentAgent on the engine's default models, its memory in the Document Service), an hourly @job, a python -m <name> entrypoint with discovery and SIGTERM handling, an app scaffold and offline tests. It runs on a service key (ABI_SERVICE_KEY) and holds no signing secret.

  • In a project (a folder with config.yaml and pyproject.toml), it goes to src/<name>/ with an SDK-only Dockerfile, gets a dev.modules entry in config.yaml (abi dev up runs it) and a service in docker-compose.override.yml (abi start runs it; abi deploy local --regenerate never touches that file). Its service key goes in .env (<NAME>_SERVICE_KEY, from abi iam service-account create ... --key), and its permission manifest waits for abi iam module approve. It is not added to modules:: it registers itself through discovery, and Nexus lists its agent once the module logs READY.
  • --standalone (the default outside a project) creates a repository of its own: pyproject.toml (naas-abi-sdk[agent,otel,workflows,rdf] and naas-abi-proto from git at --abi-ref, by default this CLI's release tag naas-abi-cli-v<version>, so they match the CLI and never move), Dockerfile, README.md, AGENTS.md, ready for git init.
  • --in-engine (alias --local) creates the classic module the engine loads (agents, integrations, pipelines, workflows, orchestrations, ontologies); add it under modules:. It is the default in a project whose config has no nats: block, where nothing would run a remote module; --remote creates a remote one there anyway, ready for when the project moves to NATS.

Inside a remote module, abi new agent writes an SDK agent and abi new app adds an app the module serves through Nexus, with an optional backend (self.expose_app(name, asgi_app)). abi new workflow, abi new pipeline and abi new integration write naas-abi-sdk classes (Workflow, Pipeline, Integration, no naas_abi_core) with a test beside them: put them in the module's workflows/, pipelines/ and integrations/ folders, and the module finds and builds the workflows and pipelines, whose agents call them with as_tools(). abi new orchestration scaffolds core code, so it refuses and says to declare a @job instead.

Example:

abi new module research                 # remote, in a NATS project
abi new module research --standalone    # its own repository
abi new module legacy --in-engine       # loaded by the engine

abi init <path>

Initializes a new ABI project in the specified directory.

Example:

abi init .

Agent Interaction

abi chat [module-name] [agent-name]

Starts an interactive chat session with an AI agent.

Parameters:

  • module-name: The module containing the agent (default: naas_abi)
  • agent-name: The specific agent class to use (default: AbiAgent)

What it does:

  • Loads the ABI engine and specified module
  • Launches an interactive terminal chat interface
  • Saves conversations to storage/datastore/interfaces/terminal_agent/

Example:

abi chat naas_abi AbiAgent

abi agent list

Lists all available agents across all loaded modules.

What it does:

  • Loads the ABI engine with all configured modules
  • Displays a formatted table showing module names and agent class names

Example:

abi agent list

abi agent migrate-memory [--from postgres|documents-v1] [--thread <id>]... [--apply]

Copies agent memory into the Document Service (checkpoint schema 2), from LangGraph's PostgreSQL tables (--source-url, default $POSTGRES_URL) or from document schema 1. A dry run unless --apply; running it again copies only what is missing. Stop the engines first. In NATS mode the engine runs the same copy as the agent_memory_migrate job.

abi agent prune-memory [--keep-last N] [--min-age S] [--thread <id>]... [--apply]

Deletes old checkpoints, keeping each thread's newest --keep-last (default 20); the conversation stays whole in them. A dry run unless --apply. In NATS mode the engine runs it daily as the agent_memory_prune job.

Configuration Management

abi config validate [--configuration-file <path>]

Validates the ABI configuration file for correctness.

Options:

  • --configuration-file: Path to configuration file (default: uses config.yaml from current directory)

Example:

abi config validate
abi config validate --configuration-file config.prod.yaml

abi config render [--configuration-file <path>]

Renders the loaded configuration as YAML output, useful for debugging and verification.

Options:

  • --configuration-file: Path to configuration file (default: uses config.yaml from current directory)

Example:

abi config render

abi module list

Lists all available modules and their enabled/disabled status.

What it does:

  • Loads the engine configuration
  • Displays a formatted table showing module names and their enabled status

Example:

abi module list

Local dev stack

abi dev up [--service <name>]... [-d] [--with-nats/--without-nats] [--with-tracing]

Runs the stack natively (no Docker). When the project config has a nats: block, the engine runs in NATS mode: oxigraph, nats, api, nexus-web, then the dev.modules. Dagster is left out (module jobs replace it). It needs nats-server 2.14 or later on PATH and fails with an install hint without it (or with an older one), rather than falling back to in-process mode. A project without a nats: block runs in-process with oxigraph, api, dagster and nexus-web. --with-nats and --without-nats choose the mode whatever the config says; --without-nats on a NATS project writes an overlay that sets nats: null. --with-tracing adds Jaeger. abi dev down, abi dev status, abi dev logs <name> [-f] manage it; pids and logs live in .abi/dev/. The discovery project is the config's nats.discovery.project, else the folder name.

In NATS mode, the SDK modules listed under dev.modules in the project config (abi new module adds them) start once the api is ready, each under a supervisor that restarts it when it exits on its own (backing off from 1 s to 30 s):

dev:
  modules:
    - name: probe-researcher                # logs, pid, --service name
      module: operations.projects.nats_probe  # run as `python -m <module> <args>`
      module_id: acme.researcher            # its ABIModule.module_id (default: name)
      args: [researcher]
      env: {NATS_PROBE_DISCOVERY_PROJECT: "${ABI_DISCOVERY_PROJECT}"}
      restart: on-failure                   # or always, never

Each module runs as the service account module/<project>/<module_id> (module_id in the entry, else its name): abi dev up creates it, revokes the key the last run had, hands the module a fresh one and approves its permission manifest (services.iam.modules.auto_approve in the dev overlay). Each module gets ABI_NATS_URL (without broker login), ABI_SERVICE_KEY, ABI_DISCOVERY_PROJECT, OTEL_EXPORTER_OTLP_ENDPOINT with tracing, and the project's src/ on PYTHONPATH; env values may name them as ${VAR}. A module is addressed like a service: abi dev up --service probe-researcher -d (it joins the running NATS stack and starts no broker of its own), abi dev logs probe-researcher -f, abi dev down --service probe-researcher. abi dev down stops modules before the stack. The engine validates the block and otherwise ignores it.

Service accounts, keys and module permissions

abi iam works on the project's IAM store (services.iam.store, sqlite or PostgreSQL) and tells a running engine to reload (abi.iam.v1.changed). A key is printed once, at creation; only its hash is stored.

abi iam service-account create ci/nightly --key   # the account and a first key
abi iam service-account list
abi iam service-account delete ci/nightly         # its keys stop working

abi iam key create module/default/research --description prod
abi iam key list module/default/research
abi iam key rotate module/default/research <key id>   # a new key; the old one revoked
abi iam key revoke module/default/research <key id>

abi iam module list --status pending              # manifests waiting for approval
abi iam module show module/default/research
abi iam module approve module/default/research [--document narrowed.yaml]
abi iam module reject module/default/research --reason "asks for every document"

An account holds at most five active keys; ci/* keys expire after 90 days. A revoked key fails its next exchange and its next broker connection; tokens already issued expire within ten minutes. A remote module in Docker reads its key from <NAME>_SERVICE_KEY in .env (docker-compose.override.yml refuses to start without it).

Deployment

abi deploy local [--regenerate] [--no-backup] [--headscale] [--coding]

Writes the project's Docker Compose stack (docker-compose.yml, .deploy/). --regenerate re-renders it from the current templates, after a backup.

  • A project with a nats: block gets the NATS stack: a nats service the engine waits for, no Dagster, RabbitMQ behind the rabbitmq profile.
  • A project without one keeps the classic stack (Dagster and RabbitMQ, legacy) with a nats service behind the nats profile, and uv adds the naas-abi-core[dagster,rabbitmq] extras it needs (commit pyproject.toml and uv.lock).
  • It writes .deploy/docker/nats/nats.conf (the broker users engine and auth, and the auth callout that admits every module with its approved permissions) and generates NATS_ENGINE_PASSWORD, NATS_AUTH_PASSWORD, NATS_AUTH_CALLOUT_SEED and NATS_AUTH_CALLOUT_ISSUER in .env. Regenerate after each CLI upgrade.
  • It stops before writing anything when .env is not writable, and prints the chown to run.
  • docker-compose.override.yml (remote modules) is never rewritten.

abi deploy local-up [-d], local-down and local-logs run Docker Compose with the override file.

abi deploy naas [-e/--env <environment>]

Deploys your ABI project to Naas cloud infrastructure.

Options:

  • -e, --env: Environment to use (default: prod). Determines which configuration file to load (e.g., config.prod.yaml, config.yaml)

What it does:

  • Builds a Docker image of your ABI project
  • Pushes the image to your Naas container registry
  • Creates or updates a space on Naas infrastructure
  • Exposes your ABI REST API at https://{space-name}.default.space.naas.ai

Requirements:

  • Naas API key configured in your configuration file
  • Docker installed and running
  • Deploy section in your config.yaml file

Example:

abi deploy naas
abi deploy naas --env prod

abi deploy dokploy [--domain <domain>] [--coding] [--regenerate] [--wildcard-cert-resolver <name>]

Renders the project for a Dokploy server, where Traefik replaces the local Caddy edge.

What it does:

  • Writes docker-compose.dokploy.yml: no Caddy and no host ports; Traefik labels on the external dokploy-network route nexus.<domain> to Nexus, /app-html/* on it and api.<domain> to the API, and with --coding coder., *.coder. and git. to Coder and Forgejo. abi is built from the project Dockerfile on each deploy, with no source mount
  • Writes config.dokploy.yaml (from config.local.yaml, read with ENV=dokploy) and the .deploy/docker files the compose mounts. A dotenv secret adapter on the abi_secrets volume takes the place of the project's .env one, and the project's adapters are kept line for line, so secrets the engine writes survive redeploys. The Environment tab wins over that file
  • Writes the gitignored .env.dokploy with generated passwords and keys, to paste into Dokploy's Environment tab; the config secrets it has no value for are commented out. Reruns keep its values; --regenerate replaces them and backs the old file up
  • With --coding, the minted Coder/Forgejo admin tokens live on the coding_secrets volume, which the engine reads through a read-only dotenv secret adapter, so they survive redeploys. --wildcard-cert-resolver names a DNS-challenge resolver in Dokploy's Traefik for the *.coder certificate; without it, no wildcard certificate is requested
  • Calls between services use stack-unique aliases (<ABI_STACK_NAME>-abi, ...), so several stacks can share a server
  • --headscale is not supported on Dokploy yet

Example:

abi deploy dokploy --domain example.com
abi deploy dokploy --domain example.com --coding

Guide: Deploy with Dokploy.

Stack Management

Commands for the local Docker Compose stack (config.local.yaml). abi start, abi stop, and abi logs are also exposed at the top level for convenience.

abi stack snapshot create [-m/--note <text>] [--name <label>]

Takes a point-in-time snapshot of the stack's stateful data so you can roll back later or move the deployment to another host.

What it does:

  • Resolves the compose project and its stateful volumes (postgres_data, minio_data, fuseki_data, qdrant_storage, redis_data, rabbitmq_data, headscale_data); transient volumes (caddy certs, dagster history, caches, the headscale socket dir) are skipped
  • Gracefully stops the stack so the copy is consistent, archives each volume plus the host storage/ directory, writes a manifest.json (timestamp, git commit, config fingerprints), then restarts the stack

RabbitMQ note: durable queues only survive a restore if the broker's node name is stable. The compose file pins hostname: rabbitmq for this reason.

  • Stores everything under ./.snapshots/<id>/ (gitignored)

Example:

abi stack snapshot create -m "before v3.15 upgrade"

abi stack snapshot list

Lists snapshots (newest first) with id, date, size, git commit, and note.

abi stack snapshot restore <id> [--yes] [--no-safety-snapshot]

Rolls the stack back to a snapshot. Destructive: it overwrites current data.

What it does:

  • Validates the snapshot is complete before touching anything, so a corrupt or partial snapshot aborts without wiping any live data
  • Warns if the git commit or config.local.yaml/.env have changed since capture
  • Takes an automatic safety snapshot of the current state first (opt out with --no-safety-snapshot; skipped automatically on a fresh host with no data yet), so a rollback is itself reversible
  • Stops the stack, restores the volumes + storage/, and brings it back up, and if anything fails mid-restore it still brings the stack back up and prints the safety-snapshot id to recover from

Example:

abi stack snapshot restore 20260630-140509

abi stack snapshot delete <id> [--yes] / abi stack snapshot prune [--keep N] [--yes]

Remove a single snapshot, or keep only the newest N (default 5).

abi stack snapshot export <id> <archive.tar.gz> / abi stack snapshot import <archive.tar.gz>

Bundle a snapshot into one portable archive and re-register it on another host : the supported way to migrate a local deployment to a new machine:

# On the source host
abi stack snapshot create -m "migration"
abi stack snapshot export 20260630-140509 abi-migration.tar.gz
# copy abi-migration.tar.gz (and your .env) to the new host, then:
abi stack snapshot import abi-migration.tar.gz
abi stack snapshot restore 20260630-140509

export refuses to overwrite an existing file and import refuses to clobber a snapshot with the same id; pass --force to either to override. import also verifies the archive is complete (all volume tarballs + storage present) and rejects a partial one.

Note: the same .env (Postgres/MinIO/Fuseki credentials) must be present on the destination host : those credentials are baked into the data being restored.

Nexus admin (workspace / user / org)

Authenticated admin surface against the Nexus HTTP API. Nexus has no login of its own (people sign in at an identity provider), so a script authenticates with a personal API key (abi_pk_..., made in Nexus under Account, API keys), as NEXUS_ACCESS_TOKEN or --token. Base URL: NEXUS_API_URL (default http://localhost:9879). The /api/auth/* and /api/iam/* routes take a signed-in session only, never a key.

abi workspace create --name "Research preview" --slug research-preview --org org-...
abi workspace list --org org-...
abi workspace members list --workspace ws-...
abi workspace members add --workspace ws-... --email someone@naas.ai --role member

# Someone with no account is invited through the identity provider (it makes them
# exist and mails the code at their first sign-in); an existing account is added directly.
abi user invite --email someone@gmail.com --name "Someone" \
  --org org-... --workspace ws-... --role member --workspace-role member
abi org members invite --org org-... --email someone@gmail.com --workspace ws-...

abi user list --org org-...   # or --workspace ws-...

abi org list
abi org members list --org org-...
abi org workspaces --org org-...

All of these accept --dry-run (prints the intended API call) and --api-url / --token.

Moving an older project to the identity provider (accounts of the removed password / magic-link login):

abi user migrate            # dry run: who would be made at the built-in provider
abi user migrate --apply    # make them exist there, with the same email

Each person then signs in with the code the provider mails to their address; that first sign-in links the account, which keeps its roles, groups and data. Nobody is created twice, so it can be run again. --database-url names Nexus's database (default: nexus_config.database_url of the project). In abi dev, abi dev code prints the newest sign-in code (dev mail is a file in storage/email).

Break-glass Postgres (ops VM only, when the API is unavailable):

export NEXUS_POSTGRES_COMPOSE_DIR=/opt/abi
abi workspace create --via postgres --name "..." --slug ... --org org-... --owner-id user-...

See issue #1118.

Secret Management

abi secrets naas list

Lists all secrets stored in your Naas workspace.

Options:

  • --naas-api-key: Naas API key (default: NAAS_API_KEY environment variable)
  • --naas-api-url: Naas API URL (default: https://api.naas.ai)

Example:

abi secrets naas list

abi secrets naas push-env-as-base64

Pushes a local .env file to Naas as a base64-encoded secret.

Options:

  • --naas-api-key: Naas API key (default: NAAS_API_KEY environment variable)
  • --naas-api-url: Naas API URL (default: https://api.naas.ai)
  • --naas-secret-name: Name for the secret in Naas (default: abi_secrets)
  • --env-file: Path to the environment file (default: .env.prod)

Example:

abi secrets naas push-env-as-base64 --env-file .env.prod

abi secrets naas get-base64-env

Retrieves a base64-encoded secret from Naas and displays it as environment variables.

Options:

  • --naas-api-key: Naas API key (default: NAAS_API_KEY environment variable)
  • --naas-api-url: Naas API URL (default: https://api.naas.ai)
  • --naas-secret-name: Name of the secret to retrieve (default: abi_secrets)

Example:

abi secrets naas get-base64-env

Script Execution

abi run script <path>

Runs a Python script in the context of a loaded ABI engine.

What it does:

  • Loads the ABI engine with all configured modules
  • Executes the specified Python script with access to the engine and all loaded modules

Example:

abi run script scripts/my_script.py

Architecture

The CLI is built using:

  • Click: For command-line interface framework
  • naas-abi-core: Core ABI engine and configuration management
  • naas-abi-marketplace: Marketplace modules and agents
  • naas-abi: Main ABI package

When run inside an ABI project, the CLI auto-detects the project root and re-runs itself in that project context via uv run --project ....

Project Structure

When you create a new project with abi new project, the CLI:

  1. Uses template files from cli/new/templates/project/
  2. Customizes templates with your project name
  3. Sets up proper Python package structure
  4. Sets up local deployment files from cli/deploy/templates/local/ (unless disabled)
  5. Installs all required dependencies via uv

Integration with ABI Framework

The CLI integrates seamlessly with the ABI ecosystem:

  • Engine Loading: Automatically loads modules and agents from your configuration
  • Configuration Management: Validates and renders YAML configuration files
  • Cloud Deployment: Handles Docker builds and Naas API interactions
  • Secret Management: Integrates with Naas secret storage for secure credential management

Dependencies

  • Python 3.10+
  • naas-abi>=1.0.6
  • naas-abi-core[qdrant]>=1.1.2
  • naas-abi-marketplace[ai-chatgpt]>=1.1.0
  • uv package manager (for dependency management)

See Also

Metadata

Release files for naas-abi-cli 3.3.4

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

Source distribution (sdist)

Source distribution for naas-abi-cli 3.3.4
File Size Uploaded Provenance Actions
naas_abi_cli-3.3.4.tar.gz 666.2 kB With provenance Details for naas_abi_cli-3.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for naas-abi-cli 3.3.4
File Interpreter ABI Platform Actions
naas_abi_cli-3.3.4-py3-none-any.whl Python 3 none any Details for naas_abi_cli-3.3.4-py3-none-any.whl

Total release size: 1.1 MB

Release files / naas_abi_cli-3.3.4.tar.gz

Download URL naas_abi_cli-3.3.4.tar.gz
Size 666.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e18a5013a2e76a3965c172e6061edd0f3326169987a6f83b50c1222bfa40462
BLAKE2b-256 checksum
How to use checksums
9193e4bdfe333f18cf6e33b19942f31031fc68f86807e42dd9b30c045e946fe0
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 Nov 18, 2026.

Transparency log

Release files / naas_abi_cli-3.3.4-py3-none-any.whl

Download URL naas_abi_cli-3.3.4-py3-none-any.whl
Size 421.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dbee36e095438687771a43723f861e3e68004f5e7a873d1800d9ded98c56671
BLAKE2b-256 checksum
How to use checksums
0a0ec21c0b2be23482258999f6931819280e2d976d94abc6417c8a4d7c6f770f
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 Nov 18, 2026.

Transparency log

Security for naas-abi-cli 3.3.4

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 naas_abi_cli-3.3.4.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 Nov 18, 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.

Release history Release notifications | RSS feed

This release

3.3.4 This release

2 release files Full provenance

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