Skip to content

Command reference ​

This page defines the implemented v0.1.10 command surface. Dopbase does not infer a project or environment from the current directory. Management commands receive an environment reference directly. run may use a server-scoped default from the user configuration.

For a compact table of every command, command-specific option, and example, see the CLI cheat sheet.

Connections and authentication ​

CommandPurpose
dopbase server setupInitialize local storage and root
dopbase server setup --webRun existing browser setup
dopbase server startRun the server in the foreground
dopbase server start --backgroundStart the server in the background
dopbase server restartRestart the background server
dopbase server stopStop the background server
dopbase server statusCheck the local server process
dopbase server logsRead background server logs
dopbase client connect <server-url>Validate and save another server
dopbase client connect localReturn to the implicit local server
dopbase loginSign in or save a runner token
dopbase logoutRemove the active saved credential
dopbase client statusShow safe effective client settings
dopbase statusAlias for dopbase client status
dopbase updateCheck GitHub for a newer release
dopbase admin reset-password <email>Reset a user password offline
dopbase admin factory-resetReset the local instance offline

When no server is configured, client commands use http://localhost:8840. client connect validates a new endpoint, asks for interactive confirmation, stops the current managed background server when present, deletes the previous encrypted CLI session, clears the saved default environment, and then saves the new endpoint. A foreground server must first be stopped with Ctrl+C. It does not select a project or environment, stop remote or unrelated local servers, or revoke browser sessions.

Server setup ​

Use dopbase server setup for optional standalone terminal initialization. It prompts for the root email, a masked password of 12 to 128 characters, and confirmation when no email default is supplied. --email EMAIL or DOPBASE_ROOT_EMAIL generates a password and prints it once without prompting; this mode also supports global --json. Explicit --email takes precedence.

Setup accepts --config and --master-key-file with global --data-dir, rejects --server, and leaves the server stopped. It creates no client session and does not change the selected client endpoint. dopbase init remains the project and environment workflow.

server setup --web starts the existing foreground web flow, including backup restore. It accepts the foreground listener options listed below, continues serving after setup, and stops with Ctrl+C. --email or DOPBASE_ROOT_EMAIL prefills the email through the printed setup link. Web setup rejects --json. Listener options require --web when used with setup. See server setup for output, recovery, and instance selection.

Server lifecycle ​

Fresh startup enters existing web setup, or creates root with a generated password when DOPBASE_ROOT_EMAIL is supplied. Existing instances preserve credentials. With the web UI disabled and no email, complete CLI setup first. Interrupted factory resets also require explicit setup. server start stays attached to the terminal and stops with Ctrl+C. On macOS and Linux, server start --background starts a managed background process. Use server stop to stop it, server status to inspect it, and server logs to read its output. server restart restarts a running background server with its saved CLI and environment overrides while rereading configuration. It accepts --timeout (default 10 seconds). Stop and start again to change explicit launch overrides. See server lifecycle for options, migration steps, and examples.

server start accepts these options in either mode:

OptionPurpose
--background, -bRun a managed background server
--config <FILE>Read a different server configuration file
--host <HOST>Bind to an IP address, default 127.0.0.1
--port <PORT>Listen on a port, default 8840
--public-url <URL>Set the URL clients use to reach the server
--shutdown-grace-seconds <SECONDS>Set the request-drain timeout
--no-web-uiDisable the web UI for server start
--docs / --no-docsEnable or disable API documentation
--master-key-file <FILE>Read the master key from another file

server stop --timeout <SECONDS> waits 10 seconds by default. server logs accepts --lines <COUNT> (default 100), --watch or -w, and --clean. --clean --watch clears the existing log before waiting for new output.

server up and server down have been replaced by server start --background and server stop. The old commands show an informational migration notice and exit with status 1 without starting or stopping a server.

The old top-level serve, serve --background, and stop commands are not supported. Use server start, server start --background, and server stop respectively.

Check for updates ​

dopbase update compares the running version against the latest release tag on GitHub. It is informational only and never modifies the binary:

text
dopbase 0.1.10 is up to date (latest release 0.1.10).

