Command reference
This page defines the implemented v0.2.3 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
When no server is configured, client commands use http://localhost:8840. client connect validates a new endpoint, asks for interactive confirmation, deletes the previous encrypted CLI session, clears the saved default environment, and then saves the new endpoint. It refuses to switch away from a local server that is running from the data directory, so stop that server first; connecting to one while it runs works. It does not select a project or environment, stop any server, 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 web flow in the terminal, including backup restore. It accepts the server start 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. Its log goes to that terminal. To keep the server running, use Docker or a service manager such as systemd. server status prints whether a server is running from the data directory and exits with status 1 when it is stopped. See server lifecycle for options, a systemd unit, and examples.
server start accepts these options:
The commands that managed a background server were removed. See removed commands for what to use.
The old top-level serve and stop commands are not supported. Use server start, and stop the server with Ctrl+C.
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:
dopbase 0.2.3 is up to date (latest release 0.2.3).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:
curl -fsSL https://dopbase.com/install.sh | shThe 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.
dopbase update asks GitHub every time you run it, whatever DOPBASE_UPDATE_CHECK says. That setting only controls whether the server checks for releases on its own for the Status page. To keep a machine off GitHub completely, don't run dopbase update there, or block api.github.com at the network.
The server resolution order is:
- A global
--server <url>argument DOPBASE_URL- The endpoint saved by
dopbase client connect 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 login and dopbase logout stop with exit code 1 while DOPBASE_TOKEN is set. The token takes priority over a saved login, so a new login would be ignored and a logout would leave you signed in. Unset the variable first. To remove a saved login while keeping the variable for other commands, run env -u DOPBASE_TOKEN dopbase logout. The error message prints that command with any --data-dir or --server you passed, so you can copy it as is.
dopbase logout ends a saved login on the server before it deletes the local files, so a copy of the session token stops working. If the server can't be reached, the files are still deleted and a warning says the session stays valid until it expires. A saved runner token is only removed from this machine; revoke it with dopbase token revoke or in the Admin UI. With --json, server_session is revoked, already_ended, not_reached (the server didn't answer), unreadable (the saved login was damaged) or not_applicable. When --server or DOPBASE_URL points somewhere other than the server that issued the saved login, logout ends it on the issuing server and never sends its token to the other one. The JSON then also has session_server_url.
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:
env_482731 # Immutable environment ID
payment-service/production # Project name and environment name
prj_01JABCDEF1234/production # Project ID and environment nameUse 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:
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 yamlRun 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
<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
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.
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:
dopbase env clone payment-service/local production
dopbase env clone storefront/staging preview-42 --yesThe 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 with project manager on the project. Runner tokens and personal tokens 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, and a file secret stays a file. 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
dopbase env edit payment-service/staging
dopbase env edit payment-service/staging --editor hx
dopbase env edit payment-service/staging --editor nvim --dry-runenv 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.
File secrets are left out of the editor. Before it opens, Dopbase names the ones it is hiding, and saving leaves them as they were. A line that sets the key of a hidden file secret is refused. Change a file with dopbase secret set <ENVIRONMENT_REF> <KEY> --file <PATH>.
Comments, blank lines, and key ordering survive later CLI and UI sessions. Comments are unencrypted metadata. Put credentials in values, never in comments. Variable references and command substitutions remain literal text; Dopbase never evaluates them.
A value with line breaks shows over several lines inside quotes, and you can write one the same way. Single quotes keep the text exactly as it is, which suits JSON. Double quotes read \n, \r, \t, \" and \\, so PRIVATE_KEY="first\nsecond" works too.
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
secret set securely prompts for a value when attached to a terminal. Use --stdin for automation:
printf '%s' "$NEW_DATABASE_URL" | \
dopbase secret set payment-service/staging DATABASE_URL --stdin--file stores a file and remembers its name, in lower case with spaces turned into -. A text file is stored as it is, and a binary file as base64 text. --file cannot be combined with --stdin, and binary data piped to --stdin is refused with a pointer to --file:
dopbase secret set payment-service/production TLS_CERT --file ./server.pem
dopbase secret set mobile/production ANDROID_KEYSTORE --file ./release.jkssecret list adds a FILE column when an environment holds a file, and secret get shows the file's name, size and encoding. With --reveal, --output <PATH> writes to a file only you can read instead of printing. A file secret comes back as the original file, decoded if it was binary, and any other secret is written as its value. An existing file is kept unless you pass --force. See Files.
Dopbase does not provide a plaintext --value argument. With a saved login, --reveal requires interactive password confirmation on every invocation and cannot be bypassed with --json, stdin, or a confirmation flag. A personal token reveals without a prompt when it reaches read on the environment; a names-only token is refused, and so is a runner token. 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:
$ dopbase secret history payment-service/production DATABASE_URL
VERSION CHANGE BY SAVED STATUS
v4 rolled back from v2 ana@dopbase.com 2026-10-23 10:02 UTC current
v3 updated bob@dopbase.com 2026-10-22 18:40 UTC available
v2 imported bob@dopbase.com 2026-10-21 09:15 UTC available
v1 created ana@dopbase.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 a personal token that reads names only can read it the same way it reads 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:
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 --yesBefore 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:
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 yamlImport 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:
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 yamlWhen the server has secret references on, export writes the values apps get, with ${KEY} filled in. Add --raw to write the values as stored, with the references left in place, for a backup or to move secrets to another environment:
dopbase export payment-service/staging --stdout --rawTo inject secrets into an existing container, use Docker format:
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. For a multiline certificate or private key, use dopbase run --mount.
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. A personal token exports without a prompt when it reaches read on the environment; a names-only token is refused.
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:
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:
dopbase token create payment-service/production \
--name production-server --role runner
dopbase token create payment-service/production \
--name deploy-job --expires-in 12hWithout --name the server picks a name such as token-7kq2mx. No two live tokens in an environment share a name; a revoked or expired token's name can be used again. The plaintext token is displayed only once. Tokens can also be created and revoked on an environment's Tokens tab in the Admin UI. Runner tokens always expire. Without --expires-in a token lasts 90 days; give a whole number followed by h or d, up to 8760h or 365d. Creating one asks you to confirm your password if you haven't signed in recently. The server rejects expired tokens even if the client's clock is wrong. The list shows each token's expiry and status. Tokens revoked or expired more than 30 days ago are left out; the audit log keeps them. 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.
Personal tokens
A personal token lets a script or an AI agent act as you through DOPBASE_TOKEN. It reaches at most what you reach at that moment, within its own project or environment and level, and always expires.
dopbase token personal create --name laptop-agent --level metadata \
--project payment-service --expires-in 7d
dopbase token personal create --name siem --audit --expires-in 90dWithout --name the server picks one such as token-7kq2mx. None of your live tokens can share a name, but a revoked or expired one's name is free again. --level defaults to read and stops at your role's token limit. Leave out --project and --env for every project you reach. --expires-in defaults to your role's default and can't be never. --audit is for roles whose tokens read the audit log, such as Auditor. The value is shown once. Tokens for AI agent accounts are created on the AI agents page.
Access
dopbase access shows your role, groups, and every grant that reaches you. With a personal token in DOPBASE_TOKEN, it also shows the token's own limit, so you can check what an agent will reach before handing it over.
--project needs project manager on the project, or access.report. --user needs users.view for a person, and agents.view_all for an AI agent, or agents.view if the agent is yours. Access is changed in the Admin UI, on a project's Access page.
An AI agent's report also names its owner. An agent never gets more than its owner, so where the owner has less, the level column shows what the agent really gets, with the granted level in brackets.
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:
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 verifydopbase 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):
dopbase audit list
dopbase audit list --project storefront --environment storefront/production
dopbase audit list --action secret.updated --actor admin@dopbase.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. You see the events your role allows: everything with audit.read_all, your projects with audit.read, and otherwise your own actions. Audit tokens read the log as their account would; runner tokens and personal tokens that read project data are refused. 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:
dopbase audit export > audit.jsonl
dopbase audit export --action secret.updated --limit 500
dopbase audit export --project production --environment production/mainWithout 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:
dopbase run payment-service/development -- npm run devTo use a secret inside the command line itself, pass the command as one string with --command, or -c. It runs in your shell after the secrets are loaded, so $NAME, && and pipes work. Use single quotes:
dopbase run payment-service/development -c 'curl -H "Authorization: Bearer $API_TOKEN" https://api.internal/health'
dopbase run payment-service/production -c 'npm run migrate && npm start'See Run a shell command.
When a command needs a secret as a file, mount it. Dopbase writes the secret to a private temporary file, puts the path where {KEY} appears after -- and in the variable, and deletes the file when the command ends. In a --command string, use "$KEY":
dopbase run ops/production --mount SSH_PRIVATE -- ssh -i {SSH_PRIVATE} root@203.0.113.10
dopbase run payment-service/production --mount TLS_CERT,TLS_KEY -- curl --cert {TLS_CERT} --key {TLS_KEY} https://api.internalOn an application server, save its runner token once. The token belongs to one environment, so run needs no reference:
printf '%s' "$RUNNER_TOKEN" | dopbase login --token
dopbase run -- npm startFor CI jobs, inject DOPBASE_TOKEN through the pipeline's secret store:
dopbase run -- npm startWith a runner token, a positional reference or DOPBASE_ENV only checks the token. A reference to another environment stops run before the child starts, and the saved default is ignored.
Automation may set DOPBASE_ENV instead:
DOPBASE_ENV=env_482731 dopbase run -- ./payment-serviceInteractive users may save a server-scoped default:
dopbase env default payment-service/development
dopbase run -- npm run devFor other credentials, 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. With a runner token it writes only the key count and the source, because that output usually ends up in CI logs. With --command it also names the shell. It does not print values or the --command string.
Choose which secrets reach the child and which inherited values win:
dopbase run payment-service/production --only API_KEY,DATABASE_URL -- npm start
dopbase run payment-service/development --preserve-env PORT,LOG_LEVEL -- npm run devWithout --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:
dopbase cache list
dopbase cache list --jsonThe 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:
dopbase cache clean --dry-run
dopbase cache clean --yesSet 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.
dopbase cache clean --older-than 30d --yes
dopbase cache clean --all --yesOnly --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.
# 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 --jsonOperation flow
- Dopbase contacts the server and verifies that the instance is running and reachable (
server_status: connected (live)). - The server acquires an online SQLite snapshot lock, generates
dopbase.dbandmanifest.json, and encrypts the ZIP container using XChaCha20-Poly1305 with the server's master key (~/.dopbase/master.key). - The encrypted
.doparchive is stored on the server under~/.dopbase/backups/. - If
--outputwas specified, the CLI streams and downloads the archive to your local device. - 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.
# 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_... --yesOperation flow
- On a live, initialized server:
- Verifies server status is live (
connected (live)). - Uploads the
.doparchive to the server. - Prompts for interactive confirmation (requiring typing
RESTORE) unless--yesis specified. - Decrypts and authenticates the archive using the provided
--key(or the server's existing master key). - If
--keywas provided, re-keys restored secret metadata to the target server's existing~/.dopbase/master.key. - Replaces SQLite database tables, runs any pending migrations, and preserves the active administrator session.
- Verifies server status is live (
- A backup from Dopbase 0.1.x: restore upgrades it to the 0.2.0 schema before anything else, then restores it the usual way. It prints what it left out and changed, and everyone signs in again. See Upgrade to 0.2.0.
- On a first-run uninitialized server:
- Start with no bootstrap email, or use
server setup --web; restoration requires the printed one-time setup token.
- Start with no bootstrap email, or use
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
Maintenance commands open the server's database directly. They never talk to a server over the network:
dopbase admin reset-password admin@dopbase.com
dopbase admin passcode root@dopbase.com
dopbase admin factory-reset
dopbase admin factory-reset --no-backupThey act on the instance in the local data directory (--data-dir, DOPBASE_DATA_DIR, or ~/.dopbase), so run them on the machine that hosts the server. For a server in a container, run them inside it:
docker exec -it dopbase dopbase admin reset-password admin@dopbase.comEach command prints the data directory it uses. All three refuse when this CLI is connected to a different server, through dopbase client connect or DOPBASE_URL, and ask you to connect to the local instance. A connection counts as this instance when it is the instance's public URL, or localhost, 127.0.0.1, or ::1 on the port the server listens on. If this instance is stopped and a Dopbase server still answers at that address, it's another server on the same port, such as a container published on it, and the commands refuse too. With no saved connection, as in a fresh container, the commands run. To fix a refusal, connect to the local instance first, or set DOPBASE_URL to it for one run:
dopbase client connect http://localhost:8840
DOPBASE_URL=http://localhost:8840 dopbase admin reset-password admin@dopbase.comadmin reset-password sets a new password in the instance's database. It works with the server running or stopped. When the server is stopped, it holds the instance lock while it writes, so a server can't start halfway through. It never creates a data directory, database, or master key and never upgrades the database. It refuses a directory with no instance, a master key that doesn't match, and a database a newer Dopbase version has upgraded.
The command requires an interactive terminal, prompts for a new password (12 to 128 characters), updates the stored Argon2id hash, and revokes every active session on the instance. If the server is running and too many wrong passwords paused sign-in for the account, that pause still runs out on its own.
admin passcode prints a one-time passcode and a link that signs an account in to the Admin UI without a password. Run it on the server machine while the server is running, as a user who can write the server's data directory:
dopbase admin passcode root@dopbase.com
dopbase admin passcode alice@dopbase.com --ttl 120
dopbase --json admin passcode root@dopbase.comLaunch passcode for root@dopbase.com
Instance: /srv/dopbase
Passcode: GJZG-FLMT
Expires: in 60 seconds (14:03:27 UTC)
Open: https://dopbase.example.com/launch#identity=root%40dopbase.com&passcode=GJZG-FLMT
It works once. Running this command again replaces it.The command writes a hash of the passcode into the server database, so it never talks to the server and needs no sign-in. Being able to write the data directory is what lets you use it. Each account has one passcode at a time, and running the command again replaces it. The passcode sits in the link's fragment (after #), which browsers never send to the server, so it stays out of proxy and access logs.
It works for any person's account. It refuses AI agents, which sign in with tokens only, and turned-off accounts. While single sign-on is required, only root can use it. It also refuses when the server isn't running or the Admin UI is off (web_ui = false). With --json it prints email, passcode, expiresAt, ttlSeconds, url, and dataDir.
A passcode works once, and five wrong tries delete it. Each passcode issued, and each sign-in attempt with one, is recorded in the audit log.
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.