Access your terminal from anywhere - CLI tool for chaiterm
npm install chaitermCommand-line tool for accessing your terminal from anywhere.
> ⚠️ Under Development
>
> This package is currently under active development and is not ready for production use. Features may be incomplete, unstable, or subject to breaking changes. Use at your own risk.
``bash`
npm install -g chaiterm
Authenticate and initialize configuration.
`bash`
chaiterm init
Start terminal access - connects your local PTY to the gateway.
`bash`
chaiterm start
Once connected, access your terminal at: https://chaiterm.com/terminals
Expose a local port to the internet.
`bash`
chaiterm expose 3000
Your app will be available at a random subdomain like: https://k7x9m2.chaiterm.com
Show current connection status and configuration.
`bash`
chaiterm status
Clear stored credentials.
`bash`
chaiterm logout
Kill all running chaiterm processes (useful when PTY instances get stuck).
`bash`
chaiterm kill
The CLI wraps two components:
1. pty-client - Connects to chaiterm.com/ws/pty via WebSocket, spawns local PTY
2. frp-wrapper - Wraps frpc binary for port exposure tunnels
Config is stored in ~/.config/chaiterm/config.json (or platform equivalent).
Use the --config (or -c) flag to specify a different config file:
`bashUse a local development config
chaiterm --config ./local-config.json start
$3
`json
{
"email": "your-email@example.com",
"gatewayUrl": "wss://chaiterm.com/ws/pty",
"frpServerAddr": "frp.chaiterm.com",
"frpServerPort": 7000
}
`| Field | Description | Default |
|-------|-------------|---------|
|
email | Your email for terminal access | (required) |
| gatewayUrl | Terminal gateway WebSocket URL | wss://chaiterm.com/ws/pty |
| frpServerAddr | frp server address | frp.chaiterm.com |
| frpServerPort | frp server port | 7000 |Requirements
- Node.js 18+
- For port exposure: frpc binary (install via
brew install frpc on macOS)Development
`bash
Install dependencies
bun installBuild
bun run buildWatch mode
bun run dev
`$3
To test CLI against a local server:
`bash
cd packages/cli1. Create a local config file
echo '{
"email": "your-email@example.com",
"gatewayUrl": "ws://localhost:3000/ws/pty"
}' > local-config.json2. Build and run with the local config
bun run build
node dist/bin/chaiterm.mjs --config ./local-config.json start
`$3
To test against the production server, use the default config (no --config flag):
`bash
node dist/bin/chaiterm.mjs start
``