When a newer release exists, the command prints the current version, the latest version, and the release URL. Stop every running Dopbase server, then install the release with:

sh
curl -fsSL https://dopbase.com/install.sh | sh

The command exits with status 0 whether or not an update is available, and with status 1 when the release cannot be queried. Run it with --json for automation. No other command contacts GitHub.

The server resolution order is:

  1. A global --server <url> argument
  2. DOPBASE_URL
  3. The endpoint saved by dopbase client connect
  4. http://localhost:8840

dopbase login asks for an email and password, or, when the server has single sign-on on, prints a link and a code to approve in the Admin UI. --browser always uses the Admin UI and prints the link for you to copy, --browser-open also opens it in this machine's browser, and --password always uses the prompt. See browser login.

Machine runners can save an encrypted credential with dopbase login --token. CI systems and deployment platforms should inject DOPBASE_TOKEN from their secret store. Authentication uses DOPBASE_TOKEN, then the encrypted credential saved by login. A saved credential is used only when it matches the resolved server. An invalid environment credential never falls back to the saved one.

dopbase client status displays the config path, resolved server and its source, authentication source, locally identified credential type, login email, and the saved default environment. It performs a short health check and reports connected (live) or offline (cache) without failing when the server is unavailable. It never displays token contents. See client configuration for the TOML schema and override behavior.

Environment references ​

Every environment belongs to one project, so an environment reference contains all the context needed by secret, import, export, token, and run commands.

Commands accept these forms:

text
env_482731                       # Immutable environment ID
payment-service/production      # Project name and environment name
prj_01JABCDEF1234/production    # Project ID and environment name

Use readable references interactively. Use immutable IDs in CI and deployment configuration because an environment ID does not change when its project or environment is renamed.

Project names are unique within one Dopbase server. Environment names are unique within their project. IDs belong to the Dopbase server that created them. An ID from one server cannot address a resource on another server.

Bootstrap a project ​

init creates a project, its first environment, and its secrets in one operation:

bash
dopbase init
dopbase init payment-service/development --from .env
dopbase init worker/development --from secrets.json
cat secrets.yml | dopbase init storefront/development --from - --format yaml

Run dopbase init without arguments from a directory that contains .env. The CLI checks the server and login, shows the number of variables it found, and asks for a new project/environment target. A key-name check estimates how many variables may be sensitive without using or printing their values. All variables are imported.

After a successful interactive import, Dopbase asks whether to delete .env. Yes is selected by default. The file is kept if it changed after Dopbase read it, and the command never edits .gitignore.

Use the explicit form for scripts, stdin, JSON, YAML, TOML, or machine-readable output. Both modes validate the complete file before changing server state. The project, environment, and secrets are created atomically, so a failed request cannot leave a partial project. Terminal output never includes secret values.

Project commands ​

CommandPurpose
dopbase project create <PROJECT_NAME>Create an empty project
dopbase project listList accessible projects
dopbase project show <PROJECT_REF>Show project metadata
dopbase project rename <PROJECT_REF> <NEW_PROJECT_NAME>Rename a project
dopbase project delete <PROJECT_REF>Delete a project

<PROJECT_REF> accepts an immutable project ID or project name. Deleting a project also deletes its environments, secrets, and scoped tokens. Dopbase shows the affected resource counts and requires confirmation. Automation must pass --yes.

Environment commands ​

CommandPurpose
dopbase env create <PROJECT_REF/ENVIRONMENT_NAME>Create an environment
dopbase env clone <PROJECT_REF/SOURCE_ENVIRONMENT_NAME> <NEW_ENVIRONMENT_NAME>Clone secrets to a new environment
dopbase env edit <ENVIRONMENT_REF>Edit an environment in a terminal editor
dopbase env default <ENVIRONMENT_REF>Set the run default
dopbase env default --clearClear the run default
dopbase env list [PROJECT_REF]List environments
dopbase env show <ENVIRONMENT_REF>Show environment metadata
dopbase env rename <ENVIRONMENT_REF> <NEW_ENVIRONMENT_NAME>Rename an environment
dopbase env delete <ENVIRONMENT_REF>Delete an environment

