Package Exports
- @privacy-com/privacy-cli
- @privacy-com/privacy-cli/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@privacy-com/privacy-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.
Quick Start
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. Requires Node.js >= 20 and a Privacy.com API key.
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), VIRTUAL (standard virtual card)
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 |
Development
From the repository root:
npm install
npm run build --workspace=packages/api # build API dependency first
npm run build --workspace=packages/cli # build CLI
npm test --workspace=packages/cli # run tests
npm run lint --workspace=packages/cli # lint + type check