# cfgd [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/tj-smith47/cfgd  
**GitHub Stars:** 7  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cfgd

## Description
Declarative, GitOps-style machine configuration management

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "cfgd": {
    "url": "https://raw.githubusercontent.com/tj-smith47/cfgd/master/.github/gear.svg"
  }
}
```

## Documentation & README

<div align="center">

<img src="https://raw.githubusercontent.com/tj-smith47/cfgd/master/.github/gear.svg" width="96" alt="cfgd gear icon">

# cfgd

Declare your entire machine (packages, dotfiles, system settings, secrets) with composable profiles and shareable, cross-platform modules.

[![CI](https://github.com/tj-smith47/cfgd/actions/workflows/ci.yml/badge.svg)](https://github.com/tj-smith47/cfgd/actions/workflows/ci.yml)
[![E2E](https://github.com/tj-smith47/cfgd/actions/workflows/e2e.yml/badge.svg)](https://github.com/tj-smith47/cfgd/actions/workflows/e2e.yml)
[![Release](https://github.com/tj-smith47/cfgd/actions/workflows/release.yml/badge.svg)](https://github.com/tj-smith47/cfgd/actions/workflows/release.yml)
[![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/tj-smith47/cfgd/badges/coverage.json)](https://github.com/tj-smith47/cfgd/actions/workflows/ci.yml)
[![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](#license)

<img src="https://raw.githubusercontent.com/tj-smith47/cfgd/HEAD/demo/cfgd-demo.gif" width="1320" alt="cfgd installing a Neovim setup on a bare Ubuntu container in one command">

*A bare `ubuntu:24.04` container with no Neovim, no Homebrew and no config. One `cfgd init` later, `nvim` opens a fully configured LazyVim. Recorded with [VHS](https://github.com/charmbracelet/vhs).*

</div>

> **Status:** Alpha. APIs may change.

---

- [What is cfgd](#what-is-cfgd)
- [How It Works](#how-it-works)
- [Quick Start](#quick-start)
- [Why cfgd exists](#why-cfgd-exists)
- [Shareable Modules](#shareable-modules)
- [How cfgd compares](#how-cfgd-compares)
- [Features](#features)
- [Documentation](#documentation)
- [Distribution](#distribution)

---

## What is cfgd

Most dotfile managers track files. `cfgd` manages your entire machine. You declare packages, files, secrets, and system settings in version-controlled YAML. `cfgd` diffs what you want against what you have, builds a plan, and reconciles continuously. If something drifts, it is detected and corrected.

## How It Works

**Profiles** declare your machine's desired state: packages, files, system settings. They compose via inheritance: share a common base across machines, then specialize per context. See [docs/profiles.md](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/profiles.md).

```
             base
            ╱    ╲
        work    personal
       ╱    ╲
  laptop    devcontainer
```

**Modules** are shareable, self-contained config packages. Install someone else's dev environment or publish your own. Cross-platform package resolution picks the right manager automatically. See [docs/modules.md](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/modules.md).

**Reconciliation** continuously ensures machines match their declared state. Drift is detected, reported, and optionally auto-corrected. Failed actions don't abort; they're logged and skipped. See [docs/reconciliation.md](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/reconciliation.md), or watch [two machines converge through the daemon](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/daemon.md#what-it-does).

<img src="https://raw.githubusercontent.com/tj-smith47/cfgd/HEAD/demo/cfgd-drift.gif" width="1320" alt="cfgd catching a sabotaged file with cfgd status, explaining it with cfgd diff, and healing it with cfgd apply">

## Quick Start

```sh
# Install via Homebrew
brew install tj-smith47/tap/cfgd

# Or via install script
curl -fsSL https://github.com/tj-smith47/cfgd/releases/latest/download/install.sh | sh

# Or via cargo
cargo install cfgd

# Bring your config to a new machine in seconds
cfgd init --from git@github.com:you/machine-config.git

# Or start fresh
cfgd init

# Or let AI scan your system and generate config for you
export ANTHROPIC_API_KEY=sk-...
cfgd generate

# Set up shell completions (add to your shell's rc file)
source <(cfgd completion bash)  # .bashrc
source <(cfgd completion zsh)   # .zshrc
cfgd completion fish | source   # config.fish
```

## Why cfgd exists

I recently switched jobs, and spent the last week of my old job backing up scripts and dotfiles, parsing out company-specific info, and composing a tarball to transfer. At the new job, I spent another few days getting my new machine reconfigured. Over time I kept discovering things I'd forgotten, and things (System Settings, for one) I wished the backup had covered. It all felt manual and incomplete: I should be able to clone a repo and have my entire workstation (packages, scripts, dotfiles, system settings) feel familiar again. Better still, to keep parts of that feeling in sync between my home and work laptops.

The other inspiration was devcontainers. At my previous company I had set up custom scripts to inject dotfiles into the devcontainer so a user could replicate their dev environment once they shell in. At minimum, I wanted my full Neovim setup available in any ephemeral container without modifying the devcontainer config in every team's repository to accommodate it. I needed something that could bootstrap my config into any environment from the outside, regardless of whose repo I was working in. Plus, I had some coworkers in need of education about the superiority of vim-motions, and wanted a quick way to share my exact setup, down to the alias.

`cfgd` borrows from the best ideas across practices:

- **Kubernetes**: declarative reconciliation loop, KRM resource model
- **Terraform**: plan/apply workflow, state tracking, drift detection
- **Puppet**: continuous enforcement via daemon, module ecosystem
- **Nix**: reproducible machine state from a single source of truth
- **Ansible**: YAML-driven config management, idempotent task execution
- **Kustomize**: layered overrides and patches
- **chezmoi**: dotfile management

## Shareable Modules

This is my favorite feature: a single packaged config for a tool that works anywhere.

```sh
cfgd module create my-dev-env
cfgd profile update --module community/nvim
```

A module declares packages with cross-platform resolution, config files, shell environment variables and aliases, and lifecycle scripts:

```yaml
apiVersion: cfgd.io/v1alpha1
kind: Module
metadata:
  name: nvim
  description: Neovim editor configuration
spec:
  depends: [node, python]
  packages:
    - name: neovim
      minVersion: "0.10"
      prefer: [brew, snap]
      deny: [apt]
    - name: ripgrep
    - name: fd
      aliases:
        apt: fd-find
        dnf: fd-find
    - name: gcc
      aliases:
        apt: build-essential
        dnf: "@development-tools"
      platforms: [linux]
  files:
    - source: files/init.lua
      target: ~/.config/nvim/init.lua
    - source: files/lua
      target: ~/.config/nvim/lua
  env:
    - name: EDITOR
      value: nvim
  aliases:
    - name: v
      command: nvim
  scripts:
    postApply:
      - nvim --headless '+Lazy! sync' '+MasonToolsInstallSync' +qa
```

See [docs/modules.md](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/modules.md) for the full spec including git file sources, registries, and dependency resolution.

## How cfgd compares

| | **cfgd** | [chezmoi](https://chezmoi.io) | [Nix Home Manager](https://nix-community.github.io/home-manager/) | [Ansible](https://docs.ansible.com/) | [Puppet](https://www.puppet.com/) |
|---|---|---|---|---|---|
| **Focus** | Full machine state | Dotfiles | Dotfiles + packages (Nix) | General automation | Server/infra state |
| **Packages** | **18 managers** | None | Nix only | Any (via tasks) | Any (via providers) |
| **Drift detection** | **Continuous (daemon)** | Manual | On rebuild | Manual | Continuous (agent) |
| **Cross-platform resolution** | **Per-package manager mapping** | N/A | Nix-only | Per-task conditionals | Per-OS Hiera data |
| **Shareable modules** | **First-class** | Templates only | Flakes | Roles (Galaxy) | Forge (server-oriented) |
| **Team config** | **Policy tiers + Crossplane** | N/A | Flake inputs | N/A | Puppet Enterprise |
| **Infrastructure** | **Single binary, zero servers** | Single binary | Nix daemon | SSH (or AWX) | PuppetServer + PuppetDB + CA |
| **Learning curve** | YAML + CLI | Go templates | Nix language | YAML + Jinja2 | Puppet DSL (Ruby) |

Puppet is the closest philosophical match: declarative state, continuous enforcement, module ecosystem. If that model clicked for you but standing up a JVM server and writing a Ruby-era DSL to manage your dotfiles in 2026 doesn't, `cfgd` is what that idea looks like rebuilt from scratch for developer workstations.

`cfgd` is a good fit when you want: one-liners for cross-platform machine bootstrapping, shareable dev environment modules, continuous reconciliation between machines or subscribed sources, or team config distribution with policy enforcement.

## Features

**For developers:**
- [One-command bootstrap](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/bootstrap.md): `cfgd init --from <repo> --apply` on a new machine
- [AI-guided generation](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/ai-generate.md): `cfgd generate` scans your system and builds profiles/modules; MCP server for AI editor integration
- [MCP server](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/ai-generate.md#serving-the-cli-itself): `cfgd mcp` serves the CLI itself as tools, so an assistant can reconcile a machine, not only write config for one
- [Authoring skills](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/skill.md): `cfgd skill install` teaches your coding agent (Claude Code, Gemini, Copilot, Codex, Cursor) to author high-quality cfgd resources
- [Shareable modules](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/modules.md): cross-platform dev environment packages with dependency resolution and registries
- [18 package managers](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/packages.md): brew, apt, dnf, pacman, cargo, npm, pipx, snap, and more, with automatic platform-aware resolution
- [Secrets](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/secrets.md): SOPS/age encryption + 1Password, Bitwarden, HashiCorp Vault; secret-backed environment variables
- [Tera templates](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/templates.md): render dotfiles with variables, OS detection, custom functions
- [Continuous drift detection](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/daemon.md): daemon watches for changes, auto-syncs, notifies or auto-corrects

**For platform & infrastructure engineers:**
- [Multi-source config](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/sources.md): publish team baselines with policy tiers (locked/required/recommended/optional)
- [Kubernetes operator](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md): CRDs for MachineConfig, ConfigPolicy, DriftAlert; admission webhook; device gateway with fleet dashboard
- [Node configuration](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/system-configurators.md): sysctl, kernel modules, containerd, kubelet, AppArmor, seccomp, certificates
- [CSI driver](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md): OCI-based module injection into pods via volumes
- [Crossplane integration](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/team-config.md): TeamConfig XR for self-service team environment distribution
- [kubectl plugin](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md): `kubectl cfgd debug/exec/inject/status` for node inspection

**For security & compliance:**
- [Compliance snapshots](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/spec/config.md#speccompliance): continuous machine state capture with JSON/YAML export for Vanta, Drata, or custom integrations
- [Key provisioning](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/system-configurators.md): declarative SSH key generation, GPG key management, and git signing configuration
- [Encryption enforcement](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/spec/profile.md): per-file encryption requirements with SOPS/age backend validation
- [Policy enforcement](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/sources.md): locked files, required packages, encryption constraints on target paths
- [Drift remediation](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/daemon.md): daemon detects and auto-corrects configuration drift with per-module policies
- [Fleet visibility](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md): device gateway aggregates compliance scores across enrolled machines

## Documentation

| Document | Description |
|---|---|
| [Configuration](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/configuration.md) | Root config (cfgd.yaml), file strategies, aliases, themes |
| [Profiles](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/profiles.md) | Profile YAML, inheritance, merge rules, variables |
| [Modules](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/modules.md) | Module spec, cross-platform packages, dependencies, git file sources, registries |
| [Reconciliation](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/reconciliation.md) | Phase ordering, failure handling, state store |
| [Packages](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/packages.md) | All package managers, skip behavior, dry-run |
| [Templates](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/templates.md) | Tera template system, context variables, custom functions |
| [Secrets](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/secrets.md) | SOPS/age backends, 1Password, Bitwarden, Vault |
| [System Configurators](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/system-configurators.md) | Shell, macOS defaults, systemd, sysctl, kubelet, and more |
| [Sources](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/sources.md) | Multi-source config, policy tiers, composition, subscriptions |
| [Daemon](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/daemon.md) | File watching, reconciliation loop, sync, notifications, service install |
| [Operator](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md) | CRD-based machine management, device gateway, DaemonSet node agent |
| [Team Config](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/team-config.md) | Crossplane-powered team config distribution |
| [Safety](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/safety.md) | Atomic writes, backups, rollback, apply locking, path safety |
| [Declarative Backups](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/backups.md) | `spec.backups[]` snapshots, hook ordering, retention, restoring |
| [CLI Reference](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/cli-reference.md) | Complete command reference with flags and examples |
| [Installation](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/installation.md) | Every install channel, verifying signed downloads, self-upgrade |
| [Bootstrap](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/bootstrap.md) | `cfgd init` flow, apply options, install script |
| [AI Generate](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/ai-generate.md) | AI-guided config generation, both MCP servers (`mcp-server` for authoring, `mcp` for driving the CLI) |
| [Authoring Skills](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/skill.md) | `cfgd skill` installer, supported agent providers, choosing between generate and skills |
| [Releasing](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/releasing.md) | CI-cut release pipeline, pre-release checklist, failure recovery |
| [Image Pack](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/image-pack.md) | Packing a directory into an OCI image volume, signing, pinning deployments |
| [Multi-Tenancy](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/multi-tenancy.md) | Namespace isolation and tenant boundaries for the operator |
| [Lifecycle Scripts](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/lifecycle-scripts.md) | `run:` resolution, hook phases, timeouts, interactive scripts |

## Distribution

In addition to publishing binaries to [GitHub Releases](https://github.com/tj-smith47/cfgd/releases) (Linux, macOS, Windows on amd64 + arm64; FreeBSD on amd64), each release also publishes to:

| Channel | Artifact |
|---|---|
| [Homebrew](https://github.com/tj-smith47/homebrew-tap) | `brew install tj-smith47/tap/cfgd` |
| [crates.io](https://crates.io/crates/cfgd) | `cargo install cfgd` (or `cargo binstall cfgd` for the pre-built binary) |
| [AUR](https://aur.archlinux.org/packages/cfgd) | `yay -S cfgd` (Arch Linux; builds from source) |
| [winget](https://github.com/microsoft/winget-pkgs) | `winget install --id TJSmith.cfgd` |
| [Scoop](https://github.com/tj-smith47/scoop-bucket) | `scoop bucket add tj-smith47 https://github.com/tj-smith47/scoop-bucket; scoop install cfgd` |
| [Chocolatey](https://community.chocolatey.org/packages/cfgd) | `choco install cfgd` |
| [Nix](https://github.com/tj-smith47/nix-pkgs) | `nix profile install github:tj-smith47/nix-pkgs#cfgd` |
| [deb / rpm / apk](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/installation.md#linux-native-packages-deb--rpm--apk) | Static-binary native packages, also mirrored to [CloudSmith](https://cloudsmith.io/~jarvispro/repos/cfgd/) |
| [GHCR](https://ghcr.io/tj-smith47) | Docker images: `cfgd`, `cfgd-operator`, `cfgd-csi` |
| [Helm](https://github.com/tj-smith47/cfgd/blob/HEAD/chart/cfgd/) | `helm install cfgd oci://ghcr.io/tj-smith47/charts/cfgd` |
| [Krew](https://github.com/tj-smith47/krew-index) | `kubectl krew install cfgd` (the [kubectl plugin](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/operator.md) for node debugging and fleet inspection) |
| [OLM](https://github.com/tj-smith47/cfgd/blob/HEAD/ecosystem/olm/) | Operator bundle for OLM-managed clusters |
| [Crossplane](https://github.com/tj-smith47/cfgd/blob/HEAD/function-cfgd/) | `function-cfgd` composition function for [team config distribution](https://github.com/tj-smith47/cfgd/blob/HEAD/docs/team-config.md) |
| [MCP Registry](https://registry.modelcontextprotocol.io) | `io.github.tj-smith47/cfgd`: the `cfgd mcp-server` stdio server, for AI agents and editors |

**CI/CD integrations:**

| Integration | Description |
|---|---|
| [cfgd Setup](https://github.com/tj-smith47/cfgd/blob/HEAD/ecosystem/github-actions/setup/) | GitHub Action: bootstrap a runner with a module from your config repo |
| [cfgd Plan](https://github.com/tj-smith47/cfgd/blob/HEAD/ecosystem/github-actions/plan/) | GitHub Action: run `cfgd plan` on PRs, post the diff as a comment |
| [GitLab CI](https://github.com/tj-smith47/cfgd/blob/HEAD/ecosystem/gitlab/) | Includable `.cfgd-ci.yml` template with `.cfgd-plan` and `.cfgd-apply` jobs |
| [Tekton](https://github.com/tj-smith47/cfgd/blob/HEAD/ecosystem/tekton/) | `cfgd-apply` Task for Tekton Pipelines |

```yaml
# Example: set up your dev tools on a GitHub Actions runner
- uses: tj-smith47/cfgd/ecosystem/github-actions/setup@master
  with:
    source: git@github.com:you/machine-config.git
    module: dev-tools

# Example: plan config changes on every PR, comment the diff, gate the merge
- uses: tj-smith47/cfgd/ecosystem/github-actions/plan@master
  with:
    config-dir: .
    fail-on-error: true
```

Modules can also be exported as [DevContainer Features](https://containers.dev/implementors/features/) for injection into devcontainers:

```sh
cfgd module export my-tool --as devcontainer
```

**Building from source:**

```sh
git clone https://github.com/tj-smith47/cfgd.git && cd cfgd
cargo build --release
```

## License

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/tj-smith47/cfgd/blob/HEAD/LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](https://github.com/tj-smith47/cfgd/blob/HEAD/LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

