{"id":35759115,"url":"https://github.com/treadiehq/private-connect","last_synced_at":"2026-04-10T15:19:50.584Z","repository":{"id":329764448,"uuid":"1119653799","full_name":"treadiehq/private-connect","owner":"treadiehq","description":"Securely connect and access private services across any environment, no VPNs, no firewall rules.","archived":false,"fork":false,"pushed_at":"2026-03-04T21:41:49.000Z","size":5896,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-05T03:31:16.373Z","etag":null,"topics":["networking","open-source","secure-tunneling","service-connectivity","zero-trust"],"latest_commit_sha":null,"homepage":"https://privateconnect.co","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treadiehq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-19T16:12:07.000Z","updated_at":"2026-03-04T21:41:52.000Z","dependencies_parsed_at":"2026-02-01T22:01:13.970Z","dependency_job_id":null,"html_url":"https://github.com/treadiehq/private-connect","commit_stats":null,"previous_names":["treadiehq/private-connect"],"tags_count":64,"template":false,"template_full_name":null,"purl":"pkg:github/treadiehq/private-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treadiehq%2Fprivate-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treadiehq%2Fprivate-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treadiehq%2Fprivate-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treadiehq%2Fprivate-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treadiehq","download_url":"https://codeload.github.com/treadiehq/private-connect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treadiehq%2Fprivate-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30192401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T18:54:55.862Z","status":"ssl_error","status_checked_at":"2026-03-06T18:53:04.013Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["networking","open-source","secure-tunneling","service-connectivity","zero-trust"],"created_at":"2026-01-06T22:27:15.342Z","updated_at":"2026-04-10T15:19:50.574Z","avatar_url":"https://github.com/treadiehq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Private Connect\n\n**Reach your database or private services by name from anywhere. Grant your AI read-only access for 5 minutes. Share your environment with a code. No VPN, no open ports. For humans and agents.**\n\n```bash\n# On the machine with the DB\nconnect expose localhost:5432 --name my-db\n\n# From anywhere else\nconnect reach my-db\n# → localhost:5432 now points at my-db. Same connection string, works everywhere.\n```\n\nNo port forwarding, no firewall rules. Works with Tailscale.\n\n## Install\n\n```bash\ncurl -fsSL https://privateconnect.co/install.sh | bash\nconnect up\n```\n\nOr try without signup:\n\n```bash\nnpx private-connect tunnel 3000\n```\n\nShare your entire local environment with a teammate, no signup:\n\n```bash\nnpx private-connect up 3000 5432 6379\n# → npx private-connect join k7m2p9    (send this to your teammate)\n```\n\n## How It Works\n\n```\n┌─────────────────┐         ┌───────┐         ┌─────────────────┐\n│   Your Server   │────────▶│  Hub  │◀────────│   Your Laptop   │\n│                 │         └───────┘         │                 │\n│ connect :5432   │                           │ connect prod-db │\n└─────────────────┘                           └─────────────────┘\n```\n\nAn agent runs on each machine. Expose services from one, reach them from another. All traffic is encrypted. Services are private to your workspace.\n\n- **Access by name** — `connect prod-db` instead of remembering IPs or ports\n- **Stable ports** — same service always gets the same local port across restarts\n- **Encrypted** — end-to-end encrypted tunnels with audit logging\n- **Works everywhere** — on top of Tailscale, VPN, or plain internet\n\n## Share with teammates\n\n```bash\n# Share your environment\nconnect share\n# → Share code: x7k9m2\n\n# Teammate joins with one command\nconnect join x7k9m2\n# → Same services, same ports. Done.\n```\n\n## SSH in one command\n\n```bash\n# Authenticated (named services)\nconnect ssh shell\nconnect ssh root@shell\n\n# Unauthenticated (share codes, no install)\nnpx private-connect ssh \u003ccode\u003e\n\n# Run a command and pipe to AI\nconnect ssh shell -- cat /etc/hostname | claude\n```\n\n## Browser terminal\n\nGive someone shell access with just a share code, no CLI install needed on their side.\n\n```bash\n# On your machine\nconnect shell \u0026\u0026 connect share\n# → Share code: x7k9m2\n```\n\nThey open `privateconnect.co/terminal`, enter the code, and get a live terminal.\n\n## Agent-Native Resource Access\n\nPrivate Connect can expose private resources as named, ephemeral endpoints for humans and AI agents.\n\nDefine resources in `pconnect.yml`, connect instantly, get a usable endpoint:\n\n```yaml\n# pconnect.yml\nresources:\n  staging-db:\n    type: postgres\n    host: internal-db\n    port: 5432\n    access:\n      mode: tcp\n```\n\n```bash\nconnect resources                    # List all resources\nconnect resource staging-db          # Get postgres://127.0.0.1:5432\nconnect resource staging-db --json   # Stable JSON for AI agents\n```\n\nJSON output for agent workflows (Cursor, Claude Code, Codex):\n\n```json\n{\n  \"ok\": true,\n  \"session\": {\n    \"id\": \"sess_a1b2c3d4\",\n    \"resource\": \"staging-db\",\n    \"type\": \"postgres\",\n    \"endpoint\": \"postgres://127.0.0.1:5432\",\n    \"expiresAt\": \"2026-03-25T12:00:00.000Z\",\n    \"expiresInSeconds\": 900\n  }\n}\n```\n\nSee [examples/pconnect-resources.yml](examples/pconnect-resources.yml) and [docs/detailed.md](docs/detailed.md#agent-native-resource-access).\n\n## AI agent access\n\nGrant an AI agent temporary, scoped access to a private resource. No credentials in prompts, no exposing services publicly.\n\n```bash\nconnect grant claude --db postgres --ttl 5m\n# → Token: gnt_...\n# → Endpoint: https://api.privateconnect.co/grant/postgres\n```\n\nThe AI can query the database over HTTP:\n\n```bash\ncurl -X POST https://api.privateconnect.co/grant/postgres/query \\\n  -H \"Authorization: Bearer gnt_...\" \\\n  -d '{\"sql\": \"SELECT count(*) FROM users\"}'\n# → {\"rows\": [{\"count\": 42}], \"rowCount\": 1}\n```\n\nRead-only grants block mutations. Access expires automatically.\n\n```bash\nconnect grant --list          # Active grants\nconnect grant --revoke \u003cid\u003e   # Revoke early\n```\n\nOr manage grants programmatically with the SDK:\n\n```typescript\nimport { PrivateConnect } from '@privateconnect/sdk';\n\nconst pc = new PrivateConnect({ apiKey: process.env.PRIVATECONNECT_API_KEY });\nconst grant = await pc.grants.create({\n  agentLabel: 'claude',\n  resourceType: 'db',\n  resourceName: 'postgres',\n  ttl: '5m',\n});\n// grant.token → give this to the AI agent\n```\n\nSee [examples/](examples/) for LangChain and OpenAI integrations.\n\n## Built for agents\n\nEvery CLI command supports `--json` for machine-readable output, `--help` with copy-pasteable examples, and flags for everything (no interactive prompts required).\n\n```bash\nconnect expose localhost:3000 --name api --json\n# → {\"serviceId\":\"...\",\"name\":\"api\",\"target\":\"localhost:3000\",\"tunnelPort\":...}\n\nconnect grant claude --db postgres --ttl 5m --json\n# → {\"id\":\"...\",\"token\":\"gnt_...\",\"endpoint\":\"...\"}\n\nconnect delete my-service --dry-run\n# → Would delete service \"my-service\" (ID: ...). No changes made.\n```\n\n## CI / preview environments\n\nExpose a local service from GitHub Actions and post a preview URL on the PR:\n\n```yaml\n- uses: treadiehq/private-connect/.github/actions/tunnel@main\n  with:\n    api-key: ${{ secrets.PRIVATE_CONNECT_KEY }}\n    port: 3000\n    ttl: 2h\n    comment-on-pr: 'true'\n```\n\nSee [the example workflow](.github/workflows/preview.yml.example) for a full setup.\n\n## Local Development\n\nRun any dev server with a named HTTPS URL. No config, no auth required:\n\n```bash\nconnect run api next dev\n# → https://api.localhost:3000\n\nconnect run frontend vite\n# → https://frontend.localhost:3000\n```\n\nHTTPS with HTTP/2 is enabled by default. Test on real devices with LAN mode:\n\n```bash\nconnect proxy start --lan\n# → Phones and tablets on your Wi-Fi reach https://api.connect.local:3000\n```\n\nThe same services are instantly reachable from a teammate's machine via `connect reach api`.\n\n## Build from source\n\n```bash\ngit clone https://github.com/treadiehq/private-connect.git\ncd private-connect \u0026\u0026 pnpm install\ncd apps/agent \u0026\u0026 pnpm run build:binary\n```\n\n## Docs\n\n- [Full CLI reference](docs/detailed.md)\n- [API reference](docs/detailed.md#control-api)\n- [Security](docs/security.md)\n- [Terminal from anywhere](docs/terminal.md)\n- [SDK](packages/sdk)\n- [AI agent examples](examples/)\n- [Use cases](docs/use_cases.md)\n- [Build remote workers into your product](docs/remote-workers.md)\n\n## Community\n\n[![Discord](https://img.shields.io/badge/Discord-Join-7289DA?style=flat\u0026logo=discord\u0026logoColor=white)](https://discord.gg/KqdBcqRk5E)\n\n## License\n\n[FSL-1.1-MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreadiehq%2Fprivate-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreadiehq%2Fprivate-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreadiehq%2Fprivate-connect/lists"}