Skip to main content
The Private Connect CLI (connect) enables you to expose, access, and manage services across your development infrastructure.

Installation

npm install -g private-connect
Or use the install script:
curl -fsSL https://privateconnect.co/install.sh | bash

Quick Start

  1. Authenticate your agent:
    connect up
    
  2. Expose a local service:
    connect expose localhost:3306 --name mysql
    
  3. Access a remote service:
    connect reach mysql
    

Command Structure

All commands follow the pattern:
connect <command> [arguments] [options]

Global Options

These options are available for most commands:
--hub
string
default:"https://hub.privateconnect.co"
Hub server URL
--config
string
Path to custom config file
--help
boolean
Show help for a command

Core Workflow

Exposing Services

Make your local services accessible to teammates:
connect expose localhost:5432 --name staging-db
connect expose localhost:8080 --name api --public

Reaching Services

Access services exposed by your team:
connect reach staging-db
connect reach api --port 8000

Environment Management

Share or clone entire environments:
# Share your environment
connect share --name "staging-env" --expires 24h

# Clone a teammate's environment
connect clone alex

Command Categories

Service Commands

Infrastructure Commands

Utility Commands

Integration Commands

  • connect mcp - AI assistant integration (Model Context Protocol)

Exit Codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - General error (authentication, network, configuration)
  • 2 - Command usage error (invalid arguments)

Environment Variables

PRIVATECONNECT_TOKEN
string
Pre-authenticated token for CI/CD environments
CONNECT_DAEMON
boolean
Internal flag indicating daemon mode
CONNECT_PROXY_FOREGROUND
boolean
Run proxy in foreground mode

Configuration

Configuration is stored in ~/.privateconnect/config.json:
{
  "agentId": "agent_xxx",
  "token": "tok_xxx",
  "apiKey": "pk_xxx",
  "hubUrl": "https://hub.privateconnect.co",
  "label": "macbook-pro",
  "workspaceId": "ws_xxx"
}

Common Patterns

Local Development

Connect to your team’s staging database:
connect reach staging-db
psql -h localhost -p 5432

Sharing with Webhooks

Expose your local API for webhook testing:
connect expose localhost:3000 --name webhook-test --public

Multi-Service Projects

Use a project config file (pconnect.yml):
services:
  - name: postgres
    port: 5432
  - name: redis
    port: 6379
  - name: api
    port: 8080
Then connect to all services:
connect dev

Troubleshooting

Check Agent Status

connect daemon status

View Logs

connect daemon logs

Diagnostics

Run connectivity diagnostics:
connect reach my-service --check

Port Conflicts

Ports are automatically selected when conflicts occur. To use a specific port:
connect reach mysql --port 13306

Build docs developers (and LLMs) love