chefctl
Version, currently 1.0.04 versions
- 1.0.0latestOct 24, 2026
- 0.2.1Oct 18, 2026
- 0.2.0Oct 13, 2026
- main branchOct 4, 2026
github.com/howielauvehansen94/chefctl
A small Crystal CLI for the Chef Infra Server REST API. Created mostly with GLM 5.3 Flash
Installation
# Add this to your shard.yml
dependencies:
chefctl:
github: howielauvehansen94/chefctl
version: ~> 1.0.0Then run:
shards installshard.yml
- Crystal
>= 1.21.0- License
- MIT
- Author
- Håvard Lauve Hansen
- Target
chefctlfrom src/chefctl.cr
Dependencies
Runtime Dependencies
- chef-auth*github: howielauvehansen94/chef-auth
Development Dependencies
- ameba~> 1.7.0github: crystal-ameba/amebadev
README
chefctl
A small Crystal CLI for the Chef Infra Server REST API.
Installation
Prebuilt binaries for Linux and Windows are attached to each GitHub release.
From source:
shards install
crystal build src/chefctl.cr -o bin/chefctl
On Windows this produces bin\chefctl.exe. Note that Crystal's Windows
support is currently a preview.
Usage
export CHEF_SERVER_URL=https://chef.example.com/organizations/myorg
export CHEF_USER=myuser
export CHEF_KEY="$HOME/.chef/myuser.pem"
chefctl get nodes
chefctl get node web01.example.com
chefctl create node web01.example.com
chefctl get "search/node?q=platform:ubuntu"
Run chefctl --help for all commands and flags. The get command also hits
any org-relative endpoint (a PATH containing / or ?), so search, data bags
(get data), etc. work without dedicated commands.
Objects are created and updated from JSON passed with --file FILE (-
reads stdin) or piped on stdin; create node generates a minimal empty node
when no body is given:
chefctl get node web01.example.com > web01.json
$EDITOR web01.json
chefctl update node web01.example.com --file web01.json
chefctl delete node web01.example.com
Pass -F json or -F yaml for machine-readable output: name lists render as
collections and everything else renders as documents, e.g.
chefctl -F yaml get node web01.example.com
--key and CHEF_KEY accept ~, which chefctl expands itself, so
--key ~/.chef/myuser.pem works the same in PowerShell and cmd as in POSIX
shells.
Development
crystal spec
Integration tests boot cinc-server-ng
(an in-memory Chef Infra Server implementation) in a container and run the CLI
against it. Requires docker or podman (docker is the default) plus just:
just integration
The suite tears the server down afterwards; eval "$(just create-env)" starts
the server (if needed) and exports CHEF_SERVER_URL, CHEF_USER and
CHEF_KEY into your shell for manual chefctl runs — just server-down
cleans up. just server-up, just seed and just server-down are available
for lower-level control, and CONTAINER_RUNTIME=podman just integration
forces podman.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Oct 24, 2026
- Commit
2168bdfe6a77- Crystal
>= 1.21.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/howielauvehansen94/chefctl
Metadata
- Created
- Sep 27, 2026
- Updated
- Nov 12, 2026
- Synced
- Nov 12, 2026
- Versions
- 4