Package Exports
- openpost
- openpost/dist/index.min.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 (openpost) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
⚡ Open Post
Headless REST & GraphQL API client — run collections, manage environments, mock servers, MCP servers, vault, and license from the command line or programmatically. No UI required.
Installation
# Global install (CLI)
npm install -g openpost
# Project dependency (library)
npm install openpostCLI Quick Start
# List your collections
openpost list collections
# Run all requests in a collection
openpost run "My API" --env production
# Run a single request
openpost run-request "My API" "Get Users" --env staging
# Import a cURL command
openpost import curl "curl -X GET https://api.example.com/users -H 'Authorization: Bearer token'"
# Check license status
openpost license statusCLI Commands
Execution
openpost run <collection> [options] # Run all requests in a collection
openpost run-request <collection> <request> # Run a single request
openpost scan <collection> <request> # Security scan a requestRun options:
| Flag | Description |
|---|---|
--env <name> |
Environment to use |
--mode <sequential|parallel> |
Run mode (default: sequential) |
--concurrency <n> |
Parallel concurrency (default: 5) |
--filter <pattern> |
Filter requests by name (glob: GET*, *users*) |
--retry <n> |
Retry failed requests n times |
--dry-run |
Validate without sending requests |
--timeout <ms> |
Override request timeout |
--ssl-off |
Disable SSL certificate verification |
--proxy <name> |
Use a named proxy profile |
--output-file <path> |
Save results to a JSON file |
--verbose |
Show detailed request/response info |
--quiet |
Suppress all output except errors |
--json |
Machine-readable JSON output |
Example output:
⚡ Running My API (12 requests, sequential)
Environment: production
✓ GET /users 200 45ms
✓ status equals 200
✓ body is JSON
✓ POST /users 201 120ms
✗ GET /users/999 404 32ms
✗ status equals 200 (got: 404)
✓ PUT /users/1 200 89ms
────────────────────────────────────────
11 passed 1 failed 1.2s totalCollections & Requests
# List
openpost list collections
openpost list requests <collection>
# Create
openpost create collection "My API"
openpost create request "My API" "Get Users" --method GET --url "{{base_url}}/users"
openpost create request "My API" "Create User" --method POST --url "{{base_url}}/users" \
--header "Content-Type:application/json" --body '{"name":"test"}' \
--auth-bearer "my-token"
openpost create folder "My API" "Auth"
# Delete
openpost delete collection "My API"
openpost delete request "My API" "Get Users"
openpost delete folder "My API" "Auth"
# Rename & Duplicate
openpost rename collection "Old Name" "New Name"
openpost duplicate collection "My API"Auth flags for create request:
| Flag | Example |
|---|---|
--auth-bearer <token> |
--auth-bearer "sk-abc123" |
--auth-basic <user:pass> |
--auth-basic "admin:secret" |
--auth-apikey <key:value:location> |
--auth-apikey "X-API-Key:abc123:header" |
Environments & Variables
# Manage environments
openpost create environment "staging"
openpost env set production # Set active environment
openpost env add production base_url https://api.example.com
openpost list environments
# Collection variables
openpost var set "My API" base_url https://api.example.com
openpost var list "My API"Use {{variable}} syntax in URLs, headers, body, and auth fields. Variables resolve automatically when running requests.
Import & Export
# Import
openpost import curl "curl -X GET https://api.example.com/users" --collection "My API"
openpost import curl ./request.sh --name "Get Users" --collection "My API"
openpost import openapi ./swagger.yaml
cat spec.yaml | openpost import openapi -
# Export
openpost export curl "My API" "Get Users" --env production
openpost export openapi "My API"
openpost export collection "My API"License
Open Post includes a built-in trial license. Advanced features (mock servers, MCP servers, vault) require an active license.
openpost license status # Check current license
openpost license activate <key> # Activate a license key
openpost license deactivate # Remove licenseVault (Encrypted Secret Storage)
Store secrets locally with AES-256-GCM encryption. Secrets resolve as {{variable}} placeholders in requests.
openpost vault create --password <pw> # Create encrypted vault
openpost vault add-secret api_key sk-live-abc --password <pw> # Add secret
openpost vault list-secrets --password <pw> # List secrets (masked)
openpost vault delete-secret api_key --password <pw> # Delete secret
openpost vault change-password --current <old> --new <new>
openpost vault lockMock Servers
openpost mock start # Start all mock servers with autoStart
openpost mock stop # Stop all
openpost mock list # Show status tableMCP Servers (AI Integration)
Start a headless Management MCP server that any AI client can connect to:
openpost serve --port 3199⚡ Management MCP Server
Listening on http://127.0.0.1:3199/mcp
Connect your AI client:
Claude Desktop: "open-post": { "url": "http://127.0.0.1:3199/mcp" }
Cursor/Kiro: Settings → MCP → Add Server → URL
32 tools available. Press Ctrl+C to stop.Proxy
openpost proxy add "Corporate" --host proxy.corp.com --port 8080 --protocol https
openpost proxy list
openpost proxy set-default "Corporate"
openpost proxy delete "Corporate"
# Use for a specific run
openpost run "My API" --proxy "Corporate"Cookies
openpost cookies list # Show stored cookies
openpost cookies clear # Clear cookie jar
openpost cookies toggle # Enable/disable cookiesHistory
openpost list history # Show recent requests
openpost history clear # Clear all history
openpost history delete <id>Configuration
Permanently change default behavior:
openpost config set output json # Always output JSON
openpost config set verbose true # Always verbose
openpost config set quiet true # Errors only (CI mode)
openpost config set sslVerification false # Disable SSL permanently
openpost config set defaultProxy "Corporate" # Default proxy for all requests
openpost config set defaultScope global # Default to global scope
openpost config list # Show all settings
openpost config reset # Reset to defaultsConfig stored at ~/.openpost/global/cli-config.json. CLI flags always override config.
Programmatic Usage
import { OpenPost } from 'openpost';
const op = new OpenPost({ workspace: '/path/to/project' });
// Run a single request
const { response, testResults } = await op.runRequest('My API', 'Get Users', {
env: 'production'
});
console.log(response.status); // 200
console.log(response.body); // '{"users": [...]}'
// Run entire collection
const entry = await op.runCollection('My API', {
env: 'production',
mode: 'sequential',
onProgress: (r) => console.log(`${r.passed ? '✓' : '✗'} ${r.method} ${r.url}`),
});
console.log(`${entry.passed} passed, ${entry.failed} failed`);
// Collections & Environments
op.createCollection('New API');
op.listCollections();
op.setActiveEnvironment('production');
// Import
op.importCurl('curl -X GET https://api.example.com/users', 'My API');
// License
op.activateLicense('eyJhbG...');
op.isLicensed(); // true
// Start headless MCP server
await op.startManagementMcp({ port: 3199 });
// Cleanup
await op.dispose();CI/CD Usage
# Run API tests in CI pipeline
npm install -g openpost
openpost run "My API" --env staging --quiet
# Exit code: 0 = all pass, 1 = any fail, 2 = errorGitHub Actions example:
- name: API Tests
run: |
npm install -g openpost
openpost run "My API" --env staging --quietSave results for reporting:
openpost run "My API" --env staging --json --output-file results.jsonGlobal Options
| Flag | Description | Default |
|---|---|---|
--workspace <path> |
Project directory | Current directory |
--scope <local|global> |
Storage scope | local |
--env <name> |
Active environment | None |
--json |
JSON output | false |
--verbose |
Detailed output | false |
--quiet |
Errors only | false |
--no-color |
Disable colors | Colors on |
--dry-run |
Validate only | false |
--ssl-off |
Disable SSL | SSL on |
--proxy <name> |
Use proxy | None |
--filter <pattern> |
Filter requests | All |
--retry <n> |
Retry failures | No retry |
--output-file <path> |
Save results | None |
--yes |
Skip confirmations | Prompt |
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success — all requests and tests passed |
1 |
Failure — one or more requests or tests failed |
2 |
Error — bad arguments, resource not found, license required |
Data Storage
Open Post stores data as plain JSON files:
.openpost/ ← per workspace (local scope)
├── collections.json
├── environments.json
├── history.json
└── config.json
~/.openpost/global/ ← shared across workspaces (global scope)
├── collections.json
├── environments.json
├── vault.enc ← encrypted vault
└── cli-config.json ← CLI settingsData is fully compatible with the Open Post VS Code extension. Collections, environments, and history sync between CLI and VS Code automatically.
Related
- Open Post VS Code Extension — Full GUI API client inside VS Code
- GitHub Repository
License
See LICENSE