dopbase env list shows ENVIRONMENT, ID, and UPDATED columns. Each ENVIRONMENT value uses the project and environment names, such as payment-service/local. Filtering by project name or ID keeps this format. --json returns the environment records with separate projectName and name fields.

text
ENVIRONMENT                  ID           UPDATED
payment-service/local        env_100001   2026-10-05 08:30 UTC
payment-service/production   env_100002   2026-10-05 09:00 UTC

2 environment(s)

Deleting an environment also deletes its secrets and scoped tokens. The operation requires confirmation or --yes and is recorded in the audit log.

Clone an environment when a local, preview, or production environment should start with the same secrets as an existing environment:

bash
dopbase env clone payment-service/local production
dopbase env clone storefront/staging preview-42 --yes

The source must use PROJECT_REF/ENVIRONMENT_NAME. The new environment is created in that project, so cloning across projects or servers is not supported. Dopbase resolves the source, checks that the new name is available, shows the source, destination, and secret count, then asks for confirmation. --yes skips this confirmation but still requires a recently authenticated human account. Runner tokens and service accounts cannot clone environments.

Dopbase creates the destination before reading plaintext secrets. This closes a name-conflict race without exposing source values. If export or import fails, the CLI tries to remove the new environment and reports whether cleanup succeeded. Secret values remain in memory and are not written to a temporary file.

A successful clone prints every environment in the project. With --json, it returns the same environment array as dopbase env list <PROJECT_REF> --json. The clone copies current secret key/value pairs only. It does not copy editor layout, tokens, audit history, IDs, or timestamps, and it does not keep the two environments synchronized.

Edit a whole environment ​

bash
dopbase env edit payment-service/staging
dopbase env edit payment-service/staging --editor hx
dopbase env edit payment-service/staging --editor nvim --dry-run

env edit requires a terminal. With an existing login, Dopbase first checks that the environment exists and lists its secret metadata. If it is empty, Dopbase asks whether to add secrets; pressing Enter exits without password confirmation or opening an editor. Existing sessions always require password confirmation before export, or approval in the Admin UI for an account that cannot use a password. A login completed by this command counts as confirmation, so it does not ask twice.

Editor selection uses --editor, then VISUAL, then EDITOR. If none is set, Dopbase checks for nvim, vim, hx, and nano, in that order. Commands are split into arguments without a shell; shell expansion and pipelines are unavailable.

The editor opens the current secrets as .env text. On exit, Dopbase parses the document and runs a server dry run. The preview lists added, updated, and deleted key names without showing their values. Type apply to save, edit to reopen the buffer, or press Enter to cancel. --dry-run stops after the preview and saves nothing. Invalid documents can be reopened for correction.

Removing a line schedules that key for deletion. KEY= saves an empty value. Deleting every secret requires typing the environment reference. There is no --yes option, and --json is unavailable for this interactive command.

Comments, blank lines, and key ordering survive later CLI and UI sessions. Comments are unencrypted metadata. Put credentials in values, never in comments. Use escaped newlines for multiline values, such as PRIVATE_KEY="first\nsecond". Variable references and command substitutions remain literal text; Dopbase never evaluates them.

The environment must remain unchanged from loading through saving. If another user changes its secrets or layout, Dopbase stops with a conflict. Start a fresh editing session to work from the current values. Failed or uncertain save requests are not automatically retried. Dopbase removes the editor files before submitting a confirmed draft. Once submission starts, an interruption waits for the server response instead of reporting a cancellation while a save may still commit.

Editor security ​

Known editors use a protected session with isolated configuration and disabled plugins, language servers, swap files, backups, and persistent history where applicable. This means your usual configuration and custom mappings are not loaded. On macOS, a nano alias pointing to Pico is treated as a custom editor. A custom command, including a known editor with extra arguments, requires acknowledgement before values are fetched. Custom editors must wait until editing finishes; a launcher that returns immediately is unsuitable.

Dopbase uses an owner-only session directory under the active client configuration directory's secret-edit folder. The directory has mode 0700 and the .env file has mode 0600. The editor receives a limited environment without Dopbase tokens or unrelated credentials. Unsafe file replacements, symlinks, hard links, and documents larger than 8 MiB are rejected.

