replicas-cli
v0.2.22
Published
CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding
Maintainers
Readme
Replicas CLI
Official CLI for Replicas - manage cloud development workspaces with automatic SSH tunneling and port forwarding.
Installation
npm install -g replicas-cliQuick Start
# Login to your Replicas account
replicas login
# Connect to a workspace
replicas connect my-workspace
# Connect and copy files from replicas.json
replicas connect my-workspace --copyCommands
replicas login
Authenticate with your Replicas account via browser-based OAuth.
replicas logout
Clear stored credentials.
replicas whoami
Display current authenticated user.
replicas org
Display current organization.
replicas org switch
Switch between organizations.
replicas connect <workspace-name> [--copy]
Connect to a workspace via SSH with automatic port forwarding.
Options:
-c, --copy- Copy files listed inreplicas.jsonto the workspace
Configuration
Create a replicas.json file in your repository root to configure file copying and port forwarding:
{
"copy": [
"web/.env",
"api/secrets.json"
],
"ports": [3000, 8080, 5432]
}When you run replicas connect --copy, it will:
- Copy the specified files to the workspace
- 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
- SSH Key Management: The CLI securely caches SSH keys in
~/.replicas/keys/ - Port Detection: Automatically detects ports in use and finds alternatives
- File Copying: Uses
scpto copy files to/home/ubuntu/workspaces/<repo-name>/ - 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)
Support
For issues or questions, visit https://replicas.dev
License
MIT
