CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding
npm install replicas-cliOfficial CLI for Replicas - manage cloud development workspaces with automatic SSH tunneling and port forwarding.
``bash`
npm install -g replicas-cli
`bashLogin to your Replicas account
replicas login
Commands
$3
Authenticate with your Replicas account via browser-based OAuth.$3
Clear stored credentials.$3
Display current authenticated user.$3
Display current organization.$3
Switch between organizations.$3
Connect to a workspace via SSH with automatic port forwarding.Options:
-
-c, --copy - Copy files listed in replicas.json to the workspaceConfiguration
Create a
replicas.json file in your repository root to configure file copying and port forwarding:`json
{
"copy": [
"web/.env",
"api/secrets.json"
],
"ports": [3000, 8080, 5432]
}
`When you run
replicas connect --copy, it will:
1. Copy the specified files to the workspace
2. Set up port forwarding for the specified ports (automatically finding available local ports if needed)Features
- Secure Authentication: OAuth-based login with token refresh
- Quick SSH Access: Connect to workspaces with a single command
- File Syncing: Copy environment files and secrets to workspaces
- Smart Port Forwarding: Automatic port conflict resolution
- SSH Key Caching: Reuse SSH keys across sessions
- Multi-Organization: Switch between different organizations
How it Works
1. SSH Key Management: The CLI securely caches SSH keys in
~/.replicas/keys/
2. Port Detection: Automatically detects ports in use and finds alternatives
3. File Copying: Uses scp to copy files to /home/ubuntu/workspaces/
4. Port Forwarding: Maps workspace ports to local ports (e.g., workspace:3000 → localhost:3001)Requirements
- Node.js 18+
- SSH client (openssh)
-
lsof` (for port detection, pre-installed on macOS/Linux)For issues or questions, visit https://replicas.dev
MIT