lfed

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0

README

lfed

lfed is the education platform CLI. The host binary provides contexts, login and a plugin manager. Plugins add the operator commands and live in other repositories.

Install

curl -fsSL https://raw.githubusercontent.com/LF-Certification/p3-forge/main/cli/lfed/install.sh | bash

The installer downloads the newest cli/lfed/v* GitHub Release for your OS and architecture, verifies checksums.txt, and installs lfed into ~/.local/bin. Set LFED_VERSION=X.Y.Z to pin a version and LFED_INSTALL_DIR to change the directory.

From source: make install-local builds into $GOBIN.

First use

lfed context use staging
lfed auth login
lfed plugin install cluster
lfed cluster --help

Plugins

Plugins are published as OCI artifacts under ghcr.io/lf-certification/lfed-cli-plugins/<name>. The packages are private; the pull needs a GitHub token with read:packages:

gh auth refresh -s read:packages

lfed looks for credentials in the Docker config (docker login ghcr.io), then GITHUB_TOKEN, GH_TOKEN, then gh auth token.

Command Effect
lfed plugin install cluster newest version that supports this lfed
lfed plugin install cluster@0.2.0 that version
lfed plugin install ghcr.io/acme/tools/foo:1.0.0 any registry, full reference
lfed plugin install ./cli build and install a local Go main package, or copy a binary
lfed plugin upgrade [name...] re-resolve registry installs; --dry-run only reports
lfed plugin list installed plugins with version, status and source
lfed plugin remove <name> delete the plugin directory

A local path MUST start with ./, ../, / or ~/. A bare word is a plugin name. LFED_PLUGIN_REGISTRY replaces the default registry prefix.

Plugins install into $XDG_DATA_HOME/lfed/plugins/<name>/ (default ~/.local/share/lfed/plugins) as lfed-<name> plus lfed-plugin.json. LFED_PLUGIN_DIR overrides the directory.

Versioning

Releases are tagged cli/lfed/vX.Y.Z and built by .github/workflows/cli-release.yml. See VERSIONING.md at the repository root. The Go module github.com/LF-Certification/p3-forge/cli/lfed is v0.x: the sdk/ packages MAY change between minor versions. Plugins pin the SDK version in go.mod and declare the host range they accept in the manifest field requires_lfed.

Development

make lint test          # vet, gofmt, govulncheck, go test
make build              # bin/lfed with a 0.1.0-dev+<sha> version
make release-snapshot   # GoReleaser archives in dist/, no publish

Directories

Path Synopsis
cmd
lfed command
Command lfed is the education platform CLI.
Command lfed is the education platform CLI.
internal
auth
Package auth implements the Auth0 device code login and token refresh for one context.
Package auth implements the Auth0 device code login and token refresh for one context.
build
Package build holds values set at link time.
Package build holds values set at link time.
cmd/auth
Package auth implements `lfed auth login|logout|status|token`.
Package auth implements `lfed auth login|logout|status|token`.
cmd/context
Package context implements `lfed context list|use|current`.
Package context implements `lfed context list|use|current`.
cmd/plugin
Package plugin implements `lfed plugin install|list|remove`.
Package plugin implements `lfed plugin install|list|remove`.
cmd/root
Package root builds the `lfed` root command and dispatches unknown commands to plugins.
Package root builds the `lfed` root command and dispatches unknown commands to plugins.
cmd/version
Package version implements `lfed version`.
Package version implements `lfed version`.
cmdutil
Package cmdutil holds the Factory injected into every command package.
Package cmdutil holds the Factory injected into every command package.
config
Package config reads and writes $XDG_CONFIG_HOME/lfed/config.yaml.
Package config reads and writes $XDG_CONFIG_HOME/lfed/config.yaml.
contexts
Package contexts is the compiled-in table of deployment contexts.
Package contexts is the compiled-in table of deployment contexts.
credstore
Package credstore stores lfed credentials and login state per context.
Package credstore stores lfed credentials and login state per context.
jq
Package jq applies a jq filter to a JSON document, the way `gh --jq` does: strings print raw, every other result prints as compact JSON, one result per line.
Package jq applies a jq filter to a JSON document, the way `gh --jq` does: strings print raw, every other result prints as compact JSON, one result per line.
pluginmgr
Package pluginmgr manages installed lfed plugins.
Package pluginmgr manages installed lfed plugins.
sdk
auth
Package auth obtains the access token a plugin sends to the API.
Package auth obtains the access token a plugin sends to the API.
config
Package config resolves the LFED_* environment the lfed CLI exports to a plugin process.
Package config resolves the LFED_* environment the lfed CLI exports to a plugin process.
httpc
Package httpc is a small bearer-token JSON client with typed errors.
Package httpc is a small bearer-token JSON client with typed errors.
output
Package output renders command results as a table, JSON or YAML.
Package output renders command results as a table, JSON or YAML.
plugin
Package plugin is the Go SDK for lfed plugins.
Package plugin is the Go SDK for lfed plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL