@letsping/cli
v0.3.1
Published
Localhost HTTP Tunnel for LetsPing Webhooks and Ingestion
Downloads
531
Readme
@letsping/cli
Official command-line interface for LetsPing.
This tool creates a secure bidirectional tunnel between your local development environment and the LetsPing cloud dashboard. It enables realtime testing of the Behavioral Shield and Human-in-the-Loop approval workflows for agents running on localhost without requiring public deployment.
Quick Start
Run the tunnel using npx (recommended – no global installation needed):
npx @letsping/cli devRequired Configuration
Place a .env file in the directory where you run the CLI:
# Required
LETSPING_PROJECT_ID=proj_xxxxxxxxxxxxOptional Configuration
# Change local listening port (default: 3005)
LETSPING_PORT=4000Development Workflow
Start your local application/agent
Configure your LetsPing SDK (or direct HTTP calls) to send approval requests to the local ingestion endpoint.Start the tunnel
In a separate terminal:npx @letsping/cli devLook for the startup message
You should see output similar to:◆ LetsPing Local Tunnel ➜ API Endpoint: http://localhost:3005/ingest ➜ Dashboard: https://letsping.co/dashboard?project=proj_xxxxxxxxxxxxSend a test request
Direct your SDK or HTTP client to:POST http://localhost:3005/ingestThe request will appear almost instantly in your LetsPing dashboard under the Localhost environment.
If you run the 2-minute demo scripts from @letsping/sdk or npx @letsping/cli demo while this tunnel is active and point their base URL at http://localhost:<port>/api, all demo traffic will flow through the tunnel and show up in the dashboard tagged as Localhost.
Important Notes
The ingestion endpoint is
http://localhost:<port>/ingest
Sending requests to the root path (/) will return 404.Use POST requests with JSON payload matching the LetsPing request format.
The tunnel automatically reconnects on network interruptions.
How the local tunnel keeps everything secure & private (agent-friendly)
The CLI does not expose any endpoint to the public internet.
- Your agent sends approval requests only to
http://localhost:<port>/ingest(loopback interface). - The CLI receives these requests locally and forwards them outbound over a secure WebSocket tunnel to LetsPing cloud.
- All traffic flows from your machine → LetsPing (no inbound connections are accepted).
- The dashboard shows requests under the Localhost environment for easy testing.
- When a human approves/rejects, the decision travels back through the tunnel to your waiting agent.
This architecture means:
- No firewall changes needed
- No public URL is ever created
- Works behind NAT, corporate proxies, etc.
Because the tunnel is outbound‑only and scoped to localhost:<port>, it is safe for AI agents to start and use it as part of automated workflows (for example via MCP or other system tools), without opening any inbound ports on your machine.
Troubleshooting
| Problem | Likely Cause / Solution |
|:-----------------------------------|:----------------------------------------------------------------------------------------|
| Missing LETSPING_PROJECT_ID | No .env file in current directory or missing/invalid LETSPING_PROJECT_ID value |
| Port 3005 already in use | Set LETSPING_PORT=xxxx in .env or kill the occupying process |
| Requests not appearing in dashboard| • Using wrong endpoint (/ instead of /ingest)• Wrong project ID• Firewall blocking websocket |
| 404 Not Found | Sending to root URL instead of /ingest |
| Tunnel disconnects frequently | Unstable network – the CLI includes automatic reconnection logic |
For full documentation and request format specification, visit:
https://www.letsping.co/docs#local-dev
Happy local developing!
