Skip to content

feat: clearer text output for jh package commands - #72

Merged
pankgeorg merged 2 commits into
feat/package-info-detailsfrom
feat/package-pretty
Oct 15, 2026
Merged

pankgeorg merged 2 commits into
feat/package-info-detailsfrom
feat/package-pretty

Conversation

@pankgeorg

@pankgeorg pankgeorg commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Redesigns the text output of the jh package commands for people reading it; scripts have --json (#69).

  • info and search --verbose print a card per package: a header line (JuMP v1.32.1 · General · jump-dev), the description, then aligned fields with thousands separators, a 30-day download sparkline, dependency/dependent/contributor counts, links (repository, homepage, docs, the package's JuliaHub page https://<server>/ui/Packages/<registry>/<name>), the UUID and an install hint. info skips the "Found 1 package" line for a single match, and the tag list is cut by width.
  • search prints an aligned table with STARS and DL/30 DAYS columns. The OWNER separator and the VERSION column were wider than their headers, so columns drifted; names and descriptions are now cut at rune boundaries with "…" instead of at a byte offset.
  • dependency --short and dependents --short print a single line, e.g. JuMP v1.32.1 · General: 9 direct · 40 indirect · 49 total dependencies (not combinable with --json).
  • dependency and dependents share a heading and a direct · indirect · total line, and show standard libraries (no registry in pkg.json) as stdlib. dependency lists each package once: deps can hold a package as both direct and indirect (JuMP: 57 entries, 49 packages), and splitDependencies keeps one entry per UUID, direct winning, like splitDependents. This applies to dependency --json too.

Bold and dim styling is used only when stdout is a terminal, NO_COLOR is unset and TERM is not dumb; piped output is plain. Helpers are in style.go with unit tests. Checked against juliahub.com for info JuMP, search optim, dependency JuMP [--indirect] and dependents JuMP, piped and on a pseudo-terminal.

Example output against juliahub.com (piped, so without the bold/dim styling a terminal gets):

jh package info JuMP

JuMP  v1.32.1 · General · jump-dev
Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)

  Stars         2,482
  Downloads     78,428 in the last 30 days  ▁▁▁▂▂▃▅▃▅▅▅▄▄▂▃▃▂▄▄▂▁▁▂▃▄▅▆▆▇█
  Dependencies  9 direct · 49 total
  Dependents    335 direct · 429 total
  Contributors  163 · mlubin, odow, blegat, joehuchette, IainNZ, …
  License       MPL-2.0
  Released      Oct 2026
  Docs build    fallback_autodocs
  Tags          conic-programs, julia, linear-programming, … (+7)

  Repository    https://github.com/jump-dev/JuMP.jl
  Homepage      http://jump.dev/JuMP.jl/
  JuliaHub      https://juliahub.com/ui/Packages/General/JuMP
  UUID          4076af6c-e467-56ae-b986-b466b2749572

  Install       ] add JuMP

jh package search optim --limit 5

Showing 5 of 135 packages

NAME                         REGISTRY         OWNER              VERSION       STARS  DL/30 DAYS  DESCRIPTION
Optim                        General          JuliaNLSolvers     v2.3.2        1,205     202,632  Optimization functions for Julia
OptimizationSpeedMapping     General          SciML              v0.2.9          846          10  Mathematical Optimization in Julia. Local, global…
OptimizationSophia           General          SciML              v1.4.1          846          16  Mathematical Optimization in Julia. Local, global…
OptimizationSciPy            General          SciML              v0.4.11         846          28  Mathematical Optimization in Julia. Local, global…
OptimizationReactant         General          SciML              v0.1.1          846          22  Mathematical Optimization in Julia. Local, global…

jh package dependency JuMP

JuMP  v1.32.1 · General

9 direct · 40 indirect · 49 total dependencies

Direct dependencies (9)
NAME                                REGISTRY         UUID                                  VERSIONS
julia                               General          1222c4b2-2114-5bfd-aeef-88e4692bbb3e  1.10.0 - 1
LinearAlgebra                       stdlib           37e2e46d-f89d-539d-b4ee-838fcccc9c8e  1
MacroTools                          General          1914dd2f-81c6-5fcd-8719-6d5c9610ff09  0.5
MathOptInterface                    General          b8f27783-ece8-5eb3-8dc8-9495eed66fee  1.38.0 - 1
MutableArithmetics                  General          d8a4904e-b15c-11e9-3269-09a3773c0cb0  1.6.0 - 1
OrderedCollections                  General          bac558e1-5e72-5ebc-8fee-abe8a469f55d  1 - 2
PrecompileTools                     General          aea7be01-6a6a-4083-8856-8a6e6704d82a  1
Printf                              stdlib           de0858da-6303-5e67-8744-51eddeeeb8d7  1
SparseArrays                        stdlib           2f01184e-e22b-5df5-ae63-d93ebab69eaf  1

Use --indirect to list the 40 indirect dependencies

jh package dependents JuMP (first lines)

JuMP  v1.32.1 · General

335 direct · 94 indirect · 429 total dependents

Direct dependents (335)
NAME                                REGISTRY         UUID
AbsSmoothFrankWolfe                 General          6d364d26-5f85-487f-81b3-ae189dbb3e92
Agtor                               General          95dc4c25-59f6-4b9e-a920-4913b22a8444
AlgorithmAnalysis                   General          baa24b6d-515a-48bb-b1d2-0fdd27c035f8
…

Builds on #70 and targets its branch; GitHub retargets it to main as the stack merges.

- `info` (and `search --verbose`) print a card per package: a header line
  `name  vX · registry · owner`, the description, then aligned fields with
  thousands separators, a 30-day download sparkline, a link to the package's
  JuliaHub page and an install hint.
- `search` prints an aligned table with STARS and DL/30 DAYS columns; the
  OWNER separator and VERSION column used to be wider than their headers.
  Long names and descriptions are cut at rune boundaries with "…".
- `dependency` and `dependents` print the same heading and
  direct/indirect/total counts, with standard libraries shown as `stdlib`.
  `dependency` lists each package once: `deps` can hold a package as both
  direct and indirect, and `splitDependencies` keeps one entry per UUID (direct
  wins), in `--json` too.

Bold and dim styling is used only when stdout is a terminal, `NO_COLOR` is
unset and `TERM` is not `dumb`. The helpers live in `style.go`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pankgeorg added a commit that referenced this pull request Oct 14, 2026
- `info` (and `search --verbose`) print a card per package: a header line
  `name  vX · registry · owner`, the description, then aligned fields with
  thousands separators, a 30-day download sparkline, a link to the package's
  JuliaHub page and an install hint.
- `search` prints an aligned table with STARS and DL/30 DAYS columns.
  Long names and descriptions are cut at rune boundaries with "…".
- `dependency` and `dependents` print the same heading and
  direct/indirect/total counts, with standard libraries shown as `stdlib`.
  `dependency` lists each package once (`splitDependencies`, direct wins),
  in `--json` too.

Bold and dim styling is used only when stdout is a terminal, `NO_COLOR` is
unset and `TERM` is not `dumb`. The helpers live in `style.go`.

Backport of #72 (c9368f8) to the 0.4 line; the 0.4 search
path calls `printPackages` directly instead of through `emitPackages`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prints a single line with the counts, e.g.

    JuMP  v1.32.1 · General: 9 direct · 40 indirect · 49 total dependencies

`--short` cannot be combined with `--json`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pankgeorg
pankgeorg marked this pull request as ready for review October 14, 2026 17:15

@krynju krynju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pankgeorg
pankgeorg merged commit 61ccbae into feat/package-info-details Oct 15, 2026
@pankgeorg
pankgeorg deleted the feat/package-pretty branch October 15, 2026 15:12
pankgeorg added a commit that referenced this pull request Oct 15, 2026
- `info` (and `search --verbose`) print a card per package: a header line
  `name  vX · registry · owner`, the description, then aligned fields with
  thousands separators, a 30-day download sparkline, a link to the package's
  JuliaHub page and an install hint.
- `search` prints an aligned table with STARS and DL/30 DAYS columns.
  Long names and descriptions are cut at rune boundaries with "…".
- `dependency` and `dependents` print the same heading and
  direct/indirect/total counts, with standard libraries shown as `stdlib`.
  `dependency` lists each package once (`splitDependencies`, direct wins),
  in `--json` too.

Bold and dim styling is used only when stdout is a terminal, `NO_COLOR` is
unset and `TERM` is not `dumb`. The helpers live in `style.go`.

Backport of #72 (c9368f8) to the 0.4 line; the 0.4 search
path calls `printPackages` directly instead of through `emitPackages`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants