Skip to content

CLI Reference

Installing Ciaren (pip install ciaren, or pip install -e . from a source checkout) adds the ciaren command, which runs and configures the server. It uses only the standard library, so it needs nothing extra.

bash
ciaren --help
ciaren --version

ciaren serve

Run the API server, the editor, and the background scheduler in one process, with no broker or extra services. This is the recommended way to start Ciaren.

bash
ciaren serve
ciaren serve --port 8001 --reload
ciaren serve --engine pandas --execution-mode process
ciaren serve --no-scheduler
FlagDefaultDescription
--host127.0.0.1Bind host
--port8055Bind port
--reloadoffAuto-reload on code changes (development only)
--db-urlNoneAsync database URL; overrides CIAREN_DATABASE_URL
--data-dirNoneUploads/outputs directory; overrides CIAREN_DATA_DIR
--engineNoneDefault engine polars | pandas; overrides CIAREN_DEFAULT_ENGINE
--execution-modeNonethread | process; overrides CIAREN_EXECUTION_MODE
--log-levelNoneuvicorn log level (critical…trace)
--no-scheduleroffStart the API without the background scheduler
--no-demooffSkip seeding the built-in Demo project on first boot
--run-seed-flowsoffRun every newly seeded demo flow once after first-boot seeding
--env-fileNoneLoad environment variables from this file before resolving settings

Flags become the matching environment variables before the app loads, so they win over your .env file and the shell.

Pointing at a specific env file

By default Ciaren reads ./.env. Use --env-file to load a different file (for example a per-environment config) before settings are resolved:

bash
ciaren serve --env-file /etc/ciaren/production.env

Precedence is flags > environment variables already set in your shell > --env-file > defaults, so the file never overrides what you exported. The same flag works on ciaren info, ciaren check, and ciaren db, which lets you inspect or validate a specific config:

bash
ciaren info  --env-file /etc/ciaren/production.env
ciaren check --env-file /etc/ciaren/production.env

ciaren init

Write a commented starter .env to get going quickly.

bash
ciaren init                 # writes ./.env
ciaren init --path .env.local
ciaren init --force         # overwrite an existing file
ciaren init --no-ml         # skip provisioning the default local MLflow directory

ciaren info

Print the resolved configuration the server would use, with the database password redacted. It shows the environment-level result only: values overridden on the Settings page live in the database and win once the server is running.

bash
ciaren info
text
Ciaren resolved configuration:
  environment          development
  database_url         sqlite+aiosqlite:///./ciaren.db
  data_dir             /path/to/.data
  default_engine       polars
  execution_mode       thread
  scheduler_enabled    True
  ...

ciaren check

Validate the environment and exit non-zero on failure, which suits setup scripts and CI. It checks that:

  • the data directory is writable,
  • the database URL uses an async driver,
  • the database is reachable,
  • the dataframe engines are importable,
  • the ML libraries import when ML is enabled, and
  • (Windows) the MLflow tracking path is short enough to log models under the 260-character path limit; see the ml_path line below.
bash
ciaren check
text
[ok]   data_dir: /path/to/.data
[ok]   async_driver: sqlite+aiosqlite:///./ciaren.db
[ok]   database: reachable
[ok]   engines: pandas, polars
[ok]   ml: enabled, tracking=./mlruns

All checks passed.

Windows MLflow path check

On Windows without long-path support, a deeply nested mlruns directory can push MLflow's model-artifact paths past the 260-character limit, and a training node then fails because the model cannot be saved. When the tracking store is a local folder, ciaren check adds an ml_path line: [ok] when the path has room, or a non-fatal [warn] telling you to enable long paths or set a shorter CIAREN_MLFLOW_TRACKING_URI. See Troubleshooting.

Both info and check accept --output json for scripting and CI:

bash
ciaren info --output json
ciaren check --output json   # {"ok": true, "checks": [...]}; exit 1 on failure

ciaren db

