Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pommee/Pocker
~ TUI tool for docker ~
https://github.com/pommee/Pocker
docker python terminal textual tool tui
Last synced: about 2 months ago
JSON representation
~ TUI tool for docker ~
- Host: GitHub
- URL: https://github.com/pommee/Pocker
- Owner: pommee
- License: mit
- Created: 2024-05-04T13:25:26.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T14:55:27.000Z (4 months ago)
- Last Synced: 2024-10-02T18:45:18.095Z (3 months ago)
- Topics: docker, python, terminal, textual, tool, tui
- Language: Python
- Homepage:
- Size: 1.69 MB
- Stars: 101
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tuis - Pocker
README
# 👋🏼 Introduction
Pocker is a TUI tool to help with docker related tasks. For example,
- View containers/images.
- Manage status of containers.
- See logs, attributes, environment variables and container statistics.
- Filter logs based on keywords.
- Start shell inside a container.
- Customize configuration, i.e keybinds and behaviour.The tool is heavily based on [docker-py](https://docker-py.readthedocs.io/en/stable/index.html) and [textual](https://github.com/textualize/textual/).
A big thanks goes over to the creator and contributors of textual as it makes for a very sleek and easy interface.[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/pommee)
## Why?
I spend a lot of time working with Docker, and typing numerous commands can be time-consuming, energy-draining, and inefficient.
This is something that can, of course, be improved with the right tool.The initial drive was to type less, but has since evolved into more.
Being able to search for a keyword and quickly get live feedback is very nice.
Need a new env variable? Just head over to the shell tab and run one command.## Prerequisite
> [!NOTE]
> [Pipx](https://pipx.pypa.io/stable/installation/) must be installed.
> Python version 3.10.9 or newer.## 📦 Installation
Pocker is hosted at PyPi ([see here](https://pypi.org/project/pocker-tui/)).
```shell
pipx install pocker-tui # Latest version
pipx install pocker-tui==version # Specific version
```### Install from GitHub repository
PyPi will mostly contain newest version, but it is also possible to run install from this repository.
```bash
pipx install git+https://github.com/pommee/Pocker
```## 🚦 Usage
```shell
pocker # Start pocker
pocker update # Fetch and install latest version
```Keybinds can be seen in the footer when started or by pressing `?` to display help modal.
## 🔧 Configuration
Upon the first startup, a configuration file will be generated and stored at `$HOME/.config/pocker/config.yaml`.
| Key | Default | Info |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| log_tail | 2000 | At **startup**, Pocker will fetch `log_tail` amount of container logs.
Not recommended to exceed ~3000 as startup will slow down. |
| max_log_lines | 2000 | The displayed container logs are shown sequentially, with the oldest log being removed as a new one appears. |
| show_all_containers | false | Show running and exited containers. |
| start_fullscreen | false | Display container logs in fullscreen mode at startup. |
| start_scroll | true | Automatically scrolls when new logs are fetched. |
| start_wrap | false | When enabled, logs will wrap to fit the content window. |### Keymap [default]
| Key | Action | Description |
| ----- | -------------------------------- | -------------------------------------------------------------------------------- |
| `q` | Quit | Exits the application. |
| `l` | Logs | Opens the logs view to display log entries. |
| `/` | Search | Search logs. |
| `TAB` | Cycle widgets | Used to cycle widgets. Newly focused widget will have it's borders alter colors. |
| `a` | Attributes | Displays the attributes panel, showing various item attributes. |
| `e` | Environment | Opens the environment settings view. |
| `d` | Statistics | Shows statistical information related to the container. |
| `v` | Shell | Creates a shell for the current container. |
| `f` | Fullscreen | Toggles fullscreen mode for the logs view. |
| `n` | Fullscreen (Containers & Images) | Toggles fullscreen mode for containers and images view. |
| `w` | Wrap Logs | Toggles log wrapping in the logs view. |
| `s` | Toggle Scroll | Toggles scrolling mode for the current view. |This table helps you understand the functionalities assigned to each key, making navigation and operation more efficient.
### Errors
Errors will be displayed whenever encountered.
This can occur if an update is released with new keybinds required as an example.
The solution is to either add the new keybind manually or delete the config and restart pocker.
Default keymap can always be found [here](https://github.com/pommee/Pocker/blob/main/application/util/config.py).![keybind-error](https://github.com/pommee/Pocker/blob/main/resources/keybind-error.png?raw=true)
> Example of faulty keybind for `Shell`; in this case the key does not exist in the config.