# CLI reference
Source: https://sovaria.in/docs/cli-reference

Install sov, sign in, choose a project, script it in CI with JSON output and exit codes — and find every command by area.

`sov` (version 0.11.0) is the Sovaria command line: sign in, pick a project, run SQL and migrations, deploy functions, manage storage, policies and keys, simulate access and restore earlier configuration — from your terminal or CI.

(Diagram: How sov works)

## Install

npm:
```bash
npm install -g @sovaria/cli
sov --version
```

pip:
```bash
pip install sovaria-cli
sov --version
```

pipx:
```bash
pipx install sovaria-cli
```

> **Note:** The CLI needs Python 3.11 or newer, however you install it. The npm package (`@sovaria/cli`) sets up a private Python environment in `~/.sovaria/npm-cli` the first time you run `sov`, using [uv](https://docs.astral.sh/uv/) when it is installed; `npx @sovaria/cli` works without installing. Set `SOVARIA_PYTHON` to pick a Python, or `SOVARIA_CLI_REINSTALL=1` to set it up again.

## Sign in and choose a project

1. **Sign in** — `sov login` opens the browser. Your session is stored in the system keyring.
```bash
sov login
sov whoami
```
2. **Pick the project commands act on** — Commands use your default organization and project. Set them once; override per command with `--org`, `--project` and `--env`.
```bash
sov projects <org-id>
sov scope pick        # or: sov scope set …
```
3. **Link a code folder** — `sov link` writes `sovaria.config.json`, which the SDKs and `sov` read in that folder.
```bash
cd my-app && sov link
```

## Output, scripting and CI

- Add `--json` to any command (or set `SOV_JSON=1`) for machine-readable output.
- In CI the CLI reads a token from `SOVARIA_ACCESS_TOKEN` (or a project key from `SOVARIA_API_KEY`) instead of the keyring; pass `--org` and `--project` explicitly.
- Commands that check something (`sov sim run`, `sov sim change`) take `--fail-on` and exit with status 1 when they find problems at that level.
- Use `--profile <name>` to keep several accounts side by side. A saved login is only sent to the API host it was made on. With no `~/.sovaria/config.yaml`, `sov login` says it is signing in to Sovaria Cloud, and from a script (no terminal, or `SOVARIA_PASSWORD`) it refuses until you name the target with `--profile prod` or `SOVARIA_PROFILE`.

## Everyday commands

### sov login
`sov login [OPTIONS]`
Authenticate with Sovaria.
By default opens a browser (PKCE flow). Pass --email to use password login (prompt or SOVARIA_PASSWORD).

### sov logout
`sov logout [OPTIONS]`
Revoke the session for one profile, then clear that profile's local credentials.

### sov whoami
`sov whoami [OPTIONS]`
Print the authenticated user, active scope, and accessible orgs/projects.

### sov orgs
`sov orgs [OPTIONS]`
Your organisations: list (default) and get (with the default region)

### sov orgs list
`sov orgs list [OPTIONS]`
List organisations visible to the authenticated user.

### sov orgs get
`sov orgs get [OPTIONS] ORG_ID`
An organisation, with its default region (where new projects go unless you pick one).

### sov projects
`sov projects [OPTIONS]`
Projects: list (default) and create (in the org's default region unless --region)

### sov projects list
`sov projects list [OPTIONS] [ORG_ID]`
List projects under an organisation.

### sov projects delete
`sov projects delete [OPTIONS] PROJECT_ID`
Delete a project.
It leaves every list at once and can be restored for the plan's recovery days (`sov projects restore`); after that its databases, files, functions and logs are purged in every service.

### sov projects restore
`sov projects restore [OPTIONS] PROJECT_ID`
Bring back a deleted project within its recovery window (if the plan still has room for it).

### sov projects create
`sov projects create [OPTIONS] NAME`
Create a cloud project: the project, its primary environment and its database (like the console).

### sov connect
`sov connect [OPTIONS]`
Show everything you need to connect an app (like console Connect panel).

### sov init
`sov init [OPTIONS]`
Interactive project bootstrap

### sov link
`sov link [OPTIONS]`
Link local directory to a Sovaria project

### sov dashboard
`sov dashboard [OPTIONS]`
Project overview dashboard

### sov shell
`sov shell [OPTIONS]`
Interactive Sovaria REPL

### sov test
`sov test [OPTIONS]`
Run integration tests and smoke checks

### sov api call
`sov api call [OPTIONS] METHOD PATH`
Call any gateway endpoint directly.

## Commands by area

- [Accounts, projects and access](https://sovaria.in/docs/cli-auth-and-projects): Sign in, pick the organization and project commands act on, manage team members, roles, app users, auth settings, SCIM provisioning, blocking auth hooks and API keys.
- [Database, documents and schema](https://sovaria.in/docs/cli-database): Run SQL, manage tables and migrations and environments (with a sample of the data), apply app templates, check app builds and open them as pull requests, read and write documents, inspect the schema and generate types.
- [Functions, flows, cron jobs, queues, hosting and secrets](https://sovaria.in/docs/cli-functions): Deploy, invoke, version, promote and roll back edge functions, read their logs, build and run flows (automations), schedule cron jobs (functions, HTTPS, SQL), work with message queues, deploy web sites, and manage function secrets.
- [Storage](https://sovaria.in/docs/cli-storage): Create and configure buckets, upload, download, list, move and delete objects, and sign URLs.
- [Realtime and messaging](https://sovaria.in/docs/cli-realtime): Turn live change events for tables on and off, publish to channels, see presence, replay messages and manage end-to-end encryption keys, and send push and email to app users (templates, audiences, sends).
- [Analytics, remote config, experiments and tester builds](https://sovaria.in/docs/cli-app-growth): Read product analytics (active users, events, funnels, retention) and export events, manage remote config and feature flags as a file in git, run A/B experiments, and send test builds to testers.
- [Policies, rules tests, simulation, audit and compliance](https://sovaria.in/docs/cli-security): Manage access policies, test who can do what with rules tests, run access simulations and change previews (with CI exit codes), read the audit trail, and download your organization's compliance evidence pack.
- [Version history](https://sovaria.in/docs/cli-version-history): Read the project configuration at any point in time, restore it, and manage timelines and snapshots.
- [Logs, metrics, alerts, crashes, vectors and AI tools](https://sovaria.in/docs/cli-logs-and-ai): Read logs, request metrics and per-route latency, manage SLO alerts and crash reports, work with vectors, knowledge bases (RAG) and embeddings, talk to your agents, and connect AI assistants over MCP.
- [Import from Supabase, Firebase, Convex or Postgres](https://sovaria.in/docs/cli-import): Move a Supabase, Firebase, Convex, Neon or other Postgres project to Sovaria with sov import: schema and rules, users with their passwords, data, documents, files, and a report.
- [Billing and databases](https://sovaria.in/docs/cli-billing-and-infrastructure): Read plans, subscriptions and usage, and manage your project databases (backups, pause, resume, resize).
