
Cfgd
io.github.tj-smith47由 GitHub 账号 tj-smith47 发布v0.12.0更新于 Oct 24, 2026
Declarative, GitOps-style machine configuration management
概览
把 cfgd 声明式机器配置命令行工具暴露为 MCP 工具,让助手能够规划、应用并持续校准工作站的声明状态。
- 可以做什么
- Cfgd 是 GitOps 风格的机器配置管理工具:软件包、dotfiles、系统设置和密钥都以受版本控制的 YAML 配置档与模块声明,再与机器实际状态比对并校准。其 MCP 服务器把命令行工具本身作为工具提供,因此助手不只是写配置,还能驱动校准过程。相关能力包括 AI 辅助生成配置、可共享的跨平台模块、漂移检测以及密钥后端。
- 适用场景
- 当你希望助手依据声明配置来初始化或校准开发机,或检查并修正多台机器之间的漂移时,值得安装。适合在多台工作站之间管理 dotfiles 与软件包的开发者,以及分发共享环境模块的团队。
- 运行要求
- 以 stdio 方式作为本地进程运行,因此机器上必须安装 cfgd 可执行文件(可通过 Homebrew、cargo、安装脚本等渠道)。清单未声明任何认证、环境变量或请求头。部分功能需要额外凭据,例如 AI 辅助生成需要 ANTHROPIC_API_KEY,密钥后端涉及 SOPS/age、1Password、Bitwarden 或 Vault。
安装
在 SourceWeft 中
- 打开 控制台中的 Cfgd,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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
- How It Works
- Quick Start
- Why cfgd exists
- Shareable Modules
- How cfgd compares
- Features
- Documentation
- 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.
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
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.
A module declares packages with cross-platform resolution, config files, shell environment variables and aliases, and lifecycle scripts:
See docs/modules.md for the full spec including git file sources, registries, and dependency resolution.
How cfgd compares
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> --applyon a new machine - AI-guided generation:
cfgd generatescans your system and builds profiles/modules; MCP server for AI editor integration - MCP server:
cfgd mcpserves the CLI itself as tools, so an assistant can reconcile a machine, not only write config for one - Authoring skills:
cfgd skill installteaches 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/statusfor 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
Distribution
In addition to publishing binaries to GitHub Releases (Linux, macOS, Windows on amd64 + arm64; FreeBSD on amd64), each release also publishes to:
CI/CD integrations:
Modules can also be exported as DevContainer Features for injection into devcontainers:
Building from source:
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (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.
来源:README.md,提交 8182594
工具
0版本历史
3- v0.12.0最新Oct 6, 2026
- v0.11.0Sep 17, 2026
- v0.10.0Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。