Dopbase removes session files after success, cancellation, errors, Ctrl+C, and handled termination signals. A later env edit invocation removes abandoned sessions while preserving active sessions. Cleanup failures report the remaining directory. Linux and macOS are supported.

External editors receive plaintext. Forced termination, power loss, disk snapshots, a compromised editor, or terminal recording can expose it. File deletion does not guarantee forensic erasure. Read the security model for these limits.

Secret commands ​

CommandPurpose
dopbase secret list <ENVIRONMENT_REF>List keys and safe metadata
dopbase secret set <ENVIRONMENT_REF> <KEY>Create or update a value
dopbase secret get <ENVIRONMENT_REF> <KEY>Read safe metadata
dopbase secret get <ENVIRONMENT_REF> <KEY> --revealExplicitly reveal a value
dopbase secret delete <ENVIRONMENT_REF> <KEY>Delete one secret
dopbase secret history <ENVIRONMENT_REF> <KEY>List the stored versions of a secret
dopbase secret get <ENVIRONMENT_REF> <KEY> --version <N>Read one version's metadata, or its value with --reveal
dopbase secret rollback <ENVIRONMENT_REF> <KEY> [VERSION]Restore an earlier value as a new version

secret set securely prompts for a value when attached to a terminal. Use --stdin for automation:

bash
printf '%s' "$NEW_DATABASE_URL" | \
  dopbase secret set payment-service/staging DATABASE_URL --stdin

Dopbase does not provide a plaintext --value argument. --reveal requires interactive password confirmation on every invocation and cannot be bypassed with --json, stdin, or a confirmation flag. Reveal and deletion operations are explicit, permission-controlled, and audited. Normal human and JSON output never contains a value.

History and rollback ​

Every change to a secret is kept as a numbered version. secret history lists them newest first with the change, who made it, when, and a status:

text
$ dopbase secret history payment-service/production DATABASE_URL
VERSION   CHANGE                BY                SAVED                  STATUS
v4        rolled back from v2   ana@example.com   2026-10-23 10:02 UTC   current
v3        updated               bob@example.com   2026-10-22 18:40 UTC   available
v2        imported              bob@example.com   2026-10-21 09:15 UTC   available
v1        created               ana@example.com   2026-09-01 08:00 UTC   available

4 version(s)

available versions can be restored. expired versions are past the retention limit: Dopbase still shows who changed them and when, but no longer stores the value. --limit sets the page size (1 to 200, default 50). When more versions exist, the command for the next page, with --before, is printed to standard error. --json prints the API page unchanged. History never contains values, and AI agent tokens can read it the same way they read secret list.

secret rollback saves the value of an earlier version as a new version. It never edits history, so a rollback can be rolled back too. Leave out VERSION in a terminal to pick from the versions you can restore:

bash
dopbase secret rollback payment-service/production DATABASE_URL     # pick a version
dopbase secret rollback payment-service/production DATABASE_URL 2   # roll back to v2
dopbase secret rollback payment-service/production DATABASE_URL 2 --yes

Before asking for confirmation, the command shows the current version, the version being restored, and the version number the result gets. It sends the current version with the request, so if someone changes the secret in the meantime the server refuses the rollback instead of overwriting their change. Without a terminal, pass both VERSION and --yes.

Apps read the new value the next time they fetch secrets. Processes already started by dopbase run keep the old value until they restart.

To check an old value before restoring it, use dopbase secret get <ENVIRONMENT_REF> <KEY> --version <N> --reveal. Like --reveal on the current value, it asks for your password and is audited.

Import and export ​

Import into an existing environment with:

bash
dopbase import payment-service/staging .env.staging
dopbase import payment-service/staging secrets.json
dopbase import payment-service/staging secrets.toml
cat secrets.yml | dopbase import payment-service/staging - --format yaml

Import merges by default: keys in the file are created or updated, while remote keys absent from the file remain unchanged. --dry-run reports the number of additions, updates, unchanged values, and deletions without changing server state.

Use --replace to make the remote environment match the file exactly. Replace shows the keys that would be deleted and requires confirmation. Non-interactive use also requires --yes.

