cinc-cli

module
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0

README

cinc

cinc is a single, unified command-line tool for Cinc Infra (with full Chef Infra compatibility): one command with one consistent grammar. It is a Go binary built with Cobra on top of the cinc-api client library, which owns authentication and transport.

Why Cinc CLI

The existing Chef toolchain works, but it carries a lot of historical weight. cinc is a fresh take on the same job, with a few things we weren't willing to compromise on:

  • Performance. A native Go binary with no interpreter to spin up, so configuring a system or scripting against the server feels instant instead of sluggish.
  • Ease of installation. A single static binary with no runtime dependencies. Nothing to break when the system Ruby is upgraded, no gem environment to babysit, and no multi-step bootstrap in your CI pipelines. Drop the binary in and go.
  • Ease of setup. cinc config create walks you through credentials, server URL, and SSL settings interactively, so a new user (or an existing Chef user pointing at a new server) is productive in minutes instead of losing an afternoon to troubleshooting.
  • Focused experience. Scoped to day-to-day node and cookbook management against a Cinc/Chef server. No migration helpers, no one-off subcommands for legacy workflows, just the verbs you reach for every day, kept consistent across every noun.
  • Well documented. Every command, subcommand, and flag has a generated Markdown reference under docs/commands/, rebuilt from the live cobra command tree on every change, so the docs can't drift from what the binary actually does.
  • Fully tested. Every command ships with both unit tests against an in-process HTTP server and integration tests that run the real compiled binary against a live cinc-server-ng (and, by hand, a real CINC Server), so behavior is verified end-to-end before it lands.

Status

Beta. cinc has feature parity with the everyday Chef workflows it targets, and the major ideas (the noun-verb grammar, the consistent core verbs, the config and compatibility model) are settled. What we need now is real-world use: point cinc at your server, run your actual workflows, and open an issue when something doesn't behave the way you expect.

Expect the command surface to keep shifting as we act on that feedback (flags, output, and the occasional verb may change before 1.0), but the foundations are stable enough to build on. See docs/commands/cinc.md for the current command surface (auto-generated from the cobra command tree); the taxonomy and internal architecture are described in docs/dev/.

Install

Requires Go 1.27 or newer.

# Build a local ./cinc binary
make build

# Or install into $GOBIN
make install

make injects version, commit, and build-date metadata into the binary via -ldflags; cinc version will print them.

Install in GitHub Actions

Tagged releases publish prebuilt Linux and macOS archives. A workflow can install the Linux AMD64 binary without installing Go:

- name: Install cinc
  env:
    CINC_VERSION: v0.21.0
  run: |
    archive="cinc_${CINC_VERSION}_linux_amd64.tar.gz"
    curl -fsSL -o "$archive" "https://github.com/cinc-project/cinc-cli/releases/download/${CINC_VERSION}/${archive}"
    tar -xzf "$archive"
    sudo install "cinc_${CINC_VERSION}_linux_amd64/cinc" /usr/local/bin/cinc
    cinc version

Release archives are built by make dist and include SHA256SUMS.

Configure

cinc reads a TOML credentials file (default ~/.cinc/credentials) holding named profiles, in the same shape as Chef's ~/.chef/credentials. Each top-level section is a profile that points at one Cinc/Chef Server. The quickest way to create one is cinc config create, which walks you through it interactively.

[default]
cinc_server_url = "https://cinc.example.com/organizations/acme"
client_name     = "tim"
client_key      = "/keys/tim.pem"

Persistent flags on every command:

Flag Description
--config Path to the credentials file (default ~/.cinc/credentials)
--profile Profile name to use (default: $CINC_PROFILE, then $CHEF_PROFILE, then default)
--format Output format: human or json

Every chef-prefixed key and environment variable has a cinc-prefixed equivalent (the cinc_/CINC_ form wins when both are set), so an existing Chef setup works unchanged.

  • docs/configuration.md: the complete reference covering every config key, multi-profile setups, profile selection, encrypted data bag secrets, Supermarket upload identities, and the cinc config create / cinc config validate commands.
  • docs/migrating-from-chef.md: for knife and Chef Workstation users, covering how to reuse your existing ~/.chef/credentials, the chef/cinc key duality, and how knife commands map onto cinc's noun-verb grammar.

Usage

Commands are noun-verb. The core verbs (list, show, create, edit, delete) mean the same thing on every noun. For a guided walkthrough (profiles, output formats, common workflows), see docs/README.md. For the exhaustive per-command reference (every flag, every default), see docs/commands/. The reference pages are regenerated from the live cobra command tree by make docs and refreshed automatically on every push to main.

Develop

make test             # unit tests
make vet              # go vet
make fmt              # gofmt -w
make test-integration # the real binary against an in-process cinc-server-ng
make help             # list all targets

Repository layout:

  • apps/cinc/: the binary. cinc.go is a thin main(); cmd/ holds the Cobra command tree (one file per noun group, plus root.go and flag-resolution helpers in common.go).
  • cli/config: TOML config parsing and profile resolution.
  • cli/client: builds a cinc-api client from a resolved profile. This is the single seam between CLI state and the API library; the CLI itself never builds or signs an HTTP request.
  • cli/printer: renders command output as human text or JSON.
  • docs/: auto-generated per-command reference under commands/ (regenerated by make docs) and design docs under dev/.
  • tools/gendocs/: small Go program that walks the cobra command tree and writes the Markdown reference. Invoked by make docs.
  • integration/: end-to-end tests of the binary against real server implementations, in their own Go module. See integration/README.md.

