Skip to content

CLI: deps remove, deps pin, deps list - #154

Merged
Kinflou merged 1 commit into
mainfrom
cli/deps-remove-pin-list
Nov 12, 2026
Merged

Kinflou merged 1 commit into
mainfrom
cli/deps-remove-pin-list

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 12, 2026

Copy link
Copy Markdown
Member

Adds three subcommands to comline deps, next to add and accept (#153).

  • deps remove NAME [--dry-run] removes NAME's entry from config.idp. If a schema still imports it (use NAME::...) it refuses, listing each use by file and line, and writes nothing (also with --dry-run). Uses are found with core's schema parser, not by text. An unknown NAME lists the declared dependencies.
  • deps pin NAME re-resolves the dependency the way add does and rewrites its hash to the content just compiled. It never pins what doesn't resolve, prints the old and new hash, writes nothing when they match, and gives an entry without a hash one. --commit SHA --version VERSION (together, git only) moves a git dependency in the same step. If the new content gives up more through @unverified than the entry accepts, it runs add's accept flow (shown, asked on a terminal, else --accept-unverified).
  • deps list [--json] prints one line per declared dependency: source, pin and what's accepted. It reads only config.idp: no resolving, no network, no writes.

Edits are surgical like add/accept: only the affected entry changes. accept.rs gains a shared with_line (also used by accept, which now takes the indentation of the field above instead of always one four-space level) and entry_at. declared_dependencies now returns entries sorted by name (core hands them back from a HashMap). Docs: docs/cli.md, README, and the deps help. Tests in tests/cli/{remove,pin,list}.rs; the package helpers moved from add.rs to util.rs.

Draft until CI has run the suite.

remove takes a dependency's entry out of config.idp, refusing (and listing
each use by file and line) while a schema still imports it; --dry-run shows
the entry. pin re-resolves a dependency the way add does and rewrites its
hash to the content just compiled, optionally moving a git dependency to
another commit (--commit with --version) and running add's @Unverified
acceptance when the new content gives up more. list prints each declared
dependency's source, pin and accepted protocols from config.idp alone, as
text or --json.

Each edit changes only the affected entry; the rest of config.idp is left as
written.
@Kinflou
Kinflou marked this pull request as ready for review November 12, 2026 23:25
@Kinflou
Kinflou merged commit b5f1c39 into main Nov 12, 2026
13 checks passed
@Kinflou
Kinflou deleted the cli/deps-remove-pin-list branch November 12, 2026 23:25
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.

1 participant