agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/chef-cli/SKILL.md

chef-cli

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Perform Chef configuration management operations using the knife and chef CLI tools. Use for inspecting nodes, cookbooks, roles, and environments on a Chef server.

  • Installs packages

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the server/organization table and rules below when constructing all knife/chef commands.

    line 8
  2. Distinctive:

    Update the table below with your Chef server organizations before using this skill:

    line 12
  3. Distinctive:

    If the target environment is unclear, ask the user before running any command.

    line 19
  4. Very specific:

    If knife/chef is not installed or no config exists, inform the user that setup is required and ask them to complete the following steps …

    line 23
  5. Very specific:

    Always pass --config explicitly — never rely on the default ~/.chef/knife.rb, which may point to the wrong organization:

    line 32
  6. Distinctive:

    NEVER target a Chef server/organization not listed in the configuration table above.

    line 81
  7. Very specific:

    Always pass --config explicitly on every command — never rely on the default knife.rb.

    line 82
  8. Very specific:

    NEVER run knife ssh, chef-client against production nodes, or any deletion command without explicit user instruction.

    line 83
  9. Very specific:

    NEVER print, display, or store the contents of .pem client key files used for Chef server authentication.

    line 84
  10. Very specific:

    Always run chef-client --why-run (dry-run) before suggesting a real cookbook run against nodes.

    line 85
  11. Very specific:

    If a node name or cookbook version is unfamiliar, look it up with knife node show/knife cookbook show first.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Chef CLI Skill

Use the server/organization table and rules below when constructing all knife/chef commands.

Configuration

Update the table below with your Chef server organizations before using this skill:

EnvironmentChef Server URLOrganizationConfig File
Production<your-prod-chef-server-url><your-prod-org>~/.chef/prod_knife.rb
Staging / Non-Prod<your-nonprod-chef-server-url><your-nonprod-org>~/.chef/staging_knife.rb

If the target environment is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

If knife/chef is not installed or no config exists, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

brew install --cask chef-workstation
knife configure --config-file <config-file>

Command Format

Always pass --config explicitly — never rely on the default ~/.chef/knife.rb, which may point to the wrong organization:

knife <command> --config <config-file> [options]

Examples

# Non-Prod
knife node list --config ~/.chef/staging_knife.rb
knife node show <node-name> --config ~/.chef/staging_knife.rb

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
knife node list / knife node show <name>List or show node details
knife cookbook list / knife cookbook show <name>List or show cookbooks
knife role list / knife role show <name>List or show roles
knife environment list / knife environment show <name>List or show environments
knife search node "<query>"Search nodes
knife statusShow recent chef-client run status across nodes
chef exec chef-client --why-runDry-run a cookbook against local resources, showing what would change

Mutating operations (confirm with user before running)

CommandDescription
knife cookbook upload <name>Upload a cookbook to the Chef server
knife role create/from fileCreate or update a role
knife environment from fileCreate or update an environment
knife node run_list add <node> <item>Modify a node's run list

Never run — requires explicit human approval

CommandReason
knife node delete <name>Irreversible node deregistration
knife cookbook delete <name>Irreversible cookbook deletion
knife environment delete <name>Irreversible environment deletion
knife ssh <query> "<command>"Executes arbitrary commands on live nodes
chef-client run directly against production nodesApplies real configuration changes to live production infrastructure

Rules

  • NEVER target a Chef server/organization not listed in the configuration table above. If a command references an unfamiliar organization, stop and ask the user to confirm.
  • Always pass --config explicitly on every command — never rely on the default knife.rb.
  • NEVER run knife ssh, chef-client against production nodes, or any deletion command without explicit user instruction.
  • NEVER print, display, or store the contents of .pem client key files used for Chef server authentication.
  • Always run chef-client --why-run (dry-run) before suggesting a real cookbook run against nodes.
  • If a node name or cookbook version is unfamiliar, look it up with knife node show/knife cookbook show first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.