fleet-plan

module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT

README

fleet-plan logo

fleet-plan

terraform plan, but for Fleet.

codecov GitHub Release


Shows what will change in your Fleet environment before you apply. Compares fleet-gitops YAML against the live Fleet API. Read-only (GET only).

Run in CI before fleetctl gitops --dry-run. fleet-plan shows what changes. fleetctl validates whether it's valid.

fleet-plan terminal diff

Disclaimer: This was created as a fun side project, not affiliated with any company.

Install

Grab a binary from Releases or install via Go:

go install github.com/TsekNet/fleet-plan/cmd/fleet-plan@latest

Quick start

# All teams
fleet-plan

# Single team
fleet-plan --team Workstations

# Pre-merged default.yml from CI
fleet-plan --default /tmp/default.yml

# JSON or Markdown output
fleet-plan --format json
fleet-plan --format markdown

What it diffs

Scope Resources
Team (teams/*.yml) Policies, queries, software, MDM profiles
Global (default.yml) org_settings, agent_options, controls, global policies/queries, labels

Use fleetctl gitops --dry-run for secret substitution, server-side validation, environment merging.

Auth

# Env vars (CI)
export FLEET_PLAN_URL=https://fleet.example.com
export FLEET_PLAN_TOKEN=your-token

# Or flags
fleet-plan --url https://fleet.example.com --token your-token

...or a config file (~/.config/fleet-plan.json):

{
  "contexts": {
    "dev": {
      "url": "https://dev.fleet.example.com",
      "token": "..."
    }
  },
  "default_context": "dev"
}

CI integration

# Show what will change
fleet-plan

# Validate server-side
fleetctl gitops -f default.yml --dry-run

Docs

Contributing

git clone https://github.com/TsekNet/fleet-plan.git && cd fleet-plan
go test -race ./...

License

MIT

Directories

Path Synopsis
cmd
fleet-plan command
fleet-plan: terraform plan, but for your device fleet.
fleet-plan: terraform plan, but for your device fleet.
internal
api
Package api provides a read-only Fleet REST API client.
Package api provides a read-only Fleet REST API client.
config
Package config resolves fleet-plan authentication.
Package config resolves fleet-plan authentication.
diff
Package diff computes semantic diffs between current Fleet state (from API) and proposed state (from parsed YAML).
Package diff computes semantic diffs between current Fleet state (from API) and proposed state (from parsed YAML).
output
Package output formats DiffResult for display.
Package output formats DiffResult for display.
parser
Package parser reads fleet-gitops YAML files, resolves path: references, and produces normalized ParsedRepo structures for diffing.
Package parser reads fleet-gitops YAML files, resolves path: references, and produces normalized ParsedRepo structures for diffing.
testutil
Package testutil provides shared test helpers for fleet-plan packages.
Package testutil provides shared test helpers for fleet-plan packages.

Jump to

Keyboard shortcuts

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