monkeys

preview

Show a secret masked, never in full.

monkeys preview [@profile] [KEY[,KEY...]]

Answers the question you usually have, which is whether the right secret is in there, without printing it:

monkeys preview
GITHUB_TOKEN        gh...f 40
OPENROUTER_API_KEY  sk...2 73

It shows the first two characters, the last one, and the length. A secret is masked whole whenever fewer than five characters would stay hidden, so nothing under eight characters long gives any of itself away:

monkeys preview SHORT_ONE
SHORT_ONE  ... 6

A length and a two-character prefix are enough to tell a secret pasted whole from one that lost a character on the way, or one provider's from another's.

With no keys, preview shows every key in the profile: those with no profile outside a project, the file's keys inside one. A value line is shown as it is, after the secrets, since it is public:

monkeys preview
DATABASE_URL       po...t 29
STRIPE_SECRET_KEY  sk...p 34
PORT               3000
API_URL            http://localhost:8080

A leading @profile shows another one the file declares, which is how you tell a production secret from the test one that shares its key:

monkeys preview @production
DATABASE_URL  po...p 43
SENTRY_DSN    ht...9 44