@adamhancock/tmuxdev
v1.0.8
Published
CLI tool to manage tmux sessions for development servers
Downloads
21
Maintainers
Readme
@adamhancock/tmuxdev
A CLI tool to manage tmux sessions for development servers, making it easy for tools like Claude to access console logs.
🚀 Installation
npm install -g @adamhancock/tmuxdev
# or
pnpm add -g @adamhancock/tmuxdev
# or
yarn global add @adamhancock/tmuxdev📖 Usage
Quick Commands
# Quick start - creates/attaches to session for current directory
tmuxdev
# Interactive menu for session management
tmuxdev menu
tmuxdev m # short alias
# Start and attach to session for current directory
tmuxdev start
tmuxdev s # short alias
# Attach to existing session for current directory
tmuxdev attach
tmuxdev a # short alias
# Show help
tmuxdev help
tmuxdev h # short alias
tmuxdev --help # or use flags
tmuxdev -hDefault Behavior
When you run tmuxdev without arguments, it automatically creates or attaches to a session named after your current directory and git branch (e.g., myproject-main, webapp-feature-auth).
Interactive Menu
When you run tmuxdev menu (or tmuxdev m), you get an interactive menu:
- Start/Attach to current directory session - Manages a session named after your current folder and branch
- Select from existing sessions - Browse and attach to any running tmux session
- Kill a session - Safely terminate tmux sessions
- Exit - Quit the tool
✨ Features
- 🏷️ Smart Session Naming: Automatically combines folder and git branch names (e.g.,
myproject-main,myapp-feature-branch) - 🎯 Quick Commands: Jump straight into work with
tmuxdev sfor instant session start - 📋 Interactive Menu: User-friendly interface with arrow key navigation
- 🔄 Session Management: Create, attach, list, and kill tmux sessions effortlessly
- 🚀 Dev Server Integration: Automatically runs
npm run devwhen creating new sessions - ⚡ Fast Context Switching: Quickly jump between different project sessions
- 🛡️ Graceful Exit Handling: Properly handles Ctrl+C interruptions
🎮 Tmux Controls
Once attached to a session:
Ctrl+B then D- Detach from session (keeps it running)Ctrl+B then [- Enter scroll/copy modeCtrl+B then %- Split pane verticallyCtrl+B then "- Split pane horizontallyCtrl+B then arrow keys- Navigate between panes
🔧 Requirements
- Node.js 16+
- tmux installed on your system
- A project with a
devscript in package.json (or modify the source to use your preferred command)
💡 Why tmuxdev?
This tool was created to solve a specific problem: when using AI assistants like Claude to help with development, they can't see your terminal output. By running your dev server in a tmux session, you can easily share logs and error messages by:
- Starting a session with
tmuxdev s - Letting your dev server run
- Copying relevant output to share with your AI assistant
- Detaching with
Ctrl+B then Dto keep it running
🤝 Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
GitHub: https://github.com/adamhancock/tmuxdev
📄 License
MIT © Adam Hancock
