clavis import
Import secrets from files or external providers
clavis import [FILE] [flags]Import .env, JSON or YAML files, or pull everything from another secret manager. A folder is walked recursively and each file's directory becomes the secret folder. Try --dry-run first: it shows what would be new, changed or unchanged, never values.
Examples
A .env file
clavis import .envPreview a folder
clavis import ./config/ --dry-runRename keys while importing
clavis import .env --map import-map.yamlInfisical
clavis import --provider infisical \
--remote-project "$INFISICAL_PROJECT" --remote-env dev \
--token "$INFISICAL_TOKEN" --dry-runDoppler
clavis import --provider doppler \
--remote-project my-project --remote-env dev \
--token "$DOPPLER_TOKEN" --dry-runHashiCorp Vault or OpenBao (KV v1 or v2)
clavis import --provider vault \
--base-url "$VAULT_ADDR" --vault-mount secret --vault-version 2 \
--remote-path apps/web --token "$VAULT_TOKEN" --dry-run1Password Connect
clavis import --provider onepassword \
--base-url "$OP_CONNECT_HOST" --op-vault "$OP_VAULT" \
--token "$OP_CONNECT_TOKEN" --dry-runAWS Secrets Manager
clavis import --provider aws --aws-region eu-central-1 \
--aws-access-key "$AWS_ACCESS_KEY_ID" --aws-secret-key "$AWS_SECRET_ACCESS_KEY" \
--aws-prefix app/ --dry-runGoogle Secret Manager
clavis import --provider gcp --gcp-project my-project \
--gcp-service-account service-account.json --gcp-prefix APP_ --dry-runBitwarden Secrets Manager
clavis import --provider bitwarden --remote-project "$BWS_PROJECT_ID" \
--token "$BWS_ACCESS_TOKEN" --dry-runFlags
--aws-access-key string- AWS access key ID
--aws-prefix string- only import secrets with this name prefix
--aws-region string- AWS region
--aws-secret-key string- AWS secret access key
--aws-service string- AWS service (secretsmanager) Default:
secretsmanager --aws-session-token string- AWS session token
--base-url string- provider base URL
--dry-run- preview new, changed, and unchanged keys without writing
--folder string- target folder for imported keys
--gcp-prefix string- only import secrets with this name prefix
--gcp-project string- GCP project ID
--gcp-service-account string- GCP service account JSON file
--kind string- secret, variable, or file (default: preserve provider kind, else secret)
--map string- YAML/JSON key and folder mapping file
--message string- change message recorded in history
--op-vault string- 1Password vault ID
--provider string- file, infisical, doppler, vault, onepassword, aws, gcp, or bitwarden Default:
file --remote-env string- remote environment/config name
--remote-path string- remote secret path
--remote-project string- remote project/workspace ID
--token string- provider token (or provider-specific environment variable)
--vault-mount string- Vault KV mount Default:
secret --vault-version int- Vault KV version: 1 or 2 Default:
2 --yes- skip production confirmation
Details
A map file renames keys and folders; an empty target drops the key:
keys:
OLD_DATABASE_URL: DATABASE_URL
DROP_ME: ""
folders:
"": /imported
legacy: /legacyProvider credentials can also come from their usual environment variables: INFISICAL_TOKEN, DOPPLER_TOKEN, VAULT_ADDR, VAULT_TOKEN, OPENBAO_ADDR, OPENBAO_TOKEN, OP_CONNECT_HOST, OP_CONNECT_TOKEN, OP_VAULT, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, GCP_PROJECT and GOOGLE_APPLICATION_CREDENTIALS.
The web app's Import dialog accepts .env or JSON with the same dry-run preview.
Global flags
These work with every command.
--debug- enable debug logging
--env string- environment slug
--json- output machine-readable JSON
--org string- organization slug
--overlay string- tenant/region overlay slug
--path string- folder path (default /)
--project string- project slug
--server string- Clavis server URL (default: from .clavis.yaml or saved login)
-h, --help- help for any command