Manage the database schema through Alembic migrations, which version the schema and apply changes in order on SQLite, PostgreSQL, and MySQL.

bash
ciaren db upgrade            # apply all migrations up to the latest revision
ciaren db upgrade --revision <id>
ciaren db current            # show the revision the database is stamped at
ciaren db reset --yes        # DROP every table and rebuild from migrations
SubcommandDescription
upgradeApply migrations up to --revision (default head). Safe to re-run.
currentPrint the revision the database is currently at.
resetDestructive. Drop all tables and rebuild. Requires --yes; refuses when CIAREN_ENVIRONMENT=production unless --force.

All three accept --env-file so you can target a specific environment's config.

Upgrading an existing database is safe

ciaren serve creates any missing tables on startup, so an existing Ciaren database has the full schema but no migration history. The first ciaren db upgrade detects this and adopts the schema (records the current revision) instead of trying to re-create existing tables, so adopting Alembic never destroys or rewrites your data. From then on, upgrades apply only the new migrations.

`db reset` deletes all data

reset drops every table. It exists for local development and test environments. It refuses to run in production unless you pass --force.

Deploy flow

  1. Set CIAREN_DATABASE_URL to your async PostgreSQL or MySQL URL.
  2. Run ciaren db upgrade on each deploy, before you start the app.
  3. Start the server with ciaren serve.

ciaren transformations

List the transformation node types the engine supports, the same set the editor offers.

bash
ciaren transformations list
ciaren transformations list --output json
text
66 transformation node types:
  assertExpression   inputs=1
  assertNotNull      inputs=1
  assertRowCount     inputs=1
  ...

ciaren flow

Validate and migrate .flow document files, the portable, versioned description of a flow. In CI, this catches a malformed or outdated file before you import it.

bash
ciaren flow validate project.flow              # schema + graph structure
ciaren flow validate project.flow --output json
ciaren flow migrate  project.flow              # print the document migrated to the current schema version
ciaren flow migrate  project.flow --to 1.0.0   # target a specific schema version instead of the latest
ciaren flow migrate  project.flow --write      # write back (keeps a .bak)
SubcommandDescription
validateValidate document shape and graph structure. Exits non-zero (and prints INVALID) on failure.
migrateMigrate to a newer schema version (default: the latest this build supports; --to VERSION targets a specific one). Prints to stdout unless --write.

migrate --write saves a .bak copy of the original next to the file before it writes the migrated version.

ciaren secret

Manage connection secrets in the OS keychain (Windows Credential Manager, macOS Keychain, or Secret Service on Linux desktops), the recommended secret source on a desktop install. Keychain support is part of the base install.

bash
ciaren secret set pg-main      # prompts for the value (hidden, confirmed)
ciaren secret unset pg-main    # removes it from the keychain

Headless servers and containers have no keychain daemon; use env: or file: references there.

A connection's secret field refers to the stored secret as keyring:pg-main. The value never touches Ciaren's database, the API, or your shell history. See Connection secrets for the three reference types (env:, keyring:, file:).

Plugin tooling: ciaren-plugin

Installing, inspecting, and signing plugins is a separate command, ciaren-plugin, installed with the same package. See the Plugin CLI Reference for every subcommand and Packaging & Distribution for the publishing workflow.

bash
ciaren-plugin list                          # discovered plugins + status
ciaren-plugin install my-plugin.ciarenplugin    # verify + install
ciaren-plugin enable acme.myplugin

Running the old ciaren plugin ... form prints a pointer to the new command.

Environment variables

Every setting is a CIAREN_* environment variable, read from the shell or a .env file in the directory you run the command from. Each variable, with its default, is in the Configuration Reference. Advanced Setup explains which source wins.

Async driver required

CIAREN_DATABASE_URL must use an async driver: sqlite+aiosqlite://, postgresql+asyncpg://, or mysql+aiomysql://. ciaren check flags a non-async URL.

See also