Skip to content

feat: install and invoke datumctl service extensions#198

Draft
scotwells wants to merge 14 commits into
mainfrom
worktree-agent-aaa7004d0f14304c6
Draft

feat: install and invoke datumctl service extensions#198
scotwells wants to merge 14 commits into
mainfrom
worktree-agent-aaa7004d0f14304c6

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

Closes #197

What ships

  • datumctl plugin install/list/upgrade/remove — managed installs from GitHub Releases with SHA256 verification and a lock file for reproducible installs
  • Plugin dispatch — datumctl dns ... automatically finds and execs datumctl-dns, passing the operator's active org, project, and API host as environment variables
  • Credential helper — plugins call datumctl auth get-token on demand; tokens are never injected into the environment
  • Plugin manifest protocol — binaries respond to --plugin-manifest for compatibility checks at install and invocation time
  • Go SDK (go.datum.net/datumctl/plugin) — Context(), Token(), ServeManifest(), NewRootCmd() for first-party plugin authors
  • Reference plugin (examples/plugin-dns/) showing a working end-to-end integration
  • Unmanaged PATH plugin support with a one-time warning

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 warning

🤖 Generated with Claude Code

scotwells and others added 3 commits May 22, 2026 14:08
Closes #197

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
Cobra rejects unknown flags before RunE fires, which caused plugin
subcommand flags (e.g. --image, --city) to be dropped or rejected when
invoking a plugin with subcommands.

Adds ForwardPlugin, which mirrors the ForwardHelp/ForwardCompletion
pattern: after the command tree is fully built, if os.Args[1] resolves
to a managed plugin binary and is not a built-in command, the process
is replaced via syscall.Exec before cobra.Execute() runs. This passes
all original args — including plugin-owned flags — through unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scotwells and others added 2 commits May 22, 2026 17:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scotwells and others added 8 commits May 22, 2026 17:50
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also fixes plugin list showing blank version for manually-placed binaries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ForwardCompletion now accepts a *client.DatumCloudFactory and calls
BuildEnv to overlay the six DATUM_* variables onto the child process
environment. Without this, plugin completion handlers that call the
Datum API (e.g. CompleteWorkloadNames) silently failed because
DATUM_API_HOST and DATUM_CREDENTIALS_HELPER were absent.

The factory is now created before ForwardCompletion in root.go so the
credentials are available at completion time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also improves install error messages to be less technical.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
plugin list now shows "update" in the STATUS column when a newer
version is available in the local index. plugin search saves its
results to the index cache so subsequent list invocations reflect
the latest discovery. A hint line is printed on TTY when any
updates are found.

Co-Authored-By: Claude Sonnet 4.6 <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.

Extend datumctl with service-specific commands

1 participant