Critical Rules
Always use -f (force) flag. Every enonic command that accepts -f must include it. This prevents interactive prompts that block automation. The only exception is enonic cloud login (browser-based OAuth).
Local vs remote commands:
- Local commands run against files on disk — no auth needed:
project *, sandbox *, create, dev, latest, upgrade, uninstall.
- Remote commands talk to a running XP instance via management API — auth required:
snapshot *, dump *, export, import, app *, repo *, cms *, auditlog *, vacuum.
system info uses the info port (2609) — no auth.
project install is a local build + remote install hybrid — auth required.
Management port is 4848, not 8080. The CLI talks to the management API on port 4848. Port 8080 is the web/content API. Never use 8080 for CLI remote operations.
.enonic file — project create writes a .enonic file in the project root linking it to a sandbox. Commands like project deploy and dev use this automatically.
Command aliases:
enonic create = simplified enonic project create
enonic dev = enonic project dev
sandbox ls = sandbox list
dump ls = dump list
snapshot ls = snapshot list
repo ls = repo list
Command Syntax
enonic <group> <action> [positional-args] [flags]
Groups: project, sandbox, snapshot, dump, app, repo, cms, system, auditlog, cloud.
Standalone: create, dev, export, import, vacuum, latest, upgrade, uninstall.
Auth Flags (Remote Commands)
| Method |
Flags |
When to use |
| Basic auth |
-a user:password |
XP < 7.15 or quick local testing |
| Service account key |
--cred-file path/to/key.json |
XP 7.15+ / CI/CD (preferred) |
| Mutual TLS |
--client-cert cert.pem --client-key key.pem |
Zero-trust environments |
Priority: flags → environment variables → no auth. See references/auth-and-env.md for details.
Environment Variables
| Variable |
Default |
Purpose |
ENONIC_CLI_REMOTE_URL |
localhost:4848 |
Management API endpoint |
ENONIC_CLI_REMOTE_USER |
— |
Basic auth user |
ENONIC_CLI_REMOTE_PASS |
— |
Basic auth password |
ENONIC_CLI_CRED_FILE |
— |
Service account key file path |
ENONIC_CLI_CLIENT_KEY |
— |
mTLS private key path |
ENONIC_CLI_CLIENT_CERT |
— |
mTLS client cert path |
ENONIC_CLI_HTTP_PROXY |
— |
HTTP proxy URL |
ENONIC_CLI_HOME_PATH |
~/.enonic |
CLI home directory |
Project Commands
All run from the project root directory.
| Command |
Description |
Key flags |
project create [name] |
Create project from starter |
-r <repo>, -s <sandbox>, -v <version>, --prod, --skip-start |
project sandbox [name] |
Set project's default sandbox |
— |
project build |
Build via Gradle |
— |
project clean |
Clean build artifacts |
— |
project test |
Run tests via Gradle |
— |
project deploy [sandbox] |
Build + deploy to sandbox |
--prod, --debug, -c (continuous), --skip-start |
project install |
Build + install to running XP |
Auth flags required |
project shell |
Open shell with XP env vars set |
No -f needed |
project gradle [args] |
Run arbitrary Gradle tasks |
Forwards all args to gradlew |
project env |
Export JAVA_HOME + XP_HOME |
Use with eval $(...) |
enonic create [name] is a shorthand for project create with sensible defaults.
enonic dev starts hot-reload mode (sandbox detached, watches source files, exit with Ctrl-C).
Sandbox Commands
| Command |
Description |
Key flags |
sandbox create [name] |
Create new sandbox |
-v <version>, -t <template>, --skip-template, --prod, --skip-start |
sandbox list |
List all sandboxes |
— |
sandbox start [name] |
Start sandbox |
--prod, --debug, -d (detach), --http.port <port> |
sandbox stop |
Stop running sandbox |
— |
sandbox upgrade [name] |
Upgrade XP version (no downgrade) |
-v <version> |
sandbox delete [name] |
Delete sandbox and data |
— |
sandbox copy [src] [dst] |
Clone sandbox |
— |
Only one sandbox can run at a time. Default start mode is development.
Data Commands
Export / Import
enonic export -t <name> --path <repo:branch:path> -f
enonic import -t <name> --path <repo:branch:path> -f
Path format: repo:branch:path — e.g. cms-repo:draft:/content/my-site
| Command |
Key flags |
Notes |
export |
-t <name>, --path, --skip-ids, --skip-versions, --dry |
Auth required. Output in $XP_HOME/data/export/ |
import |
-t <name>, --path, --xsl-source, --xsl-param key=val, --skip-ids, --skip-permissions, --dry |
Auth required |
Snapshots
| Command |
Key flags |
Notes |
snapshot create |
-r <repo> (omit for all) |
Online operation, no downtime |
snapshot ls |
— |
Shows all snapshots with status |
snapshot restore |
--snap <name>, --repo <name>, --clean |
--clean deletes indices first |
snapshot delete |
--snap <name>, -b <date> |
Date format: 2 Jan 06 |
All snapshot commands require auth.
Dumps
| Command |
Key flags |
Notes |
dump create |
-d <name>, --skip-versions, --max-version-age <days>, --max-versions <n>, --archive |
Full system export |
dump upgrade |
-d <name> |
Output: <name>_upgraded_<version> |
dump ls |
— |
List all dumps |
dump load |
-d <name>, --upgrade, --archive |
Deletes existing repos before loading |
All dump commands require auth. Dumps are stored in $XP_HOME/data/dump/.
Warning: dump load replaces all existing repositories. Always create a backup first.
Server Commands
App
| Command |
Description |
Key flags |
app install |
Install app on all nodes |
--url <address> or --file <path> (--file takes precedence) |
app start <key> |
Start installed app |
App key, e.g. com.enonic.myapp |
app stop <key> |
Stop running app |
App key |
Repository
| Command |
Description |
Key flags |
repo reindex |
Rebuild search indices |
-r <repo>, -b <branches> (comma-separated), -i (recreate indices) |
repo readonly <bool> |
Toggle write protection |
-r <repo> (omit for all) |
repo replicas <1-99> |
Set cluster replica count |
— |
repo list |
List repositories |
— |
CMS
| Command |
Description |
Key flags |
cms reprocess |
Reprocess content metadata |
--path <branch:path>, --skip-children |
Typically used after content migration. Path format is branch:path (no repo prefix).
System
| Command |
Description |
Notes |
system info |
Show XP instance info |
Uses info port 2609, no auth needed |
Audit Log
| Command |
Description |
Key flags |
auditlog cleanup |
Remove old audit records |
--age <ISO-8601> (e.g. P30D, P1DT12H) |
Vacuum
enonic vacuum [-b] [-t <ISO-8601-duration>] -f
Purges node versions older than threshold (default P21D = 21 days). -b also removes unused binary blobs. Incompatible with snapshots older than the threshold.
Cloud Commands
| Command |
Description |
Notes |
cloud login |
Login via browser OAuth |
Interactive — no -f flag. Supports -qr for mobile. |
cloud logout |
Log out |
— |
cloud app install |
Install JAR to cloud |
-j <jar-path> (default: ./build/libs/*.jar), -t <timeout>, -y (skip confirm) |
Cloud login is the only interactive command. It opens a browser for OAuth. Cannot be automated.
CLI Maintenance
| Command |
Description |
enonic latest |
Show latest available CLI version |
enonic upgrade |
Upgrade CLI to latest version |
enonic uninstall |
Remove CLI from system |
File Locations
| Item |
Path |
| CLI home |
~/.enonic/ |
| Sandboxes |
~/.enonic/sandboxes/<name>/ |
| Cloud auth |
~/.enonic/cloud/ |
| Dumps |
$XP_HOME/data/dump/ |
| Exports |
$XP_HOME/data/export/ |
| Snapshots |
$XP_HOME/snapshots/ |
| Project config |
<project-root>/.enonic |
Common Patterns
# Create project with specific starter and sandbox
enonic project create my-app -r starter-vanilla -s my-sandbox -f
# Build and install to remote server
ENONIC_CLI_REMOTE_URL="server:4848" enonic project install -a su:password -f
# Export content tree
enonic export -t site-backup --path cms-repo:draft:/content/my-site -a su:password -f
# Full backup with dump
enonic dump create -d nightly --skip-versions -a su:password -f
# Reindex repository after schema changes
enonic repo reindex -r cms-repo -b draft,master -i -a su:password -f
# Vacuum + audit log cleanup (maintenance)
enonic vacuum -b -t P30D -a su:password -f
enonic auditlog cleanup --age P90D -a su:password -f
Reference Files
| File |
Content |
references/commands.md |
Full flag tables for every command |
references/auth-and-env.md |
Auth methods, env vars, ports, CI/CD patterns |
references/workflows.md |
Multi-step recipes for common operations |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: enonic-ai-agents-skills-enonic-cli3description: Critical Rules4---56## Critical Rules781. **Always use `-f` (force) flag.** Every `enonic` command that accepts `-f` must include it. This prevents interactive prompts that block automation. The only exception is `enonic cloud login` (browser-based OAuth).9102. **Local vs remote commands:**11 - **Local commands** run against files on disk — no auth needed: `project *`, `sandbox *`, `create`, `dev`, `latest`, `upgrade`, `uninstall`.12 - **Remote commands** talk to a running XP instance via management API — auth required: `snapshot *`, `dump *`, `export`, `import`, `app *`, `repo *`, `cms *`, `auditlog *`, `vacuum`.13 - `system info` uses the info port (2609) — no auth.14 - `project install` is a local build + remote install hybrid — auth required.15163. **Management port is 4848, not 8080.** The CLI talks to the management API on port 4848. Port 8080 is the web/content API. Never use 8080 for CLI remote operations.17184. **`.enonic` file** — `project create` writes a `.enonic` file in the project root linking it to a sandbox. Commands like `project deploy` and `dev` use this automatically.19205. **Command aliases:**21 - `enonic create` = simplified `enonic project create`22 - `enonic dev` = `enonic project dev`23 - `sandbox ls` = `sandbox list`24 - `dump ls` = `dump list`25 - `snapshot ls` = `snapshot list`26 - `repo ls` = `repo list`2728## Command Syntax2930```31enonic <group> <action> [positional-args] [flags]32```3334Groups: `project`, `sandbox`, `snapshot`, `dump`, `app`, `repo`, `cms`, `system`, `auditlog`, `cloud`.35Standalone: `create`, `dev`, `export`, `import`, `vacuum`, `latest`, `upgrade`, `uninstall`.3637## Auth Flags (Remote Commands)3839| Method | Flags | When to use |40|--------|-------|-------------|41| Basic auth | `-a user:password` | XP < 7.15 or quick local testing |42| Service account key | `--cred-file path/to/key.json` | XP 7.15+ / CI/CD (preferred) |43| Mutual TLS | `--client-cert cert.pem --client-key key.pem` | Zero-trust environments |4445Priority: flags → environment variables → no auth. See `references/auth-and-env.md` for details.4647## Environment Variables4849| Variable | Default | Purpose |50|----------|---------|---------|51| `ENONIC_CLI_REMOTE_URL` | `localhost:4848` | Management API endpoint |52| `ENONIC_CLI_REMOTE_USER` | — | Basic auth user |53| `ENONIC_CLI_REMOTE_PASS` | — | Basic auth password |54| `ENONIC_CLI_CRED_FILE` | — | Service account key file path |55| `ENONIC_CLI_CLIENT_KEY` | — | mTLS private key path |56| `ENONIC_CLI_CLIENT_CERT` | — | mTLS client cert path |57| `ENONIC_CLI_HTTP_PROXY` | — | HTTP proxy URL |58| `ENONIC_CLI_HOME_PATH` | `~/.enonic` | CLI home directory |5960## Project Commands6162All run from the project root directory.6364| Command | Description | Key flags |65|---------|-------------|-----------|66| `project create [name]` | Create project from starter | `-r <repo>`, `-s <sandbox>`, `-v <version>`, `--prod`, `--skip-start` |67| `project sandbox [name]` | Set project's default sandbox | — |68| `project build` | Build via Gradle | — |69| `project clean` | Clean build artifacts | — |70| `project test` | Run tests via Gradle | — |71| `project deploy [sandbox]` | Build + deploy to sandbox | `--prod`, `--debug`, `-c` (continuous), `--skip-start` |72| `project install` | Build + install to running XP | Auth flags required |73| `project shell` | Open shell with XP env vars set | No `-f` needed |74| `project gradle [args]` | Run arbitrary Gradle tasks | Forwards all args to gradlew |75| `project env` | Export JAVA_HOME + XP_HOME | Use with `eval $(...)` |7677`enonic create [name]` is a shorthand for `project create` with sensible defaults.78`enonic dev` starts hot-reload mode (sandbox detached, watches source files, exit with Ctrl-C).7980## Sandbox Commands8182| Command | Description | Key flags |83|---------|-------------|-----------|84| `sandbox create [name]` | Create new sandbox | `-v <version>`, `-t <template>`, `--skip-template`, `--prod`, `--skip-start` |85| `sandbox list` | List all sandboxes | — |86| `sandbox start [name]` | Start sandbox | `--prod`, `--debug`, `-d` (detach), `--http.port <port>` |87| `sandbox stop` | Stop running sandbox | — |88| `sandbox upgrade [name]` | Upgrade XP version (no downgrade) | `-v <version>` |89| `sandbox delete [name]` | Delete sandbox and data | — |90| `sandbox copy [src] [dst]` | Clone sandbox | — |9192Only one sandbox can run at a time. Default start mode is development.9394## Data Commands9596### Export / Import9798```99enonic export -t <name> --path <repo:branch:path> -f100enonic import -t <name> --path <repo:branch:path> -f101```102103**Path format:** `repo:branch:path` — e.g. `cms-repo:draft:/content/my-site`104105| Command | Key flags | Notes |106|---------|-----------|-------|107| `export` | `-t <name>`, `--path`, `--skip-ids`, `--skip-versions`, `--dry` | Auth required. Output in `$XP_HOME/data/export/` |108| `import` | `-t <name>`, `--path`, `--xsl-source`, `--xsl-param key=val`, `--skip-ids`, `--skip-permissions`, `--dry` | Auth required |109110### Snapshots111112| Command | Key flags | Notes |113|---------|-----------|-------|114| `snapshot create` | `-r <repo>` (omit for all) | Online operation, no downtime |115| `snapshot ls` | — | Shows all snapshots with status |116| `snapshot restore` | `--snap <name>`, `--repo <name>`, `--clean` | `--clean` deletes indices first |117| `snapshot delete` | `--snap <name>`, `-b <date>` | Date format: `2 Jan 06` |118119All snapshot commands require auth.120121### Dumps122123| Command | Key flags | Notes |124|---------|-----------|-------|125| `dump create` | `-d <name>`, `--skip-versions`, `--max-version-age <days>`, `--max-versions <n>`, `--archive` | Full system export |126| `dump upgrade` | `-d <name>` | Output: `<name>_upgraded_<version>` |127| `dump ls` | — | List all dumps |128| `dump load` | `-d <name>`, `--upgrade`, `--archive` | **Deletes existing repos** before loading |129130All dump commands require auth. Dumps are stored in `$XP_HOME/data/dump/`.131132**Warning:** `dump load` replaces all existing repositories. Always create a backup first.133134## Server Commands135136### App137138| Command | Description | Key flags |139|---------|-------------|-----------|140| `app install` | Install app on all nodes | `--url <address>` or `--file <path>` (`--file` takes precedence) |141| `app start <key>` | Start installed app | App key, e.g. `com.enonic.myapp` |142| `app stop <key>` | Stop running app | App key |143144### Repository145146| Command | Description | Key flags |147|---------|-------------|-----------|148| `repo reindex` | Rebuild search indices | `-r <repo>`, `-b <branches>` (comma-separated), `-i` (recreate indices) |149| `repo readonly <bool>` | Toggle write protection | `-r <repo>` (omit for all) |150| `repo replicas <1-99>` | Set cluster replica count | — |151| `repo list` | List repositories | — |152153### CMS154155| Command | Description | Key flags |156|---------|-------------|-----------|157| `cms reprocess` | Reprocess content metadata | `--path <branch:path>`, `--skip-children` |158159Typically used after content migration. Path format is `branch:path` (no repo prefix).160161### System162163| Command | Description | Notes |164|---------|-------------|-------|165| `system info` | Show XP instance info | Uses info port 2609, no auth needed |166167### Audit Log168169| Command | Description | Key flags |170|---------|-------------|-----------|171| `auditlog cleanup` | Remove old audit records | `--age <ISO-8601>` (e.g. `P30D`, `P1DT12H`) |172173### Vacuum174175```176enonic vacuum [-b] [-t <ISO-8601-duration>] -f177```178179Purges node versions older than threshold (default `P21D` = 21 days). `-b` also removes unused binary blobs. Incompatible with snapshots older than the threshold.180181## Cloud Commands182183| Command | Description | Notes |184|---------|-------------|-------|185| `cloud login` | Login via browser OAuth | **Interactive — no `-f` flag.** Supports `-qr` for mobile. |186| `cloud logout` | Log out | — |187| `cloud app install` | Install JAR to cloud | `-j <jar-path>` (default: `./build/libs/*.jar`), `-t <timeout>`, `-y` (skip confirm) |188189**Cloud login is the only interactive command.** It opens a browser for OAuth. Cannot be automated.190191## CLI Maintenance192193| Command | Description |194|---------|-------------|195| `enonic latest` | Show latest available CLI version |196| `enonic upgrade` | Upgrade CLI to latest version |197| `enonic uninstall` | Remove CLI from system |198199## File Locations200201| Item | Path |202|------|------|203| CLI home | `~/.enonic/` |204| Sandboxes | `~/.enonic/sandboxes/<name>/` |205| Cloud auth | `~/.enonic/cloud/` |206| Dumps | `$XP_HOME/data/dump/` |207| Exports | `$XP_HOME/data/export/` |208| Snapshots | `$XP_HOME/snapshots/` |209| Project config | `<project-root>/.enonic` |210211## Common Patterns212213```bash214# Create project with specific starter and sandbox215enonic project create my-app -r starter-vanilla -s my-sandbox -f216217# Build and install to remote server218ENONIC_CLI_REMOTE_URL="server:4848" enonic project install -a su:password -f219220# Export content tree221enonic export -t site-backup --path cms-repo:draft:/content/my-site -a su:password -f222223# Full backup with dump224enonic dump create -d nightly --skip-versions -a su:password -f225226# Reindex repository after schema changes227enonic repo reindex -r cms-repo -b draft,master -i -a su:password -f228229# Vacuum + audit log cleanup (maintenance)230enonic vacuum -b -t P30D -a su:password -f231enonic auditlog cleanup --age P90D -a su:password -f232```233234## Reference Files235236| File | Content |237|------|---------|238| `references/commands.md` | Full flag tables for every command |239| `references/auth-and-env.md` | Auth methods, env vars, ports, CI/CD patterns |240| `references/workflows.md` | Multi-step recipes for common operations |241242---243> Converted and distributed by [TomeVault](https://tomevault.io/claim/enonic) — claim your Tome and manage your conversions.244<!-- tomevault:4.0:skill_md:2026-04-14 -->