@privacy-com/privacy-cli
v0.2.3
Published
CLI for the Privacy.com API - manage virtual cards and transactions from the terminal
Downloads
83
Readme
@privacy-com/privacy-cli
Terminal CLI for the Privacy.com API. Manage virtual cards and transactions from the command line, with an interactive REPL mode.
Prerequisites
Getting Started
npm install -g @privacy-com/privacy-cli
privacyOn first run, the CLI will prompt for your API key and save it to ~/.privacy/config for future use.
Commands
Cards
privacy cards list [--page <n>] [--page-size <n>] # List all cards
privacy cards create --type <type> [options] # Create a card
privacy cards get <token> # Get card details
privacy cards update <token> [options] # Update card settings
privacy cards pause <token> # Pause a card
privacy cards unpause <token> # Unpause a card
privacy cards close <token> # Close a card (permanent)
privacy cards pan <token> # Get full PAN, CVV, expiryCard types: SINGLE_USE (closes after first use), MERCHANT_LOCKED (locks to first merchant)
Note: CATEGORY_LOCKED cards appear in list/get output but cannot be created via CLI. To create a Category Locked card, use the Privacy Dashboard at app.privacy.com.
Create options: --memo <text>, --spend-limit <dollars>, --spend-limit-duration <TRANSACTION|MONTHLY|ANNUALLY|FOREVER>
Update options: --memo <text>, --spend-limit <dollars>, --spend-limit-duration <duration>, --state <OPEN|PAUSED>, --pin <pin>
Transactions
privacy transactions list [options] # List transactionsOptions: --begin <YYYY-MM-DD>, --end <YYYY-MM-DD>, --card-token <token>, --result <APPROVED|DECLINED>, --page <n>, --page-size <n>
Interactive REPL
privacy # start REPL (default when no command given)
privacy interactive # explicit REPL modeIn the REPL, type commands without the privacy prefix:
privacy> cards list
privacy> cards create --type SINGLE_USE --memo "Coffee" --spend-limit 10
privacy> transactions list --begin 2025-01-01
privacy> help
privacy> exitThe REPL includes fuzzy command matching — if you mistype a command, it suggests the closest match.
Output Modes
| Mode | When | Description |
|------|------|-------------|
| Table | TTY terminal (default) | Aligned columns, right-aligned monetary values, pagination footer |
| JSON | Non-TTY / --json flag | Compact JSON, monetary values formatted as $X.XX |
| Wide | --wide flag | Table mode with all fields shown |
Authentication
The CLI resolves your API key in this order:
PRIVACY_API_KEYenvironment variable~/.privacy/configfile (JSON withapi_keyfield)- Interactive prompt (saves to
~/.privacy/configwith0600permissions)
Global Options
| Option | Description |
|--------|-------------|
| --json | Force JSON output |
| --wide | Show all fields in table mode |
| --version | Show CLI version |
| --help | Show help text |