The CLI infers JSON from .json, YAML from .yaml or .yml, and TOML from .toml. Every other filename defaults to dotenv, which keeps names such as .env.production compatible. Pass --format <dotenv|json|yaml|toml> to override inference. Stdin uses - and always requires --format.

JSON, YAML, and TOML input must be one flat mapping of string keys to string values. Nested objects or tables, arrays, numbers, booleans, dates, null values, duplicate keys, and empty keys fail the complete import. Dotenv does not expand variables or run command substitutions. All formats allow empty string values but must contain at least one secret. Errors may name a key, but never print its value.

Export requires an explicit destination:

bash
dopbase export payment-service/staging --output .env.staging
dopbase export payment-service/staging --output secrets.json
dopbase export payment-service/staging --output secrets.toml
dopbase export payment-service/staging --stdout --format yaml

To inject secrets into an existing container, use Docker format:

bash
dopbase export payment-service/staging --stdout --format docker |
  docker exec \
    --env-file=/dev/stdin \
    --user node \
    -w /workspace \
    container-name \
    node script.js

--output and --stdout are mutually exclusive. File output infers its format from the filename, while stdout defaults to dotenv. --format overrides either default. Docker format is selected explicitly with --format docker; it is not available for import or init. All output formats sort keys for stable exports. Global --json controls command status output and cannot be combined with plaintext --stdout.

Docker env files use raw KEY=value lines. Spaces and extra = characters are part of the value, while quotes are also literal characters. Docker format therefore does not quote or escape values. It rejects secrets containing line breaks or NUL bytes because Docker env files cannot represent them safely. Use a mounted secret file for multiline certificates and private keys.

Place Docker's --env-file option before the container name. The example does not use -i because Docker consumes stdin as the env file. If the program also needs stdin, export to a temporary private file, pass its path to --env-file, and remove the file after the command exits.

File export refuses to overwrite an existing path unless --force is passed and creates the file with restrictive permissions where the platform supports them. Export reveals plaintext values and records access in the audit log. Human CLI exports require interactive password confirmation. Runner tokens can export only their assigned environment without a prompt, using DOPBASE_TOKEN or an encrypted saved runner credential. AI agent tokens cannot export values.

Exports require a live server response. They never fall back to the encrypted run cache. Authentication, network, or rendering failures leave an existing output file untouched.

The Admin UI provides the same workflow for dotenv files, with a visual review and dry-run summary before anything is stored. See import and export.

Export in AWS CodeBuild ​

Install Dopbase in the build image and use a runner token scoped to the target environment. Store a JSON secret containing a token field in AWS Secrets Manager, for example under dopbase/production. Give the CodeBuild service role secretsmanager:GetSecretValue access to that secret. CodeBuild injects it as DOPBASE_TOKEN through env.secrets-manager:

yaml
version: 0.2
env:
  shell: bash
  variables:
    DOPBASE_URL: https://dopbase.example.com
  secrets-manager:
    DOPBASE_TOKEN: "dopbase/production:token"
phases:
  build:
    commands:
      - |
        (
          set -eu
          set +x
          secrets_dir=$(mktemp -d)
          trap 'rm -rf "$secrets_dir"' EXIT
          dopbase export env_482731 --output "$secrets_dir/.env"
          ./deploy.sh "$secrets_dir/.env"
        )

Replace the environment ID and deployment command with your own. The build must be able to reach the Dopbase server. The shell exits if export fails and removes its temporary secrets directory when the block ends. Keep .env out of build logs, source control, container image layers, and ordinary build artifacts. No dopbase login step is needed.

AWS Systems Manager Parameter Store is another option, using env.parameter-store and the corresponding IAM permissions. See the AWS CodeBuild buildspec reference for both integrations and permissions, including KMS requirements.

Runner tokens ​

Create a different token for each deployed environment:

bash
dopbase token create payment-service/production \
  --name production-server --role runner
dopbase token create payment-service/production \
  --name deploy-job --expires-in 12h
CommandPurpose
dopbase token create <ENVIRONMENT_REF> --name <NAME> --role runner [--expires-in <DURATION>]Create a runner token
dopbase token list <ENVIRONMENT_REF>List token metadata
dopbase token revoke <token-id>Revoke a token

