This is a late-bound plugin system for Go binaries with:
plugctlTaskfile.yml vars:
vars:
GITHUB_USER: your-username
GITHUB_REPO: your-repo-name
internal/version/version.go:
var (
GitHubUser = "your-username"
GitHubRepo = "your-repo-name"
)
cmd/plugins/your-plugin/README.md in each plugin folder (gets merged into docs)task docs:generate
v0.1.0 to trigger first releasecmd/
plugctl/ # Client tool - manages plugins
plugins/
x1ctl/ # Plugin: Bambu Lab X1 CLI
main.go
cmd/ # Cobra subcommands
README.md # Plugin docs (merged into index.md)
fakeprinter/ # Plugin: Mock printer server
main.go
README.md
docgen/ # Generates docs/index.md
internal/
version/
version.go # Self-update logic
plugin.go # Plugin management (install, list, update)
docs/
index.md # Landing page (GENERATED by docgen)
*_user.md # User guides
*_tech.md # Technical docs
.github/
workflows/
ci.yml # Build + release on tags
cmd/plugins/newplugin/main.goREADME.md in the plugin foldertask docs:generate to update docsinternal/version packageUsers install plugins via plugctl:
plugctl list # list available plugins
plugctl install x1ctl # install to ~/.plugctl/bin/
plugctl update # update all installed plugins
plugctl install --local ./dist/x1ctl_darwin_arm64 # local build
Plugins can also self-update:
x1ctl update
x1ctl version --check
The internal/version/ package provides:
version.Info() - returns version stringversion.CheckUpdate() - queries GitHub API for latest releaseversion.SelfUpdate(binaryName) - downloads and replaces the running binaryversion.InstallPlugin(name) - downloads plugin to ~/.plugctl/bin/version.ListAvailable() - lists plugins from GitHub releasesBuild-time version injection via Taskfile:
LD_FLAGS: "-X /internal/version.Version="
GitHub Actions (.github/workflows/ci.yml):
task build:allv* tags, uploads to GitHub ReleasesKey task used by CI: task build:all
Pages serve from /docs on main branch (native GitHub markdown rendering).
Setup tasks:
task docs:pages:setup # configure Pages via gh API
task docs:pages:status # check configuration
task docs:generate # regenerate docs from plugin READMEs
task build:local # build for current platform
task build:all # build all platforms
task docs:generate # regenerate docs
task release:create -- v0.2.0 # tag + push (triggers release)
task run:plugctl -- list
README.md in its folderdocs/index.md is GENERATED - edit cmd/docgen/template.md insteadtask docs:generate after changing plugins or template