api-response-manager
v2.5.3
Published
Command-line interface for API Response Manager
Maintainers
Readme
ARM CLI - API Response Manager Command Line Interface
Command-line interface for API Response Manager. Manage tunnels, webhooks, and projects from your terminal.
Version: 2.5.3 | Live Service: https://tunnelapi.in
Installation
Option 1: Install from npm (Recommended)
npm install -g api-response-managerAfter installation, verify:
arm --version
arm --helpOption 2: Install from Source
# Clone the repository
git clone https://github.com/vijaypurohit322/api-response-manager.git
cd api-response-manager/cli
# Install dependencies
npm install
# Link globally
npm link
# Verify installation
arm --versionOption 3: Use with npx (No Installation)
npx api-response-manager login
npx api-response-manager tunnel 3000
npx api-response-manager webhookQuick Start
1. Login
Interactive Login (Recommended)
arm login
# Choose from: Email/Password, Google, GitHub, or MicrosoftEmail & Password
arm login -e [email protected] -p yourpasswordSocial Login (OAuth)
# Login with Google
arm login --provider google
# Login with GitHub
arm login --provider github
# Login with Microsoft
arm login --provider microsoftThe CLI will:
- Generate a unique device code
- Open your browser automatically
- Wait for you to authenticate
- Store your credentials securely
2. Start a Tunnel
# Expose local port 3000
arm tunnel 3000
# With custom subdomain
arm tunnel 3000 --subdomain myapi
# With authentication
arm tunnel 3000 --auth --rate-limit 1003. Create a Webhook
# Basic webhook
arm webhook
# With forwarding to URL
arm webhook --forward http://localhost:4000/webhook
# With forwarding to tunnel
arm webhook --tunnel <tunnel-id>Commands
Authentication
arm login
Authenticate with API Response Manager
Options:
-e, --email <email>- Email address (for email/password login)-p, --password <password>- Password (for email/password login)--provider <provider>- OAuth provider: google, github, or microsoft
Examples:
# Interactive login (choose method)
arm login
# Email & Password
arm login -e [email protected] -p mypassword
# Social Login (OAuth Device Flow)
arm login --provider github
arm login --provider google
arm login --provider microsoftOAuth Device Flow: When using social login, the CLI will:
- Generate a unique device code (e.g.,
ABCD-EFGH) - Display a verification URL
- Automatically open your browser
- Wait for you to complete authentication
- Store your token securely
Example output:
$ arm login --provider github
🌐 Logging in with github...
📋 Please complete authentication:
1. Visit: https://localhost:5173/device
2. Enter code: ABCD-EFGH
Code expires in 600 seconds
? Open browser automatically? (Y/n)
✓ Browser opened
⠋ Waiting for authentication...
✓ Authentication successful!
User: John Doe
Provider: github
Token saved to: ~/.config/arm-cli/config.json
✓ You can now use all ARM CLI commandsarm logout
Logout from API Response Manager
arm logoutTunnels
arm tunnel <port>
Start a tunnel to expose local server
# Basic HTTP tunnel
arm tunnel 3000
# HTTPS tunnel with SSL
arm tunnel 3000 --protocol https --ssl
# TCP tunnel (for databases, etc.)
arm tunnel 5432 --protocol tcp --subdomain postgres
# WebSocket tunnel
arm tunnel 8080 --protocol ws
# With custom subdomain and authentication
arm tunnel 3000 --subdomain myapi --name "My API" --auth --rate-limit 100
# With custom domain
arm tunnel 3000 --protocol https --ssl --domain api.yourdomain.comOptions:
-s, --subdomain <subdomain>- Custom subdomain-n, --name <name>- Tunnel name-a, --auth- Enable basic authentication-r, --rate-limit <limit>- Rate limit (requests per minute, default: 60)-p, --protocol <protocol>- Protocol: http, https, tcp, ws, wss (default: http)--ssl- Enable SSL/HTTPS-d, --domain <domain>- Custom domain
arm tunnel:list
List all active tunnels
arm tunnel:listarm tunnel:stop <tunnelId>
Stop a tunnel
arm tunnel:stop 507f1f77bcf86cd799439011arm tunnel:logs <tunnelId>
View tunnel request logs
arm tunnel:logs 507f1f77bcf86cd799439011
arm tunnel:logs 507f1f77bcf86cd799439011 --follow
arm tunnel:logs 507f1f77bcf86cd799439011 --lines 100Options:
-f, --follow- Follow log output (real-time)-n, --lines <number>- Number of lines to show (default: 50)
arm tunnel:domain <tunnelId> <domain>
Set custom domain for tunnel
arm tunnel:domain 507f1f77bcf86cd799439011 api.yourdomain.comarm tunnel:ssl <tunnelId>
Upload SSL certificate for tunnel
arm tunnel:ssl 507f1f77bcf86cd799439011 --cert cert.pem --key key.pem
arm tunnel:ssl 507f1f77bcf86cd799439011 --cert cert.pem --key key.pem --ca ca.pemOptions:
--cert <path>- Path to certificate file--key <path>- Path to private key file--ca <path>- Path to CA certificate file (optional)
arm tunnel:auth:oauth <tunnelId>
Configure OAuth authentication for tunnel
arm tunnel:auth:oauth 507f1f77bcf86cd799439011 \
--provider google \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_SECRET \
--callback-url https://yourtunnel.arm.dev/auth/callback \
--scope openid,email,profileOptions:
--provider <provider>- OAuth provider: google, github, microsoft, custom--client-id <id>- OAuth client ID--client-secret <secret>- OAuth client secret--callback-url <url>- OAuth callback URL--scope <scope>- OAuth scope (comma-separated)
arm tunnel:auth:oidc <tunnelId>
Configure OpenID Connect authentication for tunnel
arm tunnel:auth:oidc 507f1f77bcf86cd799439011 \
--issuer https://accounts.google.com \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_SECRET \
--callback-url https://yourtunnel.arm.dev/auth/callbackOptions:
--issuer <url>- OIDC issuer URL--client-id <id>- OIDC client ID--client-secret <secret>- OIDC client secret--callback-url <url>- OIDC callback URL
arm tunnel:auth:saml <tunnelId>
Configure SAML authentication for tunnel
arm tunnel:auth:saml 507f1f77bcf86cd799439011 \
--entry-point https://idp.example.com/saml/sso \
--issuer https://yourtunnel.arm.dev \
--cert idp-cert.pem \
--callback-url https://yourtunnel.arm.dev/auth/saml/callbackOptions:
--entry-point <url>- SAML entry point URL--issuer <issuer>- SAML issuer--cert <path>- Path to IdP certificate file--callback-url <url>- SAML callback URL
arm tunnel:ingress <tunnelId> <rules>
Configure ingress rules for tunnel (path-based routing)
# Route different paths to different backends
arm tunnel:ingress 507f1f77bcf86cd799439011 \
"/api=localhost:3000,/admin=localhost:4000" \
--tls
# Single rule
arm tunnel:ingress 507f1f77bcf86cd799439011 "/api=localhost:3000"Options:
--tls- Enable TLS for ingress
Rules format: /path=host:port,/path2=host:port
Webhooks
arm webhook
Create a new webhook
arm webhook
arm webhook --name "GitHub Webhook"
arm webhook --forward http://localhost:4000/webhook
arm webhook --tunnel 507f1f77bcf86cd799439011
arm webhook --expires 48Options:
-n, --name <name>- Webhook name-f, --forward <url>- Forward URL-t, --tunnel <tunnelId>- Forward to tunnel-e, --expires <hours>- Expiration time in hours (default: 24)
arm webhook:list
List all webhooks
arm webhook:listarm webhook:delete <webhookId>
Delete a webhook
arm webhook:delete a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6arm webhook:logs <webhookId>
View webhook request logs
arm webhook:logs a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
arm webhook:logs a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 --follow
arm webhook:logs a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 --lines 100Options:
-f, --follow- Follow log output (real-time)-n, --lines <number>- Number of lines to show (default: 50)
arm webhook:replay <webhookId> <requestId>
Replay a webhook request
arm webhook:replay a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 507f1f77bcf86cd799439011Projects
arm projects
List all projects
arm projectsarm project:create <name>
Create a new project
arm project:create "My API Project"
arm project:create "My API Project" --description "Testing API endpoints"Options:
-d, --description <description>- Project description
arm project:share <projectId>
Get shareable link for a project
arm project:share 507f1f77bcf86cd799439011arm project:responses <projectId>
View project API responses
arm project:responses 507f1f77bcf86cd799439011
arm project:responses 507f1f77bcf86cd799439011 --limit 20Options:
-n, --limit <number>- Number of responses to show (default: 10)
Logs
arm logs <id>
View logs for tunnels or webhooks (auto-detects type)
arm logs 507f1f77bcf86cd799439011
arm logs a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 --followOptions:
-f, --follow- Follow log output (real-time)-n, --lines <number>- Number of lines to show (default: 50)
Configuration
arm config:set <key> <value>
Set configuration value
arm config:set apiUrl http://localhost:5000/api
arm config:set defaultTunnelPort 8080arm config:get [key]
Get configuration value (omit key to show all)
arm config:get apiUrl
arm config:getarm config:delete <key>
Delete configuration value
arm config:delete apiUrlConfiguration
Configuration is stored in ~/.config/arm-cli/config.json
Default configuration:
{
"apiUrl": "http://localhost:5000/api",
"token": null,
"userId": null,
"email": null,
"defaultTunnelPort": 3000,
"defaultWebhookExpiry": 86400
}Examples
Expose Local Development Server
# Login
arm login
# Start tunnel on port 3000 with custom subdomain
arm tunnel 3000 --subdomain myapp
# Your local server is now accessible at:
# https://myapp.free-tunnelapi.app
# Output:
# 🚇 Starting Tunnel...
# ✔ Tunnel created successfully!
# ┌─────────────────────────────────────────────┐
# │ Tunnel Information │
# ├─────────────────────────────────────────────┤
# │ Name: myapp │
# │ Public URL: https://myapp.free-tunnelapi.app│
# │ Local Port: 3000 │
# └─────────────────────────────────────────────┘
# 🎉 Tunnel Active!Tunnel Timeouts (Industry Standard)
| Setting | Value | Description | |---------|-------|-------------| | Heartbeat | 30 seconds | CLI sends keepalive every 30s | | Idle Timeout | 2 hours | Closes after 2 hours of no requests | | Max Session | 24 hours | Requires reconnect after 24 hours |
Secure Tunnel with OAuth Authentication
# Create HTTPS tunnel
arm tunnel 3000 --protocol https --ssl --subdomain myapi
# Configure Google OAuth
arm tunnel:auth:oauth <tunnel-id> \
--provider google \
--client-id YOUR_GOOGLE_CLIENT_ID \
--client-secret YOUR_GOOGLE_SECRET \
--callback-url https://myapi.tunnel.arm.dev/auth/callback
# Now your tunnel requires Google login to accessTCP Tunnel for Database
# Expose PostgreSQL database
arm tunnel 5432 --protocol tcp --subdomain mydb
# Connect from anywhere:
# psql -h mydb.tunnel.arm.dev -p 5432 -U username -d databaseMulti-Service Routing with Ingress
# Create tunnel
arm tunnel 3000 --protocol https --ssl
# Configure path-based routing
arm tunnel:ingress <tunnel-id> \
"/api/v1=localhost:3000,/api/v2=localhost:4000,/admin=localhost:5000" \
--tls
# Now:
# https://yourtunnel.arm.dev/api/v1 -> localhost:3000
# https://yourtunnel.arm.dev/api/v2 -> localhost:4000
# https://yourtunnel.arm.dev/admin -> localhost:5000Test Webhooks Locally
# Create webhook that forwards to local server
arm webhook --forward http://localhost:4000/webhook --name "Test Webhook"
# Send test request
curl -X POST <webhook-url> -d '{"test": "data"}'
# View logs
arm webhook:logs <webhook-id>CI/CD Integration
# In your CI/CD pipeline
export ARM_TOKEN="your-auth-token"
# Start tunnel for testing
arm tunnel 3000 --subdomain ci-test-${CI_BUILD_ID}
# Run your tests against the public URL
npm test
# Stop tunnel
arm tunnel:stop <tunnel-id>Troubleshooting
Authentication Issues
# Check if logged in
arm config:get email
# Re-login
arm logout
arm loginConnection Issues
# Check API URL
arm config:get apiUrl
# Update API URL
arm config:set apiUrl https://your-api-url.com/apiView All Configuration
arm config:getTroubleshooting
Command Not Found After Installation
If you get arm: command not found after installing:
Windows:
- Check npm prefix:
npm config get prefix - Add to PATH:
C:\Users\<YourUsername>\AppData\Roaming\npm - Restart terminal
macOS/Linux:
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcAlternative - Use npx:
npx api-response-manager loginPublishing to npm
See PUBLISHING.md for detailed instructions on publishing this package to npm.
Quick Publish
# Login to npm
npm login
# Update version
npm version patch # or minor/major
# Publish
npm publish --access publicSupport
- GitHub: https://github.com/vijaypurohit322/api-response-manager
- Issues: https://github.com/vijaypurohit322/api-response-manager/issues
- Email: [email protected]
License
This software is proprietary. See LICENSE for details.
Key Points:
- ✅ Personal and educational use allowed
- ✅ Self-hosting for non-commercial use allowed
- ❌ Commercial use requires separate license
- ❌ Resale or redistribution prohibited
- 📧 Contact: [email protected]