The plaintext token is displayed only once. Tokens can also be created and revoked on an environment's Tokens tab in the Admin UI. Without --expires-in, a runner token does not expire. Use never or a whole number followed by h or d, up to 26280h or 1095d. The server rejects expired tokens even if the client's clock is wrong. The list shows each token's expiry and status. A runner token can retrieve values for dopbase run and export them from its assigned environment. It cannot modify secrets or access another environment. Export audit entries identify the runner token and secret count without storing values.

Audit commands ​

The audit log answers who performed a sensitive action, where it happened, and when. Administrators review it on the Audit page in the Admin UI or with dopbase audit list, verify its integrity from the terminal, and export it as JSON lines for external, write-once storage:

bash
dopbase audit list --action secret.updated
dopbase audit verify
dopbase audit verify --anchor 42:<HEAD_HASH>
dopbase audit export --output audit-2026-10-17.jsonl
dopbase --json audit verify
CommandPurpose
dopbase audit listShow one page of events, newest first
dopbase audit verifyRecompute the audit log's hash chain
dopbase audit exportStream matching records as JSON lines

dopbase audit list prints a table of the newest events: time, chain sequence, actor, action, resource, project ID, and environment ID. It takes the same --action, --project, --environment, and --actor filters as export, and project and environment names are resolved to IDs before the request. --limit sets the page size from 1 to 200 (default 50):

bash
dopbase audit list
dopbase audit list --project storefront --environment storefront/production
dopbase audit list --action secret.updated --actor admin@example.com --limit 100
dopbase --json audit list --cursor <CURSOR>

When more events match, the command for the next page is printed to standard error with the same filters and a --cursor value. Copy it as is: the cursor is opaque, and the server does not check that it was issued for the same filters. Standard output holds only the table, so it can be piped to grep or less.

--json prints the API page unchanged, {"items": [...], "nextCursor": ...}, with nothing on standard error. nextCursor is null on the last page. To read every matching record in a script, use dopbase audit export instead of paging by hand.

The table leaves out each event's metadata; --json includes it. The command requires an administrator sign-in. A member gets the server's authorization error, and runner or agent tokens are refused before any audit request. Audit events never contain secret values, and the CLI does not fetch any. Control characters and bidirectional text markers stored in an event are shown as ?, so a planted record cannot rewrite the lines around it in your terminal.

Every audit record stores the hash of the record before it, so a record that was modified, removed, or inserted after the fact stands out at that point in the log. Verification walks the records in sequence order, stops at the first break, and reports how many records were checked before it. It reads no secret values.

The command requires an administrator account. It exits with code 0 when the chain is intact and 2 when it is broken, so monitoring can alert on the result. When the chain is intact it prints the head sequence and hash, which you can save for external anchoring, and --json prints the full report. Records written before the chain existed are listed as legacy records; they carry no hashes but do not fail verification.

The chain alone cannot tell a fully rewritten log, or one whose newest records were deleted, from an honest one. Save the head sequence and hash somewhere outside the server and pass them back with --anchor SEQ:HASH: the check fails when that record changed (MISMATCH) or no longer exists (MISSING). When retention has removed records, verification continues from the pruning anchor and reports Pruned through: sequence N instead of a gap. See audit events for what the chain does and does not prove.

dopbase audit export writes one JSON object per line to standard output, or to a file with --output <FILE> (mode 0600, never replacing an existing file without --force). Each line is the record exactly as the audit list API returns it, chain fields seq, prevHash and recordHash included, so any exported record can later serve as an --anchor:

bash
dopbase audit export > audit.jsonl
dopbase audit export --action secret.updated --limit 500
dopbase audit export --project production --environment production/main
OptionPurpose
--action <ACTION>Only records with this action, for example secret.updated
--project <PROJECT_REF>Only records for this project (name or ID)
--environment <ENVIRONMENT_REF>Only records for this environment (PROJECT/NAME or ID)
--actor <ACTOR>Only records for this actor (email or actor ID)
--limit <N>Stop after N records
--output <FILE>Write to a file instead of standard output
--forceReplace an existing output file

