Termly CLI
Access your AI coding assistants from any device. Works with Claude Code, Aider, GitHub Copilot, and any terminal-based AI tool.
What's New in v1.5
- 🔔 Push Notifications Support - CLI status tracking (idle/busy) for server-side push notifications
- 🔗 Improved Session Stability - Keep session alive when WebSocket reconnection fails
Previous versions:
- v1.3 - Prebuilt binaries, improved Windows support, fast installation
- v1.2 - Windows output deduplication and PowerShell optimization
- v1.0 - Stable release with session management and E2EE
- v0.9 - Terminal resize support and improved reconnection
- v0.8 - Demo mode for Apple App Review
Features
- 🚀 Universal AI Tool Support - Works with any terminal-based AI coding assistant
- 📱 Mobile Access - Control your AI tools from phone or tablet
- 🔒 End-to-End Encryption - AES-256-GCM + DH-2048 key exchange with fingerprint verification
- 🔄 Session Resume - Automatic reconnection with state synchronization
- 💻 Multiple Sessions - Run multiple AI tools simultaneously
- 🎯 Auto-Detection - Automatically finds installed AI tools
- ⚡ Zero-Knowledge Server - Server never sees your unencrypted data
- 🌍 Multiple Environments - Production, Development, and Local modes
- 🔄 Auto-Update Check - Ensures you're always running a supported version
Installation
Quick Install
Termly CLI includes prebuilt binaries for all platforms - no compilation required!
All Platforms:
npm install -g @termly-dev/cli
After installation, the termly command is available globally.
That's it! Works out-of-the-box on:
- ✅ macOS (Intel & Apple Silicon)
- ✅ Linux (x64 & ARM64)
- ✅ Windows 10+ (x64 & ARM64)
Development (Beta Testing)
For beta testers and development:
npm install -g @termly-dev/cli-dev
This installs the termly-dev command which connects to the development environment.
System Requirements
Node.js 18+ - That's all you need!
Termly CLI uses @lydell/node-pty with prebuilt binaries for all platforms:
- No Visual Studio required on Windows
- No Xcode CLI tools required on macOS
- No build-essential required on Linux
- Fast installation (no compilation)
Installation typically completes in 10-30 seconds.
Environments
Termly CLI supports three environments:
| Production | @termly-dev/cli | termly | wss://api.termly.dev | End users |
| Development | @termly-dev/cli-dev | termly-dev | wss://dev-api.termly.dev | Beta testers |
| Local | Run from source | TERMLY_ENV=local termly | ws://localhost:3000 | Developers only |
Note: Server URLs are hardcoded per environment and cannot be changed by users.
Quick Start
Production
cd /path/to/your/project
termly start
Development
cd /path/to/your/project
termly-dev start
Local Development
git clone https://github.com/termly-dev/termly-cli
cd termly-cli
npm install
TERMLY_ENV=local node bin/cli.js start
Multiple Sessions
Run multiple sessions simultaneously:
cd ~/frontend
termly start
cd ~/backend
termly start
Each session:
- Independent AI tool instance
- Own WebSocket connection
- Can connect one mobile device
Manage sessions:
termly status
termly stop abc-123
termly list
Supported AI Tools
Termly CLI supports 20+ interactive terminal-based AI coding assistants:
Official Tools from Major Companies
- Claude Code (Anthropic) - AI coding assistant
- GitHub Copilot CLI (Microsoft) - Command line AI
- Cursor CLI (Cursor) - AI coding assistant CLI
- Cody CLI (Sourcegraph) - AI assistant (Beta)
- Amazon Q Developer (AWS) - Free tier available
- Google Gemini CLI (Google) - 1M token context window
- Grok CLI (xAI) - X.AI's coding assistant
- OpenAI Codex CLI (OpenAI) - Code generation model
Popular Open-Source Tools
- Aider - AI pair programming (35k+ stars)
- Continue CLI - Modular architecture
- OpenHands - Open-source Devin alternative
- Mentat - Git integration
- ChatGPT CLI - ChatGPT in terminal
- ShellGPT - Shell command assistant
- Ollama - Run LLMs locally (CodeLlama, etc)
- Blackbox AI - Debugging & file editing
Experimental/Future Support
- OpenCode - When released
- Devin CLI - When released
- Any other terminal-based AI tool
And more... - Works with any terminal-based AI tool that supports interactive TTY mode
Commands
All commands work the same way in both termly (production) and termly-dev (development).
Setup
termly setup
Interactive configuration setup (optional - sets default AI tool preference).
Start
termly start [directory] [options]
Start a new session with AI tool.
Options:
--ai <tool> - Specify AI tool to use
--ai-args <args> - Additional arguments for AI tool
--no-auto-detect - Disable auto-detection
--debug - Enable debug logging
Examples:
termly start
termly start --ai aider
termly start /path/to/project --ai "claude code"
termly start --ai aider --ai-args "--model gpt-4"
termly start --ai claude-code --ai-args "--continue"
Status
termly status [--all]
Show all active sessions with detailed information.
Stop
termly stop [session-id] [--all]
Stop one or all sessions.
List
termly list
Quick list of active sessions with encryption fingerprints for verification.
Tools
termly tools list
termly tools detect
termly tools info <tool>
Config
termly config
termly config get <key>
termly config set <key> <value>
Examples:
termly config set defaultAI aider
termly config get defaultAI
Note: Server URL is determined by environment and cannot be changed via config.
Cleanup
termly cleanup
Remove stale sessions (processes that are no longer running).
Requirements
- Node.js 18+
- At least one AI coding assistant installed (see Supported AI Tools section)
- Mobile app (iOS/Android) - coming soon
Troubleshooting
Installation Issues
Installation usually works flawlessly thanks to prebuilt binaries.
If you encounter issues:
"Cannot find module 'node-pty'"
Reinstall the package:
npm uninstall -g @termly-dev/cli
npm cache clean --force
npm install -g @termly-dev/cli
Permission errors on macOS/Linux
Use sudo or fix npm permissions:
sudo npm install -g @termly-dev/cli
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g @termly-dev/cli
Windows: "EPERM: operation not permitted"
This is usually a warning, not a fatal error. Check if installation succeeded:
termly --version
If the command works, installation was successful.
Usage Issues
No AI tools detected?
termly tools list
Install an AI tool:
- Claude Code: https://docs.claude.com
- Aider:
pip install aider-chat
- GitHub Copilot:
gh extension install github/gh-copilot
Session already running?
termly status
termly stop abc-123
Check your environment:
termly config
Logs: ~/.termly/logs/cli.log
For issues: https://github.com/termly-dev/termly-cli/issues
Security
- End-to-end encryption (AES-256-GCM)
- Diffie-Hellman key exchange (2048-bit)
- Fingerprint verification - Compare encryption keys between CLI and mobile app
- Zero-knowledge server - Server cannot decrypt your data
- One mobile device per session
- Environment isolation - Production and development separated
- Version enforcement - Automatic check for minimum supported version
- Open source - Audit the code yourself
Architecture
Termly CLI uses a PTY (pseudo-terminal) to spawn AI tools locally and streams I/O through WebSocket with end-to-end encryption.
Mobile App <--[encrypted]--> WebSocket Server <--[encrypted]--> CLI <--[local]--> PTY <--> AI Tool
Key features:
- Circular buffer - Stores last 100KB for session resume
- Platform-specific optimizations - Windows output deduplication and escape sequence normalization
- Batch catchup - Sends missed messages in 100-message batches with 10ms delay
For detailed architecture diagrams and data flow, see docs/ARCHITECTURE.md.
Development
npm install
node bin/cli.js start
node bin/cli-dev.js start
TERMLY_ENV=local node bin/cli.js start
DEBUG=1 node bin/cli.js start --debug
tail -f ~/.termly/logs/cli.log
Get-Content $env:USERPROFILE\.termly\logs\cli.log -Wait -Tail 50
Publishing
Production Release
npm version patch
npm publish
Development Release
./scripts/publish-dev.sh
cp package.dev.json package.json
npm publish
git checkout package.json
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Before contributing:
- Read CLAUDE.md for project structure and implementation details
- Check docs/ARCHITECTURE.md for architecture overview
- Run the CLI locally to test your changes
Documentation
License
MIT - See LICENSE for details
Support
Links
Made with ❤️ by the Termly Team