Snug CLI
Snug's command line lets your agent use your keys without seeing them.
Install
The snug command comes inside the app. When you first open Snug, click Copy install command and paste it into a terminal. It asks for your password.
For Snug in Applications, this is the same command:
sudo mkdir -p /usr/local/bin && sudo ln -sf '/Applications/Snug.app/Contents/Helpers/snug' /usr/local/bin/snugThen snug --version prints the version. Snug must be running for every command.
snug wait
Waits until you copy a secret, then prints its ref, its kind and the end of the value, never the value.
--secretRequired. Waits for a secret.--timeout <seconds>How long to wait. The default is 90 seconds.--recent <seconds>Also takes a secret you copied up to that many seconds before the command started.--name NAMENames the key, when the copy held one key.--jsonPrints JSON.
snug wait --secretsnug list --secrets
Shows the secrets Snug keeps: ref, kind, the end of the value, dates and label.
--secretsRequired. Lists the secrets.--jsonPrints JSON.
snug list --secretssnug list --clips
Shows your newest clips, or the clips of one pinboard: id, kind, source app, time and a short preview. A key shows its ref, never a value.
--clipsRequired. Lists clips.--kind <kind>Only clips of this kind: text, link, color, image, file or key.--limit <n>How many clips, newest first. The default is 20, at most 200.--search <words>Only clips that match these words.--pinboard <name>Only clips of this pinboard.--app <name>Only clips copied in this app, by its name or bundle id.--jsonPrints JSON.
snug list --clips --search invoicesnug get
Prints one clip by its id. Text, a link or a color goes to the output. A picture is saved to a file and its path is printed. A file clip prints its paths. A key is never printed.
<id>The clip's id, from list --clips.--out <dir>The folder for a picture. Without it, a new folder under $TMPDIR.--jsonPrints JSON.
snug get 3f9a2c41snug get --latest
Prints your newest clip, the same way as get.
--latestRequired. Takes the newest clip.--kind <kind>Only clips of this kind: text, link, color, image, file or key.--out <dir>The folder for a picture. Without it, a new folder under $TMPDIR.--jsonPrints JSON.
snug get --latest --kind imagesnug pinboards
Shows your pinboards: name, color and number of clips.
--jsonPrints JSON.
snug pinboardssnug pins
Shows the pins of one pinboard in their order, with the index of each, 0 the first.
<pinboard>The pinboard's name, from snug pinboards.--limit <n>How many pins. The default is 200.--jsonPrints JSON.
snug pins Work --limit 50snug pin
Pins a clip to a pinboard, like Pin to in the app: a copy goes to the front, and the clip stays in your history. A key is pinned by its ref, never by its value. Prints the id of the pin.
<id|ref>The clip's id from list --clips, or a key's ref such as sec_7f3a.--to <pinboard>Required. The pinboard to pin to.--jsonPrints JSON.
snug pin 3f2a9c1e --to Worksnug pin --latest
Pins your newest clip, the same way as pin.
--latestRequired. Takes the newest clip.--kind <kind>Only clips of this kind: text, link, color, image, file or key.--to <pinboard>Required. The pinboard to pin to.--jsonPrints JSON.
snug pin --latest --kind link --to Worksnug unpin
Takes a clip out of a pinboard. The clip in your history stays.
<id|ref>A pin's id. With --from, a clip's id or a key's ref.--from <pinboard>The pinboard to take the clip out of.--jsonPrints JSON.
snug unpin 7c1d9e02snug move
Moves a pin to another pinboard, or to another place in its pinboard.
<id>The pin's id, from pin or pins.--to <pinboard>Another pinboard. The pin goes first there.--index <n>The new place in the pinboard, 0 the first.--before <id>Puts the pin before this pin.--after <id>Puts the pin after this pin.--jsonPrints JSON.
snug move 7c1d9e02 --index 2snug pinboards create
Makes a new pinboard.
<name>The name of the new pinboard.
snug pinboards create Latersnug pinboards rename
Gives a pinboard a new name.
<pinboard>The pinboard's name, from snug pinboards.<new name>The new name.
snug pinboards rename Later "Next week"snug pinboards delete
Deletes a pinboard and its pins, never a clip of your history. Without --yes it deletes nothing and says what would go. With --yes, Snug still asks you every time.
<pinboard>The pinboard's name, from snug pinboards.--yesDeletes for real. Without it, nothing changes.
snug pinboards delete Later --yessnug pinboards color
Gives a pinboard another color.
<pinboard>The pinboard's name, from snug pinboards.<color>The new color: red, orange, yellow, green, teal, blue, purple or pink.
snug pinboards color Later tealsnug pinboards move
Moves a pinboard to another place in the row, or one place left or right.
<pinboard>The pinboard's name, from snug pinboards.<index|left|right>The new place in the row, 0 the first, or one place left or right.
snug pinboards move Later 0snug delete
Deletes a clip of your history or a pin, with no undo. Without --yes it deletes nothing. Snug asks you every time. A key is refused.
<id>The clip's id, from list --clips.--yesDeletes for real. Without it, nothing changes.--jsonPrints JSON.
snug delete 3f2a9c1e --yessnug edit
Gives a text, link or color clip new plain text from standard input. A text that holds a secret is refused, and so is a key.
<id>The clip's id, from list --clips.--jsonPrints JSON.< fileThe new text comes from standard input, exactly as it is.
snug edit 3f2a9c1e < note.txtsnug revert
Takes an edited clip back to what was copied.
<id>The clip's id, from list --clips.--jsonPrints JSON.
snug revert 3f2a9c1esnug mark-secret
Moves the text of a clip into Snug's vault as a key and prints its ref. Every copy of the text leaves your history and pinboards.
<id>The clip's id, from list --clips.--jsonPrints JSON.
snug mark-secret c81d07aasnug rename
Gives a key or a clip a new name. Only the name changes, never a value, and a name that holds a key is refused. No panel asks, and you see the rename in Activity.
<id|ref>The clip's id from list --clips, or a key's ref such as sec_7f3a.<name>The new name, at most 64 characters.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug rename sec_7f3a "Stripe test key" --reason "name the key you just copied"snug rename <id|ref> --clear
Removes the name of a key or a clip.
<id|ref>The clip's id from list --clips, or a key's ref such as sec_7f3a.--clearRequired. Removes the name.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug rename 3f2a9c1e --clear --reason "the title was wrong"snug grants
Shows the grants of your keys, as Keys shows them, and whether raw use is allowed.
<ref>Only this key. Without it, the keys that have grants.--jsonPrints JSON.
snug grants sec_7f3asnug activity
Shows the newest rows of Keys > Activity: who used a key, how and the result. The reasons agents gave are for you only.
<ref>Only the rows of this key.--limit <n>How many rows, newest first. The default is 50, at most 500.--jsonPrints JSON.
snug activity sec_7f3a --limit 20snug runs
Shows the live runs of run --proxy.
--jsonPrints JSON.
snug runssnug revoke
Revokes the grants of a key for one action or one program or env file. The next use asks you again.
<ref>The secret to use, such as sec_k2mq.--action run|pipe|put|proxyOnly the grants of this action.--target <path|name>Only the grants of this program or env file, by its path or its name.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug revoke sec_7f3a --action run --target node --reason "the script is done"snug revoke <ref> --all
Revokes every grant of a key.
<ref>The secret to use, such as sec_k2mq.--allRequired. Every grant of the key. Raw use stays.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug revoke sec_7f3a --all --reason "the project is finished"snug raw-use stop
Stops raw use of keys, so they work through the proxy only again.
<ref>...One or more keys, such as sec_7f3a.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug raw-use stop sec_7f3a --reason "the proxy serves this key"snug runs stop
Ends a live proxy run, or every live run of a key. The program gets 401 on its next call.
<run id|ref>A run id from snug runs, or a key's ref for all its runs.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug runs stop sec_7f3a --reason "the test loop hangs"snug grants stop-hour
Ends the 1 hour grants of clip reads and changes in this project, or in every project.
--allThe grants of every project, not only this one.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug grants stop-hour --reason "done with the clips"snug stop
Turns on Stop All Agent Access: every run ends and every later agent request is refused. Only you turn it back on.
--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug stop --reason "a script leaked output"snug phone revoke
Revokes the iPhone paired for Approve from iPhone, so its answers count no more. Only you pair a phone again.
--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug phone revoke --reason "you lost the phone"snug copy
Puts a clip on your clipboard, like Copy in the app. It is asked like a read. A key is refused.
<id>The clip's id, from list --clips.--plainCopies the plain text alone.--jsonPrints JSON.
snug copy 3f2a9c1e --plainsnug capture resume
Starts the recording of copies again.
--jsonPrints JSON.
snug capture resumesnug settings
Shows what your settings say: the pause, Keep History, the capture rules, ignored apps, the agent switches and more. No keys.
--jsonPrints JSON.
snug settings --jsonsnug switch
Turns a setting off, the side that only takes access away. No panel asks.
<setting>clip-reads, clip-changes, auto-value, link-previews or screen-sharing.offRequired. Turns it off.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug switch clip-reads off --reason "the task with clips is done"snug ask delete-key
Asks you to delete a key.
<ref>The secret to use, such as sec_k2mq.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask delete-key sec_k2mq --reason "the old test key was rotated"snug ask raw-use
Asks you to allow raw use of keys, so run --env, pipe and put can hand out their values.
<ref>...One or more keys, such as sec_7f3a.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask raw-use sec_7f3a --reason "the SDK reads the key from a file"snug ask resume
Asks you to turn agent access back on after Stop All Agent Access.
--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask resume --reason "you said the stop was a mistake"snug ask not-a-secret
Asks you to turn a key back into text in your history.
<ref|id>A key's ref, or the id of its card.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask not-a-secret sec_k2mq --reason "it is a public build id"snug ask revert-value
Asks you to bring back the value a key had before its last Replace Value.
<ref>The secret to use, such as sec_k2mq.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask revert-value sec_k2mq --reason "the new value fails with 401"snug ask erase-history
Asks you to erase your clipboard history. Pinboards and keys stay.
--yesRequired. Without it, nothing is asked.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask erase-history --yes --reason "you asked to start clean"snug ask keep-history
Asks you to change how long your history is kept.
<day|week|month|year|forever>How long to keep the history.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask keep-history week --reason "you asked to keep less history"snug ask switch
Asks you to turn a setting on, or either way for the capture rules.
<setting>clip-reads, clip-changes, auto-value, link-previews, screen-sharing, ignore-confidential or ignore-transient.on|offWhich side to turn it to.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask switch auto-value on --reason "you asked for Auto value"snug ask unignore-app
Asks you to record the copies of an ignored app again.
<bundle id|name>A bundle id, or the name of an app that copied a clip.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask unignore-app com.apple.Notes --reason "you asked to record Notes again"snug ask always-load
Asks you to load the link previews of a host with no click.
<host>A host name such as example.com.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask always-load example.com --reason "show previews of the docs links"snug ask pause
Asks you to pause the recording of copies. While paused, a key you copy stays on the clipboard as text.
--for <minutes>How many minutes, 1 to 1440. Without it, until resumed.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask pause --for 30 --reason "the build prints test tokens"snug ask ignore-app
Asks you to stop recording the copies of an app. A key you copy there stays on the clipboard as text.
<bundle id|name>A bundle id, or the name of an app that copied a clip.--reason <text>Required. Why, in a few words, up to 120 characters. Also -r. You see it in Snug.--jsonPrints JSON.
snug ask ignore-app com.example.Passwords --reason "you asked not to save its copies"snug mcp
Starts Snug's MCP server, so agents that use MCP can read your clipboard history. It never reads a key.
snug mcpsnug run --proxy
Runs a command with the key behind Snug's proxy. The command gets a placeholder and a local base URL, never the key.
--proxy NAME=<ref>Puts the placeholder in NAME and the provider's key variables, and the local base URL in its base URL variable. Repeat it for more keys.--env NAME2=<ref2>Adds a key the proxy cannot serve, as a value in the environment.--reason <text>Required. Why the agent needs the key, in a few words, up to 120 characters. Also -r. Snug shows it to you on the Allow panel.-- <command> [args...]The command to run, as you would type it.
snug run --proxy ANTHROPIC_API_KEY=sec_7f3a --reason "try the chat feature" -- python3 script.pysnug run --env
Runs a command with the values in its environment, for keys the proxy cannot serve.
--env NAME=<ref>Sets NAME to the value. Repeat it for more keys.--reason <text>Required. Why the agent needs the key, in a few words, up to 120 characters. Also -r. Snug shows it to you on the Allow panel.-- <command> [args...]The command to run, as you would type it.
snug run --env STRIPE_WEBHOOK_SECRET=sec_k2mq --reason "run the webhook tests" -- npm testsnug pipe
Sends the value to the command's standard input.
<ref>The secret to use, such as sec_k2mq.--newlineSends a newline after the value. Without it, none is sent.--reason <text>Required. Why the agent needs the key, in a few words, up to 120 characters. Also -r. Snug shows it to you on the Allow panel.-- <command> [args...]The command to run, as you would type it.
snug pipe sec_k2mq --reason "set the worker's webhook secret" -- wrangler secret put STRIPE_WEBHOOK_SECRETsnug put
Writes the value into an env file. Use it only when a tool reads keys from a file and nothing else.
<ref>The secret to use, such as sec_k2mq.--file <path>The env file to write.--key NAMEThe variable name. Snug replaces its line or adds one.--reason <text>Required. Why the agent needs the key, in a few words, up to 120 characters. Also -r. Snug shows it to you on the Allow panel.
snug put sec_k2mq --file .env --key STRIPE_WEBHOOK_SECRET --reason "local dev server reads .env"snug put --secret
Saves a new key in Snug from standard input. You save it with Touch ID every time, and the agent gets its ref.
--secretRequired. Reads the new key from standard input, never from an argument.--name NAMEThe label of the new key in Snug.--reason <text>Required. Why the agent needs the key, in a few words, up to 120 characters. Also -r. Snug shows it to you on the Allow panel.
snug put --secret --name "Sparkle key" --reason "save the new update key" < key.txtSafe by default
- The
snugcommand never prints a value. [secret <ref>]stands in for every value in the output ofrunandpipe.- The first time a program uses a secret in a project, Snug asks you in the app. It asks again if the program changed.
- The first change to your clips or pinboards in a project asks you in the app. A delete needs --yes and asks you every time.
- Some changes only you make, such as deleting a key. An agent asks with snug ask, and you allow it on the Mac with Touch ID every time.
- Agents use keys, read clips and change clips and pinboards only with a Snug license.