A modern, TypeScript-based command-line interface to interact with the Pressable API. Built for Node.js and Bun.
- TypeScript & ESM: Fully typed for better developer experience and modern standards.
- Bun Support: Native support for the Bun runtime.
- Fetch API: Uses native
fetch(Node 18+) for cross-runtime compatibility. - 100% API Coverage: Supports all documented endpoints in the Pressable API v1.
- Raw JSON Output: All commands output pretty-printed JSON, perfect for piping into
jq. - Interactive Feedback: Real-time terminal spinners during network requests.
-
Clone the repository:
git clone https://github.com/your-username/pressable-cli.git cd pressable-cli -
Install dependencies:
npm install # OR bun install -
Build the project:
npm run build
-
Link for global access:
npm link
The CLI supports two methods of authentication. The local configuration file is the preferred method for most users.
Run the login command to securely save your credentials to ~/.pressable.json:
pressable auth-login --client-id <your_id> --client-secret <your_secret>Other authentication commands:
pressable auth-status- Check current authentication status and source.pressable auth-logout- Delete saved credentials.
You can also use a .env file in the project root or set environment variables directly:
PRESSABLE_API_CLIENT_ID=your_client_id
PRESSABLE_API_CLIENT_SECRET=your_client_secretThe CLI provides comprehensive management for your Pressable account and sites.
pressable account- Get account detailspressable account-update --php <v> --datacenter <id>- Update default account settingspressable account-actions- Get detailed account activitypressable account-addons- List account add-onspressable datacenters- List all available datacenterspressable php-versions- List supported PHP versions
pressable sites [--search <term>] [--page <n>] [--limit <n>]- List/search sitespressable site <siteId>- Get site detailspressable create-site --name <name>- Create a new sitepressable delete-site <siteId>- Delete a sitepressable site-validate <name>- Check if a site name is availablepressable site-disable <siteId>- Disable a sitepressable site-enable <siteId>- Enable a sitepressable site-convert <siteId> <live|staging|sandbox>- Change site environment typepressable site-clone <siteId>- Clone a site (requires additional params)pressable site-flush-cache <siteId>- Flush object cachepressable site-maintenance <siteId> <on|off>- Toggle maintenance modepressable site-multisite <siteId> <on|off>- Toggle multisite supportpressable site-favorite <siteId>- Toggle favorite statuspressable site-login <siteId>- Get One-Press Login URL
pressable backups <siteId>- List all backupspressable create-backup <siteId>- Create a standard backuppressable restore-backup <siteId> <backupId>- Restore a backuppressable site-ondemand-backups <siteId>- List on-demand backupspressable site-ondemand-backup-create <siteId>- Create an on-demand backuppressable site-ondemand-backup-download <siteId> <id>- Get download link for on-demand backup
pressable site-domains <siteId>- List domainspressable site-domain-add <siteId> <domain>- Add a domainpressable site-domain-delete <siteId> <id>- Remove a domainpressable site-domain-primary <siteId> <id>- Set primary domainpressable site-sftp-users <siteId>- List SFTP userspressable site-sftp-reset <siteId> <user>- Reset SFTP password
pressable plugins <siteId>- List pluginspressable plugin-install <siteId> <slug>- Install a pluginpressable plugin-activate <siteId> <slug>- Activate a pluginpressable plugin-deactivate <siteId> <slug>- Deactivate a pluginpressable plugin-delete <siteId> <slug>- Delete a pluginpressable themes <siteId>- List themespressable theme-install <siteId> <slug>- Install a themepressable theme-activate <siteId> <slug>- Activate a themepressable themes-delete <siteId> <slug>- Delete a themepressable wp-cli <siteId> "<command>"- Run a WP-CLI commandpressable site-bash <siteId> "<command>"- Run a Bash command on the server
pressable site-logs-php <siteId>- Get PHP logspressable site-logs-server <siteId>- Get server logspressable site-logs-activity <siteId>- Get site activity logspressable site-stats <siteId>- Get site statisticspressable site-metrics <siteId>- Get performance metricspressable site-security-alerts <siteId>- Get security alertspressable site-firewall-rules <siteId>- List egress firewall rulespressable site-cron <siteId>- List cron jobspressable site-usage-limits <siteId>- Get DB/FS usage limits
The project includes a full suite of development tools:
npm test- Run unit tests with Vitest.npm run lint- Run ESLint.npm run format- Format code with Prettier.
Run from source:
- Node:
npm run dev -- <command> - Bun:
bun run bun:dev -- <command>
MIT