@ahmedrowaihi/docker-batch
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Docker Batch

An interactive CLI tool for batch operations on Docker resources (volumes, containers, images, and networks) with a user-friendly interface.

Features

  • Interactive multi-select interface for batch operations
  • Support for multiple Docker resource types:
    • Volumes
    • Containers (with force removal of running containers)
    • Images
    • Networks (with protection for system networks)
  • Visual indicators for networks:
    • 🔒 Protected system networks
    • 🔄 Internal networks
    • 🌐 Custom networks
  • Type-safe implementation using TypeScript

Prerequisites

  • Node.js >= 18.0.0
  • Docker daemon running on your system

Installation

Global Installation (Recommended)

npm install -g @ahmedrowaihi/docker-batch

Local Installation

npm install @ahmedrowaihi/docker-batch

Usage

If installed globally, you can use either command:

docker-batch
# or the shorter alias
dkb

If installed locally:

npx docker-batch
# or
npx dkb

The tool will:

  1. Prompt you to select a resource type (volumes, containers, images, or networks)
  2. Display available resources of the selected type
  3. Allow you to select multiple items for batch operations
  4. Ask for confirmation before removal
  5. Show the status of each operation

Key Commands

  • Use arrow keys to navigate
  • Space to select/unselect items
  • Enter to confirm selection
  • Ctrl+C to exit

Development

Project Structure

src/
  containers/   - Container batch operations
  images/       - Image batch operations
  networks/     - Network batch operations
  volumes/      - Volume batch operations
  shared/       - Shared types and base classes

Building from Source

  1. Clone the repository:

    git clone https://github.com/ahmedrowaihi/docker-batch.git
    cd docker-batch
  2. Install dependencies:

    bun install
  3. Build the project:

    bun run build
  4. Run locally:

    bun start

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Package Sidebar

Install

npm i @ahmedrowaihi/docker-batch

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

14.7 kB

Total Files

25

Last publish

Collaborators

  • ahmedrowaihi