See CLAUDE.md for conventions followed when developing with Claude Code.

License

Licensed under the Apache License 2.0.

Directories

Path Synopsis
apps
cinc command
Command cinc is a unified command-line tool for Cinc/Chef Infra.
Command cinc is a unified command-line tool for Cinc/Chef Infra.
cli
client
Package client builds a configured cinc-api client from CLI configuration.
Package client builds a configured cinc-api client from CLI configuration.
components
Package components contains small terminal interaction helpers shared by commands that can run interactively.
Package components contains small terminal interaction helpers shared by commands that can run interactively.
config
Package config loads and resolves the cinc CLI credentials file: a TOML document holding a set of named connection profiles, in the same shape as Chef's `~/.chef/credentials` file.
Package config loads and resolves the cinc CLI credentials file: a TOML document holding a set of named connection profiles, in the same shape as Chef's `~/.chef/credentials` file.
cookbook
Package cookbook finds local cookbooks and packs them into tarballs.
Package cookbook finds local cookbooks and packs them into tarballs.
explore
Package explore implements `cinc explore`, a k9s-style terminal UI for browsing and mutating every object type on a Cinc/Chef server.
Package explore implements `cinc explore`, a k9s-style terminal UI for browsing and mutating every object type on a Cinc/Chef server.
internal/tarball
Package tarball unpacks untrusted gzipped tarballs (Supermarket cookbooks, policy export bundles, the ruby.wasm release) and answers the "does this path escape its directory" questions the rest of the CLI asks.
Package tarball unpacks untrusted gzipped tarballs (Supermarket cookbooks, policy export bundles, the ruby.wasm release) and answers the "does this path escape its directory" questions the rest of the CLI asks.
jsoneditor
Package jsoneditor is a small bubbletea component that edits a JSON document and shows a syntax-highlighted preview before committing.
Package jsoneditor is a small bubbletea component that edits a JSON document and shows a syntax-highlighted preview before committing.
nodeedit
Package nodeedit is a bubbletea form for editing a Chef/Cinc node.
Package nodeedit is a bubbletea form for editing a Chef/Cinc node.
policyfile
Package policyfile deploys an existing Policyfile.lock.json to a Cinc/Chef Server.
Package policyfile deploys an existing Policyfile.lock.json to a Cinc/Chef Server.
policyfile/resolver
Package resolver completes a Policyfile install: it takes the evaluated intent of a Policyfile.rb (from cli/policyfile/rubyeval) and produces a fully resolved, push-ready Policyfile.lock.json that is byte-for-byte compatible with what `chef install` writes.
Package resolver completes a Policyfile install: it takes the evaluated intent of a Policyfile.rb (from cli/policyfile/rubyeval) and produces a fully resolved, push-ready Policyfile.lock.json that is byte-for-byte compatible with what `chef install` writes.
policyfile/rubyeval
Package rubyeval evaluates arbitrary Policyfile.rb files by running CRuby compiled to WebAssembly (the official ruby/ruby.wasm WASI build) under the pure-Go wazero runtime — no system Ruby and no CGo required.
Package rubyeval evaluates arbitrary Policyfile.rb files by running CRuby compiled to WebAssembly (the official ruby/ruby.wasm WASI build) under the pure-Go wazero runtime — no system Ruby and no CGo required.
printer
Package printer renders cinc command output in a selectable format.
Package printer renders cinc command output in a selectable format.
progname
Package progname reports the name the running binary was invoked under, so user-facing text can name a command the reader actually has.
Package progname reports the name the running binary was invoked under, so user-facing text can name a command the reader actually has.
remote
Package remote implements SSH-based remote command execution for node workflows.
Package remote implements SSH-based remote command execution for node workflows.
rubylit
Package rubylit renders Go values as Ruby source literals for the Ruby configuration files cinc generates (client.rb and friends), which the target's cinc-client evaluates as code.
Package rubylit renders Go values as Ruby source literals for the Ruby configuration files cinc generates (client.rb and friends), which the target's cinc-client evaluates as code.
setup
Package setup handles first-run credential migration for cinc.
Package setup handles first-run credential migration for cinc.
supermarket
Package supermarket orchestrates Chef Supermarket cookbook uploads.
Package supermarket orchestrates Chef Supermarket cookbook uploads.
supermarket/explore
Package explore implements the `cinc supermarket explore` TUI: a bubbletea-driven cookbook browser over the anonymous read endpoints of Chef Supermarket.
Package explore implements the `cinc supermarket explore` TUI: a bubbletea-driven cookbook browser over the anonymous read endpoints of Chef Supermarket.
tools
gendocs command
gendocs regenerates the per-command Markdown reference under docs/commands/ from the live cobra command tree, plus a top-level README.md index that links to each per-command page with a one-line summary pulled from each command's Short.
gendocs regenerates the per-command Markdown reference under docs/commands/ from the live cobra command tree, plus a top-level README.md index that links to each per-command page with a one-line summary pulled from each command's Short.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL