Updated

mddoc CLI

mddoc runs a command with the variables of an md-doc Environment so that their values never appear on screen, in the history or in an AI’s context.

mddoc run my-app.com -- npm run deploy

Installation

On Linux or macOS, with Node.js 20 or later:

npm install -g --prefer-online https://app.md-doc.com/cli/mddoc.tgz

To update: mddoc update.

Connect

  1. In md-doc → Settings → API keys, create a CLI (Environments)-type key.

  2. In your terminal (not in a chat):

    mddoc login --url https://app.md-doc.com/api

    It asks for the API key and your master key. Neither is shown as you type.

Commands

Command What it does
mddoc run <environment> [--only A,B] -- <cmd…> Runs cmd with the variables and masks its output
mddoc set <environment> <VAR> [--generate [--length N]] Adds a new variable: hidden value, via stdin or randomly generated without showing it
mddoc list Environments and variable names (never values)
mddoc status Session status
mddoc login / unlock Connect / unlock (interactive terminal only)
mddoc lock / logout Lock / disconnect this machine
mddoc update Install the latest version

Exit codes

Code Meaning
3 Locked or session expired → mddoc unlock
4 No session or key revoked → mddoc login
5 Environment or variable not found
other In run, the command’s own exit code

Security

The CLI decrypts on your machine and only stores the environments key, in the system keyring. login and unlock refuse to read the key from a pipe, so an AI without an interactive terminal cannot unlock it. More in Security.