CLI reference/Configuration and behavior
.clavis.yaml
The per-folder file that links a repository to a project. Commit it; it holds no secrets.
clavis init writes .clavis.yaml in your repository. Commands look for it in the current folder and its parents, so they work from any subfolder without flags.
yaml
server: https://clavis.example.com
org: acme
project: web-app
env: dev # default environment
path: / # default folder
run: bin/rails server # what a plain `clavis run` starts
branch_envs: true # use the git branch's preview environment
cache: true # encrypted offline cache for `clavis run`
committed_env_files: # .env files you commit on purpose (no secrets)
- .env.development| Key | Meaning |
|---|---|
server | Server URL. Saved by clavis login. |
org, project | Organization and project slugs. |
env | Default environment. --env overrides it per command. |
path | Default folder inside the environment. |
run | Command started by clavis run with no arguments. Quotes and backslashes work as in a shell; pipes and && don't (put those in a script). |
branch_envs | When true, use the preview environment of the current git branch if one exists. See clavis env branch. |
cache | When true, keep an encrypted copy of the last values for offline use. See offline cache. |
committed_env_files | .env files that hold no secrets and are committed on purpose, such as the defaults Next.js or Vite read. clavis doctor does not warn about them. A name like .env matches in any folder; a path like config/*.env matches from the repository root. |
Which value wins
For server, organization, project and environment, the first one set wins:
- the flag (
--env staging) - the environment variable (
CLAVIS_ENV=staging) .clavis.yaml- the default (
devfor the environment)
Examples
Save a default command, then start it
sh
echo 'run: npm run dev' >> .clavis.yaml
clavis run