CFEngine command line interface (CLI)
A CLI for humans to interact with CFEngine, enabling downloading and installing packages, building policy sets, deploying, and enforcing policy.
It is practically a wrapper around our other tools, like cf-agent, cf-hub, cf-remote and cfbs.
Warning: This is an early version. Things might be missing or changed. Proceed with caution and excitement.
Installation
Install using pip:
pip install cfengine
Usage
Run the CFEngine agent - evaluate and enforce policy
cfengine run
CFEngine CLI help
cfengine help
Print CFEngine CLI version
cfengine version
Automatically format source code
cfengine format
Check for errors in source code
cfengine lint
You can also specify filenames or folders:
cfengine lint main.cf
When it finds a mistake, it points out where the problem is like this:
"Hello, CFEngine"
ifvarclass => "cfengine";
^--------^
Deprecation: Use 'if' instead of 'ifvarclass' at main.cf:5:7
FAIL: main.cf (1 error)
Failure, 1 error in total.
Note that since we use a different parser than cf-agent / cf-promises, they are not 100% in sync.
cf-agent could point out something as a syntax error, while cfengine lint does not and vice versa.
We aim to make the tree-sitter parser (used in this tool) more strict in general, so that when cfengine lint is happy with your policy, cf-agent will also accept it.
(But the opposite is not a goal, that cfengine lint must accept any policy cf-agent would find acceptable).
Build a policy set
cfengine build
(This is equivalent to running cfbs build).
Spawn and install cfengine from a config
this feature is still a work in progress
Given a yaml config:
templates:
ubuntu:
provider: vagrant
vagrant:
box: ubuntu/focal64
groups:
myhub:
role: hub
source:
count: 1
mode: spawn
spawn: ubuntu
up will spawn the necessary VMs and install cfengine using cf-remote.
cfengine up config.yaml
To validate the config, one can run:
cfengine up --validate config.yaml
Every time up is run, it will do all the necessary (spawn, destroy, install, uninstall) to reconciliate the current state with the input configuration.
After a successful run, the applied configuration is saved.
On subsequent runs, CFEngine compares the previously applied configuration with the current configuration and applies only the necessary changes.
To ignore the previously saved configuration and apply the current configuration as-is, run:
cfengine up --reset config.yaml
See CHEATSHEET.md for a fuller command reference.
Supported platforms and versions
This tool will only support a limited number of platforms, it is not intended to run everywhere CFEngine runs. Currently we are targeting:
- Officially supported versions of macOS, Ubuntu, and Fedora.
- Officially supported versions of Python.
It is not intended to be installed on all hosts in your infrastructure. CFEngine itself supports a wide range of platforms, but this tool is intended to run on your laptop, your workstation, or the hub in your infrastructure, not all the other hosts.
Backwards compatibility
This CLI is entirely intended for humans. If you put it into scripts and automation, expect it to break in the future. In order to make the user experience better, we might add, change, or remove commands. We will also be experimenting with different types of interactive prompts and input.
Development, maintenance, contributions, and releases
Looking for more information related to contributing code, releasing new versions or otherwise maintaining the CFEngine CLI? Please see the HACKING.md file.
Metadata
Release files for cfengine 0.23.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cfengine-0.23.2.tar.gz | 228.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cfengine-0.23.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 350.0 kB
Release files / cfengine-0.23.2.tar.gz
| Download URL | cfengine-0.23.2.tar.gz |
|---|---|
| Size | 228.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc16a94a39f1cc1fbcc7b2e3a00356709a592b5654997f5b83b9c5c678048509
|
|
BLAKE2b-256 checksum How to use checksums |
492c059566fa40ee15213f56c9cf757c2b655864ca25bb3d66ff3f8b3bfbed0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / cfengine-0.23.2-py3-none-any.whl
| Download URL | cfengine-0.23.2-py3-none-any.whl |
|---|---|
| Size | 121.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eec3203f52b46f7ffcb78a7002f7640d298b3480a65049a9831ec6e2c4a72ed3
|
|
BLAKE2b-256 checksum How to use checksums |
7299d568c247596e9be5222d8a81a53b0d73a02f013e61dc45c405c3e13ee195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log