Skip to content

v0.2.0

Choose a tag to compare

@atif-1402 atif-1402 released this 10 Oct 21:04
· 37 commits to main since this release

v0.2.0: Docker support

parse now formats four docker commands. Same rule as the other tools: make
hard-to-read output readable, and leave everything else byte for byte.

docker-preview

What's new

docker ps / docker ps -a

  • Columns reordered: NAME, STATE, IMAGE, PORTS, CREATED, ID
  • Status split into state and duration, with the exit code shown only when
    it is nonzero
  • Sorted: running first, then failing exits, then clean exits
  • One-line summary on top, IPv4/IPv6 port twins collapsed into one

docker inspect

  • A short grouped summary instead of hundreds of lines of JSON
  • Only fields that are set or signal a problem are shown; defaults and empty
    values are hidden
  • Env vars that come from the image are hidden, so only the ones you set show
  • Secrets masked by default, including passwords inside URLs
    (postgres://user:****@host/db). Use --show-secrets to reveal them
  • Flags for nonzero exit, OOMKilled, unhealthy, privileged, running as root,
    and bind mounts whose source path is missing

docker network inspect

  • Header with driver, scope, subnet and gateway, then a table of attached
    containers (name, IPv4, MAC)

docker system df and docker system df -v

  • Summary line (images, build cache, volumes, containers, reclaimable)
  • Tables sorted by size, sizes normalized, empty columns hidden
  • unused and dangling tags
  • Reclaimable matches docker's own number. In pipe mode with -v, totals built
    from summed rows are marked with ~ because they can't be exact. Direct
    mode (parse docker system df -v) uses exact totals

Usage

docker ps -a | parse
docker inspect <container> | parse
parse docker system df -v

Color is off automatically when output is piped, and NO_COLOR is respected.

Safety

  • Input that isn't default docker output (--format, -q) passes through
    unchanged
  • If a formatter hits a bug, parse prints your original text and a one-line
    warning on stderr instead of crashing
  • The docker detectors only claim real docker output, so git diffs and other
    tools are left alone

Not yet ( working on it )

  • Other docker commands (stats, logs, images, info, history, compose ps,
    volume ls, build, pull, top) pass through to real docker unchanged
  • There is no --raw flag. To see the original JSON, run the command
    without | parse

Install

go install github.com/atif-1402/parse@v0.2.0

Full Changelog: v0.1.0...v0.2.0