Skip to main content

List your docker containers in a better way!

Project description

docker-ps-cli

A simple and powerful command-line tool to display running Docker containers in a cleaner and more readable format.

Features

  • Enhanced Docker Container Listing: Provides a user-friendly and customizable output for docker ps.
  • Selectable Columns: Choose which container details to display.
  • Advanced Filtering: Filter containers using Docker's built-in filters or custom patterns.
  • Customizable Styles: Display container information in various table styles.
  • Lightweight and Fast: Built with performance in mind.

Installation

Install the package via pip:

pip install docker-ps-cli

Alternatively, download the latest .whl file from the Releases page and install it:

pip install docker_ps_cli-1.0.0-py3-none-any.whl

Requirements

  • Python 3.9 or higher

Usage

Run the following command to see available options:

docker-ps-cli [-h] [-a] [-n NUM] [-l] [-f KEY=VALUE] [--find 'KEY=PATTERN'] [--id | --no-id]
[--image | --no-image] [--command | --no-command] [--created | --no-created]
[--status | --no-status] [--port | --no-port] [--name | --no-name] [--size | --no-size]
[--health | --no-health] [--label | --no-label] [--columns COLS] [--hide-column COLS]
[-q] [--no-trunc] [--style {ascii,minimal,rounded,simple,square}] [--show-lines]
[--log-level {DEBUG,INFO,WARNING,ERROR}]

A Python wrapper for 'docker ps' with rich filtering and column selection.

optional arguments:
-h, --help            show this help message and exit

Container Selection:
-a, --all             Show all containers (default shows running only).
-n NUM, --last NUM    Show the last NUM created containers.
-l, --latest          Show the latest created container (mutually exclusive with -n).

Filtering:
-f KEY=VALUE, --filter KEY=VALUE
Filter output using Docker's native filters. Can be used multiple times. Common keys:
status, name, label, ancestor, network, health. Example: -f 'status=exited' -f
'name=web*'
--find 'KEY=PATTERN'  Filter results *after* fetching from Docker. Supports glob patterns (*). Keys match
column headers (e.g., 'Names', 'Image'). Case-insensitive. Example: --find
'Names=api-* Image=*ubuntu*'

Column Control:
Control which columns are displayed. Using any --<column> flag will show ONLY the specified columns.
Using --no-<column> will hide that column from the default view.

--id, --no-id         Show/hide the ID column.
--image, --no-image   Show/hide the Image column.
--command, --no-command
Show/hide the Command column.
--created, --no-created
Show/hide the Created column.
--status, --no-status
Show/hide the Status column.
--port, --no-port     Show/hide the Ports column.
--name, --no-name     Show/hide the Names column.
--size, --no-size     Show/hide the Size column.
--health, --no-health
Show/hide the Health column.
--label, --no-label   Show/hide the Labels column.

Output and Column Control:
--columns COLS        Comma-separated list of columns to display. Example: --columns ID,Image,Names,Status
--hide-column COLS    Comma-separated list of columns to hide from the output.
-q, --quiet           Only display container IDs (ignores formatting and --find).

Styling:
--no-trunc            Don't truncate output (affects Command, Image, etc.).
--style {ascii,minimal,rounded,simple,square}
Table border style to use. (default: rounded)
--show-lines          Show horizontal lines in the table. (default: True)

General:
--log-level {DEBUG,INFO,WARNING,ERROR}
Set the logging level. (default: WARNING)

Example Commands

  • List all running containers:
docker-ps-cli
  • Show all containers (including stopped ones):
docker-ps-cli -a
  • Display containers with specific columns:
docker-ps-cli --id --name --status
  • Filter containers by status:
docker-ps-cli --filter "status=running"
  • Use custom table styles:
docker-ps-cli --style rounded

Development

This project is actively maintained and welcomes contributions. Feel free to open issues or submit pull requests on the GitHub repository.

Contributors

I appreciate all contributions to this project. If you find bugs or have suggestions, please open an issue or submit a pull request.

License

This project is licensed under the GPL-3.0-or-later license. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker_ps_cli-1.0.1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docker_ps_cli-1.0.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file docker_ps_cli-1.0.1.tar.gz.

File metadata

  • Download URL: docker_ps_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for docker_ps_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7f5d4e8a42ef156b0aaa717312fa73c50dd249e5674f1c889ec0219fff614f3d
MD5 27dc6962b3e1b9821a00545f5db82a4f
BLAKE2b-256 f2af2d6e9fb937644c88ed7ee8936b282a11140fa1fa511ae68f9e5a155ab188

See more details on using hashes here.

File details

Details for the file docker_ps_cli-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_ps_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c019ae4e34ec6913c47686eadef7d38d4bf5553eceaf089c216f7d162d4c3f78
MD5 4bb768a3cebd5585207d1688eb911e9f
BLAKE2b-256 bec3a0c63739bb01c90d6ec385c56ff3f3b0e5f6451b9c7936c821030d696813

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page