Without filters the whole log is exported by following pagination to the end. Export requires an administrator account, reads no secret values, and leaves standard output as raw JSON lines in every mode so it can be piped directly; with --output and --json the summary is printed as {"exported":N,"path":"FILE"} instead.

Run a process ​

Pass the environment directly:

bash
dopbase run payment-service/development -- npm run dev

On an application server, save its runner token once:

bash
printf '%s' "$RUNNER_TOKEN" | dopbase login --token
dopbase run payment-service/production -- npm start

For CI jobs, inject DOPBASE_TOKEN through the pipeline's secret store:

bash
dopbase run payment-service/production -- npm start

Automation may set DOPBASE_ENV instead:

bash
DOPBASE_ENV=env_482731 dopbase run -- ./payment-service

Interactive users may save a server-scoped default:

bash
dopbase env default payment-service/development
dopbase run -- npm run dev

An explicit positional environment takes precedence over DOPBASE_ENV, which takes precedence over the saved default. If none is available, run explains how to set the default. Use dopbase env default --clear to remove it. An empty DOPBASE_ENV is an error and does not fall back.

Before starting the child, Dopbase writes the resolved project, environment, immutable ID, injected key count, and whether values came from the live server or encrypted cache to standard error. It does not print values.

Choose which secrets reach the child and which inherited values win:

bash
dopbase run payment-service/production --only API_KEY,DATABASE_URL -- npm start
dopbase run payment-service/development --preserve-env PORT,LOG_LEVEL -- npm run dev
FlagEffect
--only <KEY>Inject only these keys. Repeatable and comma-separated. A key that is not stored stops the run
--allow-missingWith --only, warn about keys that are not stored and start the child anyway
--preserve-env <KEY>Keep the inherited value for these keys. Repeatable and comma-separated

Without --preserve-env, stored values replace same-named variables inherited from the parent process. Dopbase never injects its control variables (DOPBASE_TOKEN, DOPBASE_URL, DOPBASE_ENV, DOPBASE_DATA_DIR, DOPBASE_SECRETS_PATH) or the shell variables PATH, HOME, PS1, PS2, XDG_*, and LC_* from stored secrets. Names that load code, such as LD_PRELOAD and NODE_OPTIONS, are skipped unless --only names them, and are then injected with a warning. DOPBASE_TOKEN is also removed from the inherited environment, so the child never receives the credential used to contact Dopbase. See choose which secrets reach the application for the full lists.

Every successful live retrieval refreshes the credential-bound encrypted cache. Connection failures, timeouts, and 5xx responses fall back to the latest matching cache after a five-second live-fetch deadline.

Cached entries do not expire, so the warning includes their fetch time and age. Authentication, authorization, not-found, malformed-response, missing-cache, or cache-integrity failures stop before the child starts. Once started, signals are forwarded and the child's exit status is returned to the calling shell.

Runtime cache maintenance ​

Inspect safe metadata for the active server's encrypted runtime cache:

bash
dopbase cache list
dopbase cache list --json

The output includes the server URL, project and environment names, immutable environment ID, fetch time, age, and aliases. It never includes secret names, values, cache keys, nonces, or ciphertext.

Remove entries older than 14 days:

bash
dopbase cache clean --dry-run
dopbase cache clean --yes

Set a different age with a positive whole number followed by s, m, h, or d. An entry must be strictly older than the cutoff, so an entry exactly 14 days old is kept by the default cleanup.

bash
dopbase cache clean --older-than 30d --yes
dopbase cache clean --all --yes

Only --all ignores age. Cleanup asks for confirmation unless --yes is present. --dry-run never writes to the cache and does not ask for confirmation. These commands work offline, but the active credential must be able to unlock the cache.

backup ​

Create an encrypted system-level snapshot containing all projects, environments, secrets, runner tokens, and administrator credentials.

bash
# Create a timestamped backup stored on the server
dopbase backup

# Create a named backup and save a copy locally
dopbase backup pre-upgrade --output ./pre-upgrade.dop

# Run with structured JSON output
dopbase backup pre-upgrade --json
Argument / FlagDescription
[name]Optional name prefix (default: dopbase_backup_<timestamp>)
-o, --output <path>Download a copy of the encrypted archive to a local file path
--jsonFormat results as machine-readable JSON

Operation flow ​

  1. Dopbase contacts the server and verifies that the instance is running and reachable (server_status: connected (live)).
  2. The server acquires an online SQLite snapshot lock, generates dopbase.db and manifest.json, and encrypts the ZIP container using XChaCha20-Poly1305 with the server's master key (~/.dopbase/master.key).
  3. The encrypted .dop archive is stored on the server under ~/.dopbase/backups/.
  4. If --output was specified, the CLI streams and downloads the archive to your local device.
  5. The CLI prints a confirmation and a security notice reminding you that the backup is encrypted with this instance's master key and that the master key will be required if restoring onto a new server.

IMPORTANT

dopbase backup requires an active, reachable server (server_status: connected (live)). If the server is offline or disconnected, the command halts immediately.

restore ​

Restore all database tables and instance configuration from a .dop backup archive.

bash
# Restore on the same server (uses server's existing master key)
dopbase restore ./pre-upgrade.dop

# Restore on a new or different server (Dual-input restore with master.key file)
dopbase restore ./pre-upgrade.dop --key /path/to/source/master.key

# Restore on a new server using a 64-character hex master key
dopbase restore ./pre-upgrade.dop --key 4a2f8b9c01234567...

# First run: start without DOPBASE_ROOT_EMAIL, or use `server setup --web`
# Use the setup token printed by that target listener
dopbase restore ./pre-upgrade.dop --setup-token setup_... --yes
Argument / FlagDescription
<path>Path to the local .dop backup file to restore
-k, --key <KEY>Path to source server's master.key file or a 64-character hex string
--yesSkip the destructive confirmation prompt (initialized restores still require password confirmation)
--setup-token <TOKEN>One-time token required for first-run restore
--jsonFormat results as machine-readable JSON

Operation flow ​

  • On a live, initialized server:
    1. Verifies server status is live (connected (live)).
    2. Uploads the .dop archive to the server.
    3. Prompts for interactive confirmation (requiring typing RESTORE) unless --yes is specified.
    4. Decrypts and authenticates the archive using the provided --key (or the server's existing master key).
    5. If --key was provided, re-keys restored secret metadata to the target server's existing ~/.dopbase/master.key.
    6. Replaces SQLite database tables, runs any pending migrations, and preserves the active administrator session.
  • On a first-run uninitialized server:
    • Start with no bootstrap email, or use server setup --web; restoration requires the printed one-time setup token.

IMPORTANT

dopbase restore strictly requires the server to be live and connected (server_status: connected (live)). Offline restores are rejected to prevent file system races and corruption.

Server administration ​

Offline maintenance commands operate directly on the server database:

bash
dopbase admin reset-password admin@example.com
dopbase admin factory-reset
dopbase admin factory-reset --no-backup

admin reset-password performs offline recovery on the host machine. Because it accesses SQLite files directly, the background or foreground server process must be stopped first to avoid database locks.

OptionDescription
--config <FILE>Server configuration file to load (server.toml)
--master-key-file <FILE>Path to the server master key file

The command requires an interactive terminal, prompts for a new password (12 to 128 characters), updates the stored Argon2id hash, and immediately revokes all active sessions for that account.

admin factory-reset also requires the server to be stopped. It displays the exact data directory, then requires please-wipe-out-system and the Dopbase root password. There is no non-interactive bypass.

By default, the reset saves the whole data directory to a timestamped ZIP next to that directory, then removes the active data. The ZIP includes every database, master-key, configuration, backup, log, and local CLI file stored inside the directory. Start again to enter automatic setup on the fresh instance. An interrupted web reset still requires explicit setup to finish its pending work.

Pass --no-backup to remove the data directory without creating the ZIP. The same confirmation phrase and root password are still required.

Structured output ​

Resource and metadata commands support --json for automation. Secret values remain excluded unless the user explicitly selected --reveal, --stdout, or an export destination. Errors identify the server, project, environment, and operation when safe without including request bodies, tokens, or plaintext values.

Open-source secrets management for developers.