Cfgd

io.github.tj-smith47由 GitHub 帳號 tj-smith47 發布v0.12.0更新於 Oct 24, 2026

Declarative, GitOps-style machine configuration management

概覽

AI 產生的概覽

把 cfgd 宣告式機器設定命令列工具包成 MCP 工具,讓助理能規劃、套用並持續校正工作站的宣告狀態。

可以做什麼
Cfgd 是 GitOps 風格的機器設定管理工具:套件、dotfiles、系統設定與密鑰都以受版本控管的 YAML 設定檔與模組宣告,再與機器實際狀態比對並校正。它的 MCP 伺服器把命令列工具本身當成工具提供,因此助理不只是寫設定,還能驅動校正流程。相關能力包括 AI 輔助產生設定、可共享的跨平台模組、漂移偵測以及密鑰後端。
適用情境
當你希望助理依宣告設定來初始化或校正開發機,或檢查並修正多台機器之間的漂移時,值得安裝。適合在多台工作站之間管理 dotfiles 與套件的開發者,以及分發共享環境模組的團隊。
執行需求
以 stdio 方式作為本機程序執行,因此機器上必須安裝 cfgd 執行檔(可透過 Homebrew、cargo、安裝腳本等管道)。清單未宣告任何驗證、環境變數或標頭。部分功能需要額外憑證,例如 AI 輔助產生需要 ANTHROPIC_API_KEY,密鑰後端則涉及 SOPS/age、1Password、Bitwarden 或 Vault。
安裝前請注意
此伺服器所驅動的工具會改動機器:安裝套件、寫入檔案,並可自動修正漂移,因此操作可能修改或刪除現有設定。它也可能透過 SOPS/age、1Password、Bitwarden、Vault 等後端處理密鑰,並涉及 SSH 與 GPG 金鑰的產生與管理。專案標示為 Alpha,API 可能變動。套用前請先檢視計畫。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cfgd,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[cfgd gear icon]

cfgd

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

[CI] [E2E] [Release] [Coverage] [License: MIT OR Apache-2.0]

[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.

Status: Alpha. APIs may change.



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.

             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.

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, or watch two machines converge through the daemon.

[cfgd catching a sabotaged file with cfgd status, explaining it with cfgd diff, and healing it with cfgd apply]

Quick Start

sh
# Install via Homebrewbrew install tj-smith47/tap/cfgd
# Or via install scriptcurl -fsSL https://github.com/tj-smith47/cfgd/releases/latest/download/install.sh | sh
# Or via cargocargo install cfgd
# Bring your config to a new machine in secondscfgd init --from [email protected]:you/machine-config.git
# Or start freshcfgd init
# Or let AI scan your system and generate config for youexport ANTHROPIC_API_KEY=sk-...cfgd generate
# Set up shell completions (add to your shell's rc file)source <(cfgd completion bash)  # .bashrcsource <(cfgd completion zsh)   # .zshrccfgd 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-envcfgd 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/v1alpha1kind: Modulemetadata:  name: nvim  description: Neovim editor configurationspec:  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 for the full spec including git file sources, registries, and dependency resolution.

How cfgd compares

cfgdchezmoiNix Home ManagerAnsiblePuppet
FocusFull machine stateDotfilesDotfiles + packages (Nix)General automationServer/infra state
Packages18 managersNoneNix onlyAny (via tasks)Any (via providers)
Drift detectionContinuous (daemon)ManualOn rebuildManualContinuous (agent)
Cross-platform resolutionPer-package manager mappingN/ANix-onlyPer-task conditionalsPer-OS Hiera data
Shareable modulesFirst-classTemplates onlyFlakesRoles (Galaxy)Forge (server-oriented)
Team configPolicy tiers + CrossplaneN/AFlake inputsN/APuppet Enterprise
InfrastructureSingle binary, zero serversSingle binaryNix daemonSSH (or AWX)PuppetServer + PuppetDB + CA
Learning curveYAML + CLIGo templatesNix languageYAML + Jinja2Puppet 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: cfgd init --from <repo> --apply on a new machine
  • AI-guided generation: cfgd generate scans your system and builds profiles/modules; MCP server for AI editor integration
  • MCP server: cfgd mcp serves the CLI itself as tools, so an assistant can reconcile a machine, not only write config for one
  • Authoring skills: cfgd skill install teaches your coding agent (Claude Code, Gemini, Copilot, Codex, Cursor) to author high-quality cfgd resources
  • Shareable modules: cross-platform dev environment packages with dependency resolution and registries
  • 18 package managers: brew, apt, dnf, pacman, cargo, npm, pipx, snap, and more, with automatic platform-aware resolution
  • Secrets: SOPS/age encryption + 1Password, Bitwarden, HashiCorp Vault; secret-backed environment variables
  • Tera templates: render dotfiles with variables, OS detection, custom functions
  • Continuous drift detection: daemon watches for changes, auto-syncs, notifies or auto-corrects

For platform & infrastructure engineers:

  • Multi-source config: publish team baselines with policy tiers (locked/required/recommended/optional)
  • Kubernetes operator: CRDs for MachineConfig, ConfigPolicy, ClusterConfigPolicy, DriftAlert, BackupPolicy, Module; admission webhook; device gateway with fleet dashboard
  • Node configuration: sysctl, kernel modules, containerd, kubelet, AppArmor, seccomp, certificates
  • CSI driver: OCI-based module injection into pods via volumes
  • Crossplane integration: TeamConfig XR for self-service team environment distribution
  • kubectl plugin: kubectl cfgd debug/exec/inject/status for node inspection

For security & compliance:

  • Compliance snapshots: continuous machine state capture with JSON/YAML export for Vanta, Drata, or custom integrations
  • Key provisioning: declarative SSH key generation, GPG key management, and git signing configuration
  • Encryption enforcement: per-file encryption requirements with SOPS/age backend validation
  • Policy enforcement: locked files, required packages, encryption constraints on target paths
  • Drift remediation: daemon detects and auto-corrects configuration drift with per-module policies
  • Fleet visibility: device gateway aggregates compliance scores across enrolled machines

Documentation

DocumentDescription
ConfigurationRoot config (cfgd.yaml), file strategies, aliases, themes
ProfilesProfile YAML, inheritance, merge rules, variables
ModulesModule spec, cross-platform packages, dependencies, git file sources, registries
ReconciliationPhase ordering, failure handling, state store
PackagesAll package managers, skip behavior, dry-run
TemplatesTera template system, context variables, custom functions
SecretsSOPS/age backends, 1Password, Bitwarden, Vault
System ConfiguratorsShell, macOS defaults, systemd, sysctl, kubelet, and more
SourcesMulti-source config, policy tiers, composition, subscriptions
DaemonFile watching, reconciliation loop, sync, notifications, service install
OperatorCRD-based machine management, device gateway, DaemonSet node agent
Team ConfigCrossplane-powered team config distribution
SafetyAtomic writes, backups, rollback, apply locking, path safety
Declarative Backupsspec.backups[] snapshots, hook ordering, retention, restoring
Backup PolicyFleet-wide backup schedules, the precedence table, scheduleOwner
CLI ReferenceComplete command reference with flags and examples
InstallationEvery install channel, verifying signed downloads, self-upgrade
Bootstrapcfgd init flow, apply options, install script
AI GenerateAI-guided config generation, both MCP servers (mcp-server for authoring, mcp for driving the CLI)
Authoring Skillscfgd skill installer, supported agent providers, choosing between generate and skills
ReleasingCI-cut release pipeline, pre-release checklist, failure recovery
Image PackPacking a directory into an OCI image volume, signing, pinning deployments
Multi-TenancyNamespace isolation and tenant boundaries for the operator
Lifecycle Scriptsrun: resolution, hook phases, timeouts, interactive scripts

Distribution

In addition to publishing binaries to GitHub Releases (Linux, macOS, Windows on amd64 + arm64; FreeBSD on amd64), each release also publishes to:

ChannelArtifact
Homebrewbrew install tj-smith47/tap/cfgd
crates.iocargo install cfgd (or cargo binstall cfgd for the pre-built binary)
AURyay -S cfgd (Arch Linux; builds from source)
wingetwinget install --id TJSmith.cfgd
Scoopscoop bucket add tj-smith47 https://github.com/tj-smith47/scoop-bucket; scoop install cfgd
Chocolateychoco install cfgd
Nixnix profile install github:tj-smith47/nix-pkgs#cfgd
deb / rpm / apkStatic-binary native packages, also mirrored to CloudSmith
GHCRDocker images: cfgd, cfgd-operator, cfgd-csi
Helmhelm install cfgd oci://ghcr.io/tj-smith47/charts/cfgd
Krewkubectl krew install cfgd (the kubectl plugin for node debugging and fleet inspection)
OLMOperator bundle for OLM-managed clusters
Crossplanefunction-cfgd composition function for team config distribution
MCP Registryio.github.tj-smith47/cfgd: the cfgd mcp-server stdio server, for AI agents and editors

CI/CD integrations:

IntegrationDescription
cfgd SetupGitHub Action: bootstrap a runner with a module from your config repo
cfgd PlanGitHub Action: run cfgd plan on PRs, post the diff as a comment
GitLab CIIncludable .cfgd-ci.yml template with .cfgd-plan and .cfgd-apply jobs
Tektoncfgd-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: [email protected]: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 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 cfgdcargo build --release

License

Licensed under either of

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.

來源:README.md,提交 8182594

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.12.0最新Oct 6, 2026
  2. v0.11.0Sep 17, 2026
  3. v0.10.0Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。