Commands
Command reference
Every Klef CLI command at a glance, grouped by what it does.
Every command accepts --help for its full description, arguments, and flags.
Most commands that touch secrets accept -e, --env <name> to override the
project's default environment for that run.
| Command | What it does |
|---|
klef status | Account, linked project + environment, agent state, and sync. No password prompt. |
Details
| Command | What it does |
|---|
klef login | Sign in via browser and unlock your encryption password. |
klef logout | Sign out and clear the local session token. |
klef whoami | Print the signed-in email, or exit non-zero if not signed in. |
klef recovery | Regenerate your recovery code. |
Details
| Command | What it does |
|---|
klef init [name] | Create a new project in the current directory. |
klef link <project> | Link the current directory to an existing project. |
klef projects list | List your projects across workspaces. |
klef workspace ... | Manage workspaces (list, create, rename, delete). |
Details
| Command | What it does |
|---|
klef push | Encrypt the local .env.local and upload it. |
klef pull | Fetch, decrypt, and merge into .env.local. |
klef diff | Compare local .env.local against the server. |
Details
| Command | What it does |
|---|
klef env ... | Create, list, use (switch default), rename, delete, and copy environments. |
Details
| Command | What it does |
|---|
klef set <key> <value> | Create or update a single secret. |
klef get <key> | Print the decrypted value of a single secret. |
klef unset <key> | Remove a single secret. |
klef rename <old> <new> | Rename a secret. |
klef list | List the keys (not values) in the environment. |
klef history <key> | Show the change timeline for a secret. |
klef restore <version-id> | Roll a secret back to a specific version. |
Details
| Command | What it does |
|---|
klef run <command> [args...] | Run a command with secrets injected as env vars. |
Details
| Command | What it does |
|---|
klef agent ... | Manage the background agent (start, status, lock, stop). |
klef lock | Clear the cached unlock. Alias for klef agent lock. |
Details