Repository navigation
Releases
v0.1.4
Fixes
sudo cred seton a file owned by a service account (or a shared 640 file) no longer changes its owner or group and locks the service out. If cred can't keep the owner, it writes nothing.set --namequotes values so godotenv, python-dotenv and. ./.envall read back exactly what was typed — python-dotenv could previously read some generated passwords back differently.set --namerefuses a value combining$or a backtick with'or\, and writes nothing, since no quoting reads back identically in every reader.
v0.1.3
Fixes
cred set --namekeeps a replaced line's indentation andexportprefix, so a sourced.envkeeps exporting the credential to child processes.--moderefuses anything beyond0777(setuid, setgid, sticky, or out-of-range values) with exit 2, instead of silently applying a different mode than asked.
v0.1.2
Fixes
set --namequotes every POSIX shell metacharacter (; & | < > ( ) * ? [ ] { } ~ !) in a.envvalue, so a file written by cred is safe to. ./.envwithout running any part of the value.show --namereads an unquoted.envvalue without its trailing# comment, matching sh, python-dotenv and godotenv.--namematches aKEY = valueline with whitespace before the=;setupdates it instead of appending a duplicate, andshow/rmfind it.set,showandrmreject a--namethat is not a valid.envkey (A=B, spaces, newlines, a leading digit or dash) with exit 2, before touching the file.
Changes
- Internal refactor of the
show/rmpath checks; no behaviour change. - GitHub Actions CI removed;
just gate(gofmt check, go vet, go test) is the gate.
Docs
- README rewritten to state behaviour plainly, including the
.envfile-mode rule; Release and License badges added. - Development section documents the
build,test,fmt,gateandinstallrecipes.
v0.1.1
Patch release: fail before the prompt when the destination can't be written.
Fixed
cred setnow refuses an unwritable destination before acquiring the value.os.Lstat's error was ignored wholesale, so onlyENOENT— the normal create case — was meant to fall through, butEACCESon a parent directory,ENOTDIRandELOOPfell through too: at an interactive prompt you typed a credential in full and only then learned it could never land.showandrmalready surfaced these.- Dropped an unreachable pend-drain in the key reader's CR/LF branch, and recorded why an incomplete escape sequence typed before Enter still survives.
Docs
docs/roadmap.md— the durable home for deliberately-deferred work, each entry with its rationale and unlock condition.
v0.1.0
First release.
cred moves a credential from your fingers to a file — a standalone mode-600 file, or one key inside a .env — without the value passing through argv, shell history, or an AI agent's transcript.
Why it's a command
An agent that needs you to place a credential can hand you shell text or a command. Shell text is dialect-specific: a pasteable built from read -sp/umask/printf is written in your interactive shell's dialect, and a bash snippet silently breaks in fish. A bare command has no dialect to get wrong.
What's in it
cred set <path>— hidden prompt, one●per rune so you can see your input registered, mode-600 write, and a receipt reporting path, mode, byte count and a short fingerprint. Never the value.--name KEY— target one key inside a.env, preserving comments, ordering and every other key.--expect-prefix— refuse a wrong paste before it lands.--value-from '<cmd>'— take the value from another command's stdout. The command must fetch the value, never contain it.cred show— report on a stored credential (including a fingerprint that matches the onesetprinted) without revealing it.cred rm— delete a file, or remove one.envkey.
Deliberate omissions
There is no cred get. Printing a credential to stdout is how it reaches a shell history, a log, or a transcript. For running a command with a secret in its environment use gopass env; for encryption at rest use sops or dotenvx; for password management use pass, gopass, or the 1Password CLI.
Behaviour worth knowing
- Duplicate
.envkeys are refused, not guessed. Which occurrence a loader honours isn't portable, soset --nameandshow --nameerror rather than risk acting on a value that isn't in effect.rm --nameremoves every occurrence and is the escape hatch. set,showandrmall refuse a destination that isn't a plain file — a directory, or a symlink even when it points at a real credential.--modealways applies to a standalone file so a credential stays tight; an existing.envkeeps the mode it has, since other tooling reads it.- Values are byte-identical to what you type or paste, including non-UTF-8 input.