Skip to content

feat: extend datumctl with installable service plugins#198

Open
scotwells wants to merge 4 commits into
mainfrom
worktree-agent-aaa7004d0f14304c6
Open

feat: extend datumctl with installable service plugins#198
scotwells wants to merge 4 commits into
mainfrom
worktree-agent-aaa7004d0f14304c6

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

@scotwells scotwells commented May 22, 2026

Closes #197

Summary

Operators can now install service plugins into datumctl that work exactly like built-in commands — with tab completion, help text, and automatic credential forwarding. This ships the foundation for the Datum Cloud CLI extension ecosystem.

What's new

For operators:

  • Install any Datum-compatible plugin from GitHub Releases: datumctl plugin install datumctl-dns
  • Plugins invoke seamlessly as native subcommands: datumctl dns zones list
  • Unknown commands prompt you to install the matching plugin automatically
  • Tab-complete plugin names, subcommands, and flags just like built-in commands
  • datumctl plugin list shows installed plugins and flags available updates
  • datumctl plugin search discovers community plugins via GitHub topics
  • Credentials are forwarded securely — tokens are never stored in the environment

For plugin authors:

  • Go SDK (go.datum.net/datumctl/plugin) with Context(), Token(), ServeManifest(), and NewRootCmd() helpers
  • Reference implementation in examples/plugin-dns/ showing a working end-to-end integration
  • Manifest protocol (--plugin-manifest) for compatibility checks at install and invocation time

Test plan

  • go build ./... passes
  • go test ./internal/pluginstore/... ./internal/plugindispatch/... ./internal/cmd/plugin/... ./plugin/... passes (43 tests)
  • Build and install examples/plugin-dns/, run datumctl dns zones list end-to-end
  • Verify built-in commands cannot be shadowed by a plugin with the same name
  • Verify unmanaged plugin on PATH triggers a warning

🤖 Generated with Claude Code

scotwells added a commit to datum-cloud/compute that referenced this pull request May 22, 2026
Adds the datumctl-compute plugin binary with commands for deploying and
managing containerized workloads on Datum Cloud via the developer CLI.

Commands:
- deploy     — create or update a workload from flags or a manifest file
- destroy    — delete a workload and clean up its revision history
- status     — show health, placement summary, and recent revision info
- instances  — list and describe running instances across cities
- scale      — adjust minimum replica count across placements
- rollout    — watch live progress, view history, and roll back revisions
- restart    — trigger a rolling restart of a workload or specific city
- quota      — inspect per-city instance usage and quota headroom

Closes #98. Depends on datum-cloud/datumctl#198.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells changed the title feat: install and invoke datumctl service extensions feat: extend datumctl with installable service plugins May 25, 2026
@scotwells scotwells force-pushed the worktree-agent-aaa7004d0f14304c6 branch from 205a931 to 0207a0c Compare May 27, 2026 18:07
@scotwells scotwells marked this pull request as ready for review May 27, 2026 18:53
@scotwells scotwells force-pushed the worktree-agent-aaa7004d0f14304c6 branch 2 times, most recently from 47d9d76 to 6cb991e Compare May 27, 2026 21:19
scotwells and others added 4 commits May 27, 2026 16:34
Introduces the plugin subsystem: install, list, remove, upgrade, trust,
and invoke external datumctl-<name> binaries. Plugins are stored in
~/.datumctl/plugins with a JSON manifest. The plugin SDK (go.datum.net/
datumctl/plugin) lets authors declare manifests, handle token injection,
and receive forwarded Cobra invocations.

Security: untrusted PATH plugins hard-error instead of warning-and-exec;
trust entries record SHA256 at trust time and re-verify on each invocation;
single EvalSymlinks call eliminates TOCTOU window. Plugin names and GitHub
owner/repo validated against strict charsets; all download URIs must use
https://. Stored SHA256 reflects the extracted binary (not the archive) so
ForwardPlugin integrity checks work correctly. The RunE path enforces the
same integrity check as ForwardPlugin, closing the bypass where a failed
ForwardPlugin would fall through and still exec. Plugin store uses
0o700/0o600 permissions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds 'datumctl plugin search' to browse the curated plugin index and
suggests installable plugins when an unknown command is typed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Provides shell completion for all plugin subcommands and publishes a
public plugin/ package with the shared types plugins need to implement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers the plugin development guide, trust model, manifest format, and
installation flow for authors building datumctl plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells force-pushed the worktree-agent-aaa7004d0f14304c6 branch from 6cb991e to 65ef355 Compare May 27, 2026 21:37
scotwells added a commit to datum-cloud/compute that referenced this pull request May 29, 2026
Adds the datumctl-compute plugin binary with commands for deploying and
managing containerized workloads on Datum Cloud via the developer CLI.

Commands:
- deploy     — create or update a workload from flags or a manifest file
- destroy    — delete a workload and clean up its revision history
- status     — show health, placement summary, and recent revision info
- instances  — list and describe running instances across cities
- scale      — adjust minimum replica count across placements
- rollout    — watch live progress, view history, and roll back revisions
- restart    — trigger a rolling restart of a workload or specific city
- quota      — inspect per-city instance usage and quota headroom

Closes #98. Depends on datum-cloud/datumctl#198.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scotwells added a commit to datum-cloud/compute that referenced this pull request May 29, 2026
Adds the datumctl-compute plugin binary with commands for deploying and
managing containerized workloads on Datum Cloud via the developer CLI.

Commands:
- deploy     — create or update a workload from flags or a manifest file
- destroy    — delete a workload and clean up its revision history
- status     — show health, placement summary, and recent revision info
- instances  — list and describe running instances across cities
- scale      — adjust minimum replica count across placements
- rollout    — watch live progress, view history, and roll back revisions
- restart    — trigger a rolling restart of a workload or specific city
- quota      — inspect per-city instance usage and quota headroom

Closes #98. Depends on datum-cloud/datumctl#198.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells scotwells requested review from a team and savme May 29, 2026 14:43
@scotwells
Copy link
Copy Markdown
Contributor Author

You can confirm this is working by installing the new compute plugin:

$ datumctl plugin install compute
Installed compute v0.8.0-dev.4

There's a new datumctl-plugins repo that maintains our list of plugins.


// execPlatform runs binaryPath on Windows using exec.Command and os.Exit.
// Windows does not support syscall.Exec.
func execPlatform(binaryPath string, args []string, env []string) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

shouldn't kubecmd.NewDefaultPluginHandler work on windows as well?

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.

Extend datumctl with service-specific commands

2 participants