> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/sdks-and-cli/cli.md).

# Norbix CLI

The **Norbix CLI** (`norbix`) manages your projects from the terminal. It is built on top of the official TypeScript SDK, so every command talks to the same API the SDKs do. Works on macOS, Linux and Windows (Node.js 18+).

Across the SDK reference, every method page has a **CLI** tab next to the language tabs — a dedicated command where one exists, or the `norbix api` escape hatch for everything else.

## Install

```sh
npm install -g @norbix.ai/cli

# or run without installing:
npx @norbix.ai/cli --help
```

Package: [`@norbix.ai/cli` on npm](https://www.npmjs.com/package/@norbix.ai/cli).

## Quick start

```sh
# 1. Log in (stores a token in your user config folder)
norbix login
# or with an API key:
norbix login --api-key nbk_4kX9mQvR2tYw7ZbC1dFgHj --project pr_7pW2sKvB9qLm3XcT1yRfGh

# 2. Check everything is wired up
norbix whoami

# 3. Use it
norbix db find orders --filter '{"status":"paid"}' --page-size 20
norbix logs list --level Error
norbix scheduler list
```

## Authentication: profiles and sessions

Two ways to authenticate, and they work together:

**Profiles (AWS-style)** — one INI file at `~/.norbix/config`:

```sh
norbix configure                      # writes the [default] profile
norbix configure --profile staging    # a named profile
norbix db find orders --profile staging
```

`norbix configure` asks for a service-user API key, project ID, optional account ID and environment (empty = PROD). A profile can also override the endpoints (`api_url` / `hub_url`) for localhost or self-hosted installs. `--profile` (or the `NORBIX_PROFILE` variable) always uses exactly that profile and ignores any login session — predictable for scripts and CI.

**Sessions** — `norbix login` stores a session in `~/.norbix/session.json`. While it is valid, every command in every terminal uses it. `norbix logout` removes it; profiles are untouched by login/logout.

## Commands

| Command                                                                                  | What it does                                                  |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `norbix login` / `logout` / `whoami`                                                     | Authenticate and inspect the current context                  |
| `norbix config list/get/set/unset`                                                       | Manage the local config file                                  |
| `norbix db find/get/count/insert/update/delete/aggregate`                                | Work with database collections                                |
| `norbix db schemas/taxonomies`                                                           | Inspect schemas and taxonomies                                |
| `norbix files list/info/upload/download/sign/delete`                                     | Upload, download and manage files                             |
| `norbix users list/get/invite/block/unblock/delete`                                      | Manage project users (Membership)                             |
| `norbix env list/use/delete`                                                             | Manage project environments                                   |
| `norbix logs list/trail`                                                                 | Read project logs, follow one correlation ID                  |
| `norbix scheduler list/get/enable/disable/delete`                                        | Manage scheduler tasks                                        |
| `norbix apikeys list/regenerate`                                                         | Show or regenerate project API keys                           |
| `norbix webhooks show/secret/enable/disable/remove`                                      | Inspect the webhook integration                               |
| `norbix email templates/template/clone/archive/unarchive/delete/campaigns/campaign/stop` | Email templates and campaigns                                 |
| `norbix push …` / `norbix sms …`                                                         | Push and SMS — same commands as email                         |
| `norbix account profile/status/usage/projects/team/regions/billing-portal`               | Account-level info                                            |
| `norbix payments integrations/triggers/trigger/enable/disable`                           | Payment integrations and triggers                             |
| `norbix integrations <module>`                                                           | List integrations of any module                               |
| `norbix module enable/disable <name>`                                                    | Turn a whole project module on or off                         |
| `norbix hub <module> <words…>`                                                           | Call ANY Hub endpoint with plain words (see below)            |
| `norbix api <module> <words…>`                                                           | Same for the data-plane API                                   |
| `norbix raw <path>`                                                                      | Low-level HTTP escape hatch (hub by default, `--api` for API) |
| `norbix autocomplete`                                                                    | Shell tab-completion (bash/zsh)                               |

Run `norbix <topic> --help` for flags and examples.

## Plain-word access to every endpoint

`norbix hub` and `norbix api` resolve SDK methods from plain words — every current and future SDK method is callable without waiting for a dedicated command:

```sh
norbix hub                                     # list modules
norbix hub database                            # list database methods
norbix hub database aggregates get             # plural  = list
norbix hub database aggregate get maggr_4kX9mQvR2tYw7ZbC1dFgHj   # singular = one item
norbix hub database aggregates delete maggr_4kX9mQvR2tYw7ZbC1dFgHj --schemaId sch_7pW2sKvB9qLm3XcT1yRfGh
norbix hub scheduler tasks get --pageSize 100
norbix hub email templates get                 # email/sms/push route into notifications
```

The first positional value becomes `id`; `--field value` flags become request fields. Destructive verbs (delete, remove, regenerate, …) ask for confirmation unless you pass `--yes`. Add `--dry-run` to preview the exact SDK call without sending it.

Across the SDK reference, the **CLI** tab uses this style everywhere. Endpoints whose request body is a nested object (for example saving a trigger) use `norbix raw` instead, because flag values are flat:

```sh
norbix raw '/{version}/membership/authentication' -X PUT --body '{...}'
norbix raw '/v2/logs/settings'            # hub by default; add --api for the data-plane API
```
