@coffrify/cli
v0.5.0
Published
Official CLI for Coffrify — encrypted file transfer infrastructure. Init wizard, code generation (types, webhook handlers, CI), health doctor, deploy via coffrify.config.json, audit (log/export/search), analytics, webhooks (tail/logs/replay/rotate), keys
Maintainers
Readme
@coffrify/cli
The official command-line tool for Coffrify — encrypted file-transfer
infrastructure. Ships as coffrify (with the cfy alias) and covers every
public Coffrify resource: transfers, webhooks, API keys, audit log,
analytics, custom domains, branding, billing, status, code generation and
CI bootstrap.
npm install -g @coffrify/cli
# or
pnpm add -g @coffrify/cli
# or
bun add -g @coffrify/cliQuickstart
# 1. Interactive wizard: auth + workspace + .env.local + coffrify.config.json
coffrify init
# 2. Send a file
coffrify transfers send report.pdf --expires-in 7d --max-downloads 10
# 3. Run a full health check
coffrify doctor
# 4. Stream live webhook deliveries
coffrify webhooks tailGlobal flags
Every command supports:
| Flag | Description |
| ----------- | ------------------------------------------------------------------------ |
| --json | Emit structured JSON to stdout (scriptable). Logs go to stderr. |
| --quiet | Suppress all output — exit code only. |
| --verbose | Print debug logs to stderr. |
Combine with shell tooling:
coffrify transfers list --json | jq '.[] | select(.status=="active")'Authentication
coffrify init # interactive wizard
coffrify init --api-key cof_xxx # non-interactive
coffrify init --non-interactive \ # CI-friendly
--api-key cof_xxx \
--workspace ws_xxx \
--env live \
--write-env --write-configConfig is stored at ~/.coffrify/config.json (chmod 0600). Override with
env vars: COFFRIFY_API_KEY, COFFRIFY_API_URL, COFFRIFY_WORKSPACE_ID.
Commands
coffrify init
Interactive bootstrap: API key, workspace selection, environment, default
scope, .env.local wiring (auto-detects git repo and updates .gitignore),
and optional coffrify.config.json generation.
coffrify whoami
Show the authenticated workspace, plan, env, scopes and API-key prefix.
coffrify transfers …
| Subcommand | Description |
| --------------------- | -------------------------------------------------------------- |
| list | Recent transfers (paginated) |
| send <files…> | Create + upload |
| get <id> | Full transfer details |
| delete <id> | Delete a transfer |
coffrify transfers send build.zip src/*.tar.gz --expires-in 30d --max-downloads 50coffrify webhooks …
| Subcommand | Description |
| --------------------------- | --------------------------------------------------------------- |
| list | List webhooks |
| create | Create (interactive) — secret shown once |
| test <id> | Send a sandbox ping |
| tail [id] | Stream deliveries (tail -f style; polling) |
| filter-tail --filter=… | Tail with SSE + glob filter (e.g. transfer.*) |
| logs <id> | Last N deliveries (filter by status) |
| replay <delivery_id> | Replay a past delivery |
| rotate-secret <id> | Mint a new signing secret with grace window |
| delete <id> | Delete a webhook |
| events [--family=…] | List every supported event type |
| listen [--secret=…] | Spin up a local HTTP receiver — for dev / ngrok |
coffrify webhooks filter-tail --filter='transfer.*' --interval 2s
coffrify webhooks logs wh_abc --limit 100 --status failedcoffrify keys … (alias of api-keys)
| Subcommand | Description |
| ----------------------------- | ------------------------------------------------------------ |
| list | List keys |
| create <name> | Create (existing API, --expires-in-days) |
| mint <name> --expires=30d | Ergonomic alias accepting 30d, 90d, 1y |
| revoke <id> | Revoke a key (with optional --reason) |
| rotate <id> | Mint new + keep old valid during grace |
| stats [id] | Usage stats (single or all) |
| inspect <id> | Full metadata + recent activity |
coffrify audit …
coffrify audit --since 24h # back-compat tail
coffrify audit log --since 7d --action transfer.
coffrify audit export --format ndjson --out audit.ndjson --since 30d
coffrify audit search "transfer.deleted" --since 7dcoffrify analytics …
coffrify analytics summary --days 30
coffrify analytics bandwidth --days 14 # ASCII sparkline
coffrify analytics top-transfers --limit 10coffrify generate …
Code generation utilities. The OpenAPI fetcher pulls the live spec from your configured API URL.
| Subcommand | Description |
| ------------------------------------------------ | -------------------------------------------- |
| types --out=types.ts | TypeScript types |
| types --lang=python --out=coffrify_types.py | Python TypedDicts |
| webhook-handler --framework=express | Scaffold an Express POST handler |
| webhook-handler --framework=next | Next.js App Router route handler |
| webhook-handler --framework=hono | Hono handler |
| webhook-handler --framework=fastify | Fastify plugin |
| ci --provider=github | .github/workflows/coffrify.yml |
| ci --provider=gitlab | .gitlab-ci.yml |
| ci --provider=circleci | .circleci/config.yml |
coffrify doctor
Composite health-check across connectivity, API key, quotas, webhooks (with
optional live ping), custom-domain certificates, recent audit anomalies and
the server-side workspace health score. Outputs a graded report
(A–F) and actionable recommendations.
coffrify doctor # full check
coffrify doctor --no-ping # skip live webhook ping (faster)
coffrify doctor --fail-below 75 # exit 2 if score < 75 (CI gate)
coffrify doctor --json | jq '.score'coffrify deploy [name]
Config-as-code uploads driven by coffrify.config.json:
{
"workspace_id": "ws_xxx",
"environment": "live",
"upload": {
"include": ["dist/**/*.zip", "release/*.tar.gz"],
"exclude": [".DS_Store"],
"expires_in": "30d",
"max_downloads": 100,
"password": "optional"
}
}coffrify deploy # uses ./coffrify.config.json
coffrify deploy --config ./prod.json # custom config
coffrify deploy --dry-run # validate without uploading
coffrify deploy --json # structured outputcoffrify migrate …
coffrify migrate from-wetransfer --csv ./export.csv
coffrify migrate from-smash --json ./export.json
coffrify migrate to-archive --before 2025-01-01 --out cold-archive.ndjsonfrom-wetransfer and from-smash parse the vendor export, normalise it,
and create matching transfers. to-archive walks expired transfers older
than a cutoff into an NDJSON cold-storage file.
coffrify open …
| Subcommand | Description |
| --------------------------- | ----------------------------------------------------------- |
| dashboard [--section=…] | Open https://app.coffrify.com[/section] |
| transfer <id_or_short> | Open the share page |
| docs [topic] | Open the documentation (sdk, cli, webhooks, api, …) |
| status | Public status page |
| short <id_or_url> | Back-compat: open a transfer by short code or URL |
coffrify env …
coffrify env pull --out .env.local # writes COFFRIFY_API_URL, _WORKSPACE_ID, _API_KEY, _ENV
coffrify env pull --overwrite # replace existing local values
coffrify env diff --file .env.local # compare local vs remotecoffrify status [--json]
Status of every Coffrify service plus recent incidents. Exit code reflects the overall state (0 = operational, 1 = degraded/partial, 2 = major outage) — useful for monitoring scripts.
coffrify completion <shell>
coffrify completion bash > /etc/bash_completion.d/coffrify
coffrify completion zsh > /usr/local/share/zsh/site-functions/_coffrify
coffrify completion fish > ~/.config/fish/completions/coffrify.fish
coffrify completion powershell | Out-String | Invoke-Expressioncoffrify upgrade
coffrify upgrade # checks npm + installs latest
coffrify upgrade --check # only check, don't install
coffrify upgrade --pkg-manager pnpm # use pnpm instead of npmThe CLI also runs a background update check (cached 24h) on every
invocation and shows a non-blocking banner when a newer version is
available. The banner is suppressed in --json / --quiet mode.
coffrify watch <folder>
Auto-upload files added/modified in a folder (debounced). Useful for screen recording uploads, design-asset pipelines, etc.
coffrify watch ~/Desktop/Coffrify-drop --expires-in 24h --debounce 2000coffrify pipe
Stream stdin to a transfer:
pg_dump prod | gzip | coffrify pipe --name "backup-$(date +%F).sql.gz" --expires-in 7dcoffrify config
coffrify config --show # print resolved config (API key redacted)
coffrify config --reset # wipe local configcoffrify project
coffrify project --init # legacy .coffrify.json wizard
coffrify project --show # show resolved configOutput examples
Text (default)
$ coffrify doctor
Coffrify health: 88/100 (grade B)
────────────────────────────────────────────────────────────
✓ API reachability Connected as Evorax Studio (live) (15/15)
✓ API key validity Active key with 4 scopes (15/15)
! Quota headroom At 82% of quota (10/20)
→ Consider upgrading soon.
✓ Webhook health 3 webhook(s) healthy (15/15)
✓ Webhook ping Ping → CI hook: 200 in 142ms (10/10)
…JSON
$ coffrify doctor --json
{
"score": 88,
"grade": "B",
"total": 113,
"max": 130,
"checks": [
{ "name": "API reachability", "status": "pass", "score": 15, "max": 15, "detail": "Connected as …" },
…
]
}CI / CD
A typical GitHub Actions workflow (generated by coffrify generate ci):
- run: npm i -g @coffrify/cli
- env:
COFFRIFY_API_KEY: ${{ secrets.COFFRIFY_API_KEY }}
run: |
coffrify transfers send dist/app.zip --expires-in 30d --json > coffrify.json
echo "share_url=$(jq -r .share_url coffrify.json)" >> "$GITHUB_OUTPUT"
- run: coffrify doctor --fail-below 80 # gate on health scoreAliases
cfy is an alias for coffrify:
cfy transfers list
cfy webhooks filter-tail --filter 'transfer.*'
cfy doctor --json | jq '.grade'Engines
Node ≥ 18. Works on macOS, Linux, Windows. CI-tested under Bash, Zsh, Fish and PowerShell completions.
License
MIT — © Coffrify
