https://github.com/phil/tmux-devcontainers
A Tmux plugin for working with dev containers
https://github.com/phil/tmux-devcontainers
Last synced: 22 days ago
JSON representation
A Tmux plugin for working with dev containers
- Host: GitHub
- URL: https://github.com/phil/tmux-devcontainers
- Owner: phil
- License: mit
- Created: 2025-03-26T17:00:24.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-06T20:16:36.000Z (3 months ago)
- Last Synced: 2025-10-04T16:55:07.705Z (2 months ago)
- Language: Shell
- Size: 216 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-tmux - tmux-devcontainers - Manage and interact with (Devcontainers)[https://containers.dev] (Plugins)
README
# tmux-devcontainers
A Tmux plugin for working with [devcontainers](https://containers.dev) featuring:
- Status bar placeholders to show the status of the devcontainers for the current workspace.
- Key binding to create a new login shell in the devcontainer (via devcontainer exec).
- A menu to interact with the devcontainers in the current workspace.
### Status bar integration

tmux-devcontainers provides a status bar placeholder to show the status of the devcontainers from your docker-compose file:
```bash
set -g status-right '#{devcontainers_workspace} #{devcontainers_status}'
```
- `#{devcontainers_workspace}`: shows the name of the devcontainer workspace.
- `#{devcontainers_status}`: shows the status of each container in the workspace.
### Menu commands

Commands to manage devcontainers. Commands run in new windows and try to be unintrusive by automatically closing on success.
### Key bindings
tmux-devcontainers provides a key bindings to interact with the devcontainers:
- prefix + E: creates a new tmux pane with a login shell in the devcontainer.
- prefix + (Ctrl + e): shows a menu to interact with the devcontainers in the current workspace.
The Exec command will default to running `/bin/bash` in the devcontainer. This can be overridden per project by adding the following to your `devcontainer.json`:
```json
{
"customizations": {
"tmux": {
"execCommand": "/bin/sh" // or "rails console", etc.
}
},
}
```
Key bindings can be customized by setting the following options in your `~/.tmux.conf` file:
```bash
set-option -g @devcontainers_exec_key 'T' # default: 'E'
set-option -g @devcontainers_menu_key 'M' # default: 'Ctrl + e'
```
##Â Installation
### Pre-requisites
- docker (version 28 or later)
- [devcontainer CLI](https://github.com/devcontainers/cli)
- [jq](https://jqlang.org)
### Installation Using Tmux Plugin Manager (TPM)
Add the following line to your `~/.tmux.conf` file:
```bash
set -g @plugin 'phil/tmux-devcontainers'
```
## About
tmux-devcontainers is designed to be as flexible as possible, allowing you to interact with devcontainers in your workspace directly from Tmux. It provides a simple way to manage and monitor the status of your devcontainers without leaving your terminal. Commands and status updates are scoped to the current Tmux pane, so you can easily switch between different devcontainer workspaces within Tmux sessions.
## Contributing
Check out how to contribute to the CLI in [CONTRIBUTING.md](CONTRIBUTING.md).
## License
This project is under an [MIT license](LICENSE.txt).