Skip to content

[deckhouse-cli] Merge "cli" and "plugins" command into d8 "dist" - #437

Open
Glitchy-Sheep wants to merge 6 commits into
mainfrom
feat/refactor-package-management-commands
Open

[deckhouse-cli] Merge "cli" and "plugins" command into d8 "dist"#437
Glitchy-Sheep wants to merge 6 commits into
mainfrom
feat/refactor-package-management-commands

Conversation

@Glitchy-Sheep

Copy link
Copy Markdown
Contributor

Summary

d8 cli (self-update) and d8 plugins (plugin management) were two halves of one job: managing the installed d8 binary and its plugins.

This PR merges them into a single entry point, d8 dist (the "distribution"), and adds a root summary.

Command tree

Before (both trees removed):

d8 cli
├── check
├── update
├── use <version>
└── versions   (alias: list)

d8 plugins                   (hidden)
├── list
├── versions
├── contract
├── install
├── update (+ all)
└── remove

After:

d8 dist                      # NEW: summary - d8 version, plugins, what is outdated
├── check                    # is a newer d8 available
├── update                   # update the d8 binary
├── use <version>            # switch / roll back the d8 binary
├── versions   (alias: list) # d8 versions published in the registry
└── plugins                  # the plugins subtree, unchanged (still hidden)
    ├── list
    ├── versions
    ├── contract
    ├── install
    ├── update (+ all)
    └── remove

What changed

  • The four self-update commands moved from internal/selfupdate/cmd to a new internal/dist/cmd package, one file per command.
  • The plugins subtree is mounted under d8 dist as is; it stays hidden while the plugin ecosystem rolls out.
  • Cluster flags (--kubeconfig, --context, --rpp-*) moved to the dist root; the whole tree inherits them. The plugins subtree keeps only its own flags (--plugins-dir, --skip-cluster-checks).
  • Error hints, help texts, and docs point to the new paths.
  • No flag, alias, or behavior is lost - see Tests.

The new summary

d8 dist with no arguments prints the state of the distribution.
If the cluster is unreachable, it prints local data and a warning instead of failing:

$ d8 dist
deckhouse-cli (d8)
  Version:  v0.33.5
  Latest:   v0.34.0  update available - run 'd8 dist update'

Plugins (2 installed):
  NAME    VERSION  LATEST  STATUS
  dk      0.5.1    0.5.1   up to date
  system  1.2.0    1.3.0   update available

Update a plugin with 'd8 dist plugins update <name>' or 'd8 dist plugins update all'.
  • "Latest" for the binary and for each plugin comes from the in-cluster registry-packages-proxy, same as check and plugins versions.
  • The summary is read-only: it never creates the plugins directory and finds installs in the home fallback (~/.deckhouse-cli) too.

Breaking change

d8 cli ... and d8 plugins ... are gone; scripts must switch to
d8 dist ... / d8 dist plugins ....

  • d8 cli shipped in releases since v0.32.0.
  • d8 plugins was always hidden and undocumented.

@Glitchy-Sheep Glitchy-Sheep changed the title Feat/refactor package management commands [deckhouse-cli] Merge "cli" and "plugins" command into d8 "dist" Aug 4, 2026
@Glitchy-Sheep Glitchy-Sheep self-assigned this Aug 4, 2026
@Glitchy-Sheep Glitchy-Sheep added the enhancement New feature or request label Aug 4, 2026
- `AddFlags` now registers only `--plugins-dir` and `--skip-cluster-checks`.
- New `AddKubeFlags` registers `--kubeconfig`/`--context`, bound to the package vars.
- The plugins command composes all three sets, so its flag surface stays the same.
- Prepares the dist root command to own the cluster flags for the whole tree.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `d8 dist` now manages the whole distribution: the binary (check/update/use/versions) and the plugins subtree.
- The old `d8 cli` and `d8 plugins` top-level commands are gone.
- Cluster access flags (`--kubeconfig`, `--context`, `--rpp-*`) live on the dist root and are inherited by the plugins subtree.
- One file per command in `internal/dist/cmd`; shared updater and color palette split into their own files.
- Anchor the `dist/` gitignore pattern to the repo root so `internal/dist` is trackable.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Error suggestions and help texts now point to `d8 dist ...` and `d8 dist plugins ...`.
- Package docs reference the new tree; pluginscmd gets a doc.go with the subtree map.
- Tests asserting the hint strings updated to match.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Running `d8 dist` prints the d8 version, installed plugins, and what is outdated.
- Freshness comes from the registry-packages-proxy; an unreachable cluster degrades the summary to local data with a warning instead of failing.
- The plugins root is resolved read-only (configured root or home fallback), so the summary never creates directories.
- Semantic color palette follows the mirror summary convention; rendering is a pure function covered by unit tests.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- User docs and package READMEs now describe `d8 dist` and `d8 dist plugins` paths.
- The self-update doc gets the `d8 dist` summary: a commands-table row and a transcript example.
- Package maps point to `internal/dist/cmd` as the command layer.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep
Glitchy-Sheep force-pushed the feat/refactor-package-management-commands branch from afccb6f to a853568 Compare August 5, 2026 08:20
@Glitchy-Sheep
Glitchy-Sheep marked this pull request as ready for review August 5, 2026 08:20
- Bare `d8 dist` prints help again, like every other command group.
- The summary lives at `d8 dist status`, mirroring the `d8 status` verb.
- The dist root keeps an explicit Run so a stray argument still errors instead of silently showing help.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant