Skip to content

feat(cli): add mops info command#471

Merged
Kamirus merged 13 commits intomainfrom
feat/info-command
Apr 1, 2026
Merged

feat(cli): add mops info command#471
Kamirus merged 13 commits intomainfrom
feat/info-command

Conversation

@Kamirus
Copy link
Copy Markdown
Collaborator

@Kamirus Kamirus commented Apr 1, 2026

Summary

Adds a mops info <pkg> CLI command that displays package metadata from the mops registry.

  • mops info <pkg> — show package info (latest version)
  • mops info <pkg>@<version> — show info for a specific version
  • mops info <pkg> --versions — list all published versions, one per line (for scripting)

Example

$ mops info core

core@2.3.1
The Motoko standard library

license         Apache-2.0
repository      https://github.com/caffeinelabs/motoko-core
dev-deps        test@2.1.1, bench@1.0.0, fuzz@1.0.0, matchers@2.1.0, ...

keywords        core, base, data-structure, stable-memory, persistent

versions        2.3.1, 2.3.0, 2.2.0, 2.1.0, 2.0.0, 1.0.0, 0.6.0, 0.5.0
$ mops info core --versions
0.5.0
0.6.0
1.0.0
2.0.0
2.1.0
2.2.0
2.3.0
2.3.1

Test plan

  • mops info core — verified output
  • mops info core@1.0.0 — shows "latest: 2.3.1" indicator
  • mops info core --versions — plain version list, one per line
  • mops info nonexistent-pkg — prints Error: Package 'nonexistent-pkg' not found
  • mops info core@99.99.99 — prints error for invalid version
  • mops --help — lists the info command
  • CI lint and type checks pass

Kamirus and others added 13 commits April 1, 2026 09:29
Display detailed package metadata from the mops registry, similar to
`npm info`. Supports `mops info <pkg>` for latest and
`mops info <pkg>@<version>` for a specific version.

Made-with: Cursor
- Add missing `import process from "node:process"` to match codebase convention
- Prevent "Error: Error:" duplication in catch block
- Show actual backend error from getPackageDetails instead of hardcoded message

Made-with: Cursor
Add curly braces to all single-line if statements and reformat
long lines to satisfy prettier and eslint curly rule.

Made-with: Cursor
Lists all published versions with publication dates and release notes.
Usage: mops info <pkg> --versions

Made-with: Cursor
Output one version per line with no formatting, making it
suitable for piping into other CLI tools.

Made-with: Cursor
Drop formatting helpers (formatUser, formatDate, formatSize,
formatDownloads) and sections that depend on them (publisher,
owners, downloads, file stats, quality, release notes).
Keep only simple string fields. Can be extended later.

Made-with: Cursor
- Fix --versions help text (claimed dates, but only prints versions)
- Move info import to alphabetical position in cli.ts
- Document ascending version order assumption
- Update docs with latest indicator and version order

Made-with: Cursor
@Kamirus Kamirus marked this pull request as ready for review April 1, 2026 09:31
@Kamirus Kamirus requested a review from a team as a code owner April 1, 2026 09:31
@Kamirus Kamirus requested a review from rvanasa April 1, 2026 09:54
Copy link
Copy Markdown
Collaborator

@rvanasa rvanasa left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kamirus Kamirus merged commit 8e3ff96 into main Apr 1, 2026
26 of 28 checks passed
@Kamirus Kamirus deleted the feat/info-command branch April 1, 2026 14:10
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