Guides

Copyable commands for common Pock tasks. Pock encrypts secrets on your device before upload. Start by installing the CLI with curl -fsSL https://pock.sh/install | sh.

Guide 1

Inject secrets into a program (no .env on disk)

pock run decrypts a folder's secrets and starts your command with those values as environment variables. Pock does not write the plaintext to a .env file.

one-time: store secrets
pock login
pock vault set app DATABASE_URL=postgres://… STRIPE_KEY=sk_live_…
run your app with them injected
pock run -p app -- npm start
# or: pock run -p app -- node server.js
# or: pock run -p app -- ./deploy.sh

Your shell expands $VARS before Pock runs. Print a value from the child process:

terminal
pock run -p app -- printenv DATABASE_URL
pock run -p app -- sh -c 'echo "$DATABASE_URL"'
Security details · Pock sends encrypted blobs to the service. Decryption runs in the CLI, which supplies the resulting values to the command you started.

Guide 2

Use Pock in GitHub Actions (scoped machine key)

Give the CI job a machine key that can decrypt one subtree. A compromised runner exposes the secrets that were granted to that key.

1. Put the job's secrets under one folder, then create a scoped key and write it directly to the repository's GitHub Actions secrets. The Pock CLI passes each value to gh over standard input without printing it or using the clipboard:

on your machine
pock vault set acme.web.prod DATABASE_URL=… STRIPE_KEY=…
pock vault machine create acme.web.prod --github <owner>/<repo>
# ✓ writes POCK_MACHINE_KEY + POCK_TOKEN to the repo's GitHub secrets

(Omit --github to print the values and add them by hand.) 2. Use them in the workflow:

.github/workflows/deploy.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      POCK_TOKEN: ${{ secrets.POCK_TOKEN }}
      POCK_MACHINE_KEY: ${{ secrets.POCK_MACHINE_KEY }}
    steps:
      - run: curl -fsSL https://pock.sh/install | sh && echo "$HOME/.pock/bin" >> "$GITHUB_PATH"
      - run: pock run -p acme.web.prod -- npm run deploy

CI uses the machine key and token, with no interactive login. After adding secrets under the scope, re-run pock vault machine create acme.web.prod to include them. List with pock vault machine ls, revoke with pock vault machine rm <id>.

Security details · The machine can decrypt only items re-encrypted to its public key. Re-run the create command after adding items to the scope. Removing the machine record does not erase ciphertext or keys already copied to a runner; rotate the underlying secrets after a compromise.

Guide 3

Set up Pock on a new machine

Pock stores your vault ciphertext on the service. To use it on another laptop or server, link that device once with your passphrase and Secret Key.

terminal
curl -fsSL https://pock.sh/install | sh
pock login
pock vault link          # enter your Secret Key + passphrase once

After linking, the local vault file holds the Secret Key and your passphrase opens the vault. Commands such as pock run and vault get can then decrypt values. On the web, "Set up this device" performs the equivalent setup.

Security details · The Secret Key is stored locally in ~/.pock/vault.json and combined with your passphrase during decryption. Pock's service does not store that Secret Key. See Passphrase & Secret Key.

Guide 4

Import a .env, then export or run with it

Import an existing .env, then export it as a file or supply its values to a process. The import creates secret items and a reusable environment, a named view that preserves the exported variable names.

terminal
pock vault import .env --env prod          # creates secrets + a 'prod' environment
pock run -e prod -- npm start              # inject the environment's secrets
pock vault env export prod --file .env     # write it back out as a .env

-p <folder> injects a folder's secrets (item names = var names). -e <environment> injects an environment's secrets (export keys = var names).

Guide 5

Other CI / non-interactive (the env-var reference)

Any pipeline can drive Pock with environment variables. Supply one authentication variable and one decryption option:

the variables Pock reads
# Auth (pick one)
POCK_TOKEN=…          # a bearer token from 'pock token' (skips 'pock login')

# Decryption (pick one)
POCK_MACHINE_KEY=…    # a scoped machine key (best for CI - decrypts one subtree)
POCK_SECRET_KEY=…     # your account Secret Key (full vault access)
POCK_PASSPHRASE=…     # your passphrase (with a local vault.json, or with POCK_SECRET_KEY)

# Optional
POCK_BASE=https://www.pock.sh   # override the server
example: GitLab CI / any runner
export POCK_TOKEN="$POCK_TOKEN" POCK_MACHINE_KEY="$POCK_MACHINE_KEY"
pock run -p acme.web.prod -- ./release.sh
Security details · Use POCK_MACHINE_KEY for automation when one subtree is sufficient. The key can decrypt only the items explicitly encrypted to its public key.

Guide 6

Reset a forgotten passphrase

Your recovery code, saved during setup, can open the vault and let you set a new passphrase. On the web, choose "Forgot your passphrase? Use your recovery code." Enter the code, then set a new passphrase if this device has your Secret Key.

Security details · Without either the passphrase or recovery code, the vault cannot be decrypted. Pock cannot restore those factors. Keep the recovery code separately from your passphrase.

Guide 7

Back up your vault to a file

Open your account menu → Vault → Encrypted backup and choose a backup passphrase. Pock decrypts the readable secrets, seals them into a single .pockvault file, and downloads it. Store that file wherever you keep important backups.

To restore, come back to the same panel, pick the file, enter its passphrase, and Pock decrypts it locally so you can preview and re-import the secrets.

Security details · The standalone backup uses Argon2id and XChaCha20-Poly1305 with its own passphrase. Your account and Secret Key are not involved. Use a long, unique backup passphrase: anyone who has both the file and that passphrase can read its contents.

Guide 8

Rotate your keys

From your account menu → Vault → Rotate your keys you can change any factor without wiping the vault:

Change passphrase, rotate Secret Key, and rotate recovery code replace the corresponding wrap around your account key. Secret items are not re-encrypted. A new Secret Key or recovery code is shown once; save it before closing.

Use rotate identity keys after a suspected compromise. It creates a new keypair and re-encrypts every readable personal secret to that key. Open protected namespaces first. Item history and trash are cleared because those blobs use the old key; team secrets require separate re-keying by a team admin.

Security details · The client creates the new wraps and sends sealed blobs to the service. After a factor rotation, the previous passphrase or Secret Key can no longer open the current wrap.
Setting up an AI agent? Pock for agents.
More detail: CLI reference · the CLI, explained · how the security works