Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,49 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-docs:
name: Publish CLI docs to gh-pages
needs: goreleaser
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout Code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: go.mod
cache: false

- name: Generate CLI reference docs
run: go run ./cmd/lfx docs --output ./docs-out

- name: Checkout gh-pages
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: gh-pages
path: gh-pages
persist-credentials: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish docs
run: |
mkdir -p gh-pages/docs
cp docs-out/cli.md gh-pages/docs/cli.md
cd gh-pages
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet -- docs/cli.md; then
echo "No changes to docs/cli.md; skipping commit."
exit 0
fi
git add docs/cli.md
git commit -s -m "docs: publish CLI reference for ${GITHUB_REF_NAME}"
git push origin gh-pages
25 changes: 22 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ Credential storage (system keychain via `99designs/keyring`) and the Auth0
CIMD client are tracked separately.

**No container build**: this project produces binary artifacts only,
distributed via GitHub Releases and `go install`. There is no Dockerfile,
Helm chart, or container image pipeline.
distributed via GitHub Releases, the `install.sh` curl-style installer
hosted on `gh-pages`, and `go install`. There is no Dockerfile, Helm
chart, or container image pipeline.

## Development Workflow

Expand Down Expand Up @@ -157,13 +158,31 @@ between files in the same package.

The hidden `lfx docs` command generates Markdown reference documentation
for all commands via `cli-docs.ToMarkdown()`, intended for local agent use
and future publishing to the `gh-pages` branch:
and for publishing to the `gh-pages` branch:

```bash
lfx docs # Print to stdout
lfx docs --output ./docs # Write to ./docs/cli.md
```

## gh-pages Branch

The `gh-pages` branch is a static asset branch (not source code) served at
`https://linuxfoundation.github.io/lfx-cli/`. It holds:

- `install.sh` -- the curl-style installer referenced in the README
- `client-metadata.json` -- the CIMD (Client ID Metadata Document) for the
LFX CLI's Auth0 Device Code client; this URL *is* the client_id (see
`auth0-terraform`'s `clients_cimd.tf` for the corresponding client
definition)
- `docs/cli.md` -- generated CLI reference docs, republished on every
tagged release by the **Publish Tagged Release** workflow's
`publish-docs` job (see `.github/workflows/release-tag.yml`)

Only edit `install.sh` or `client-metadata.json` directly on `gh-pages`
when the install flow or CIMD metadata changes; `docs/cli.md` is
regenerated automatically and should not be hand-edited.

## Release Process

Releases follow [semantic versioning](https://semver.org/) (`vMAJOR.MINOR.PATCH`).
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ token`).
## Installation

```bash
go install github.com/linuxfoundation/lfx-cli/cmd/lfx@latest
curl -sSL https://linuxfoundation.github.io/lfx-cli/install.sh | sh
```

Prebuilt binaries for Linux, macOS, and Windows are also published on the
[Releases](https://github.com/linuxfoundation/lfx-cli/releases) page.
This downloads the correct prebuilt binary for your OS/architecture from the
[Releases](https://github.com/linuxfoundation/lfx-cli/releases) page,
verifies its checksum, and installs it to `/usr/local/bin` (or `~/.local/bin`
if that's not writable). Set `LFX_CLI_VERSION` to pin a specific release, or
`LFX_CLI_INSTALL_DIR` to override the install location.

Alternatively, install with Go:

```bash
go install github.com/linuxfoundation/lfx-cli/cmd/lfx@latest
```

## Usage

Expand Down
Loading