1. knife(1)
  2. Chef Manual
  3. knife(1)

NAME

knife - Chef Server API client utility

SYNOPSIS

knife sub-command [argument...] (options)

DESCRIPTION

Knife is a command-line utility used to manage data on a Chef server through the HTTP(S) API. Knife is organized into groups of subcommands centered around the various object types in Chef. Each category of subcommand is documented in its own manual page. Available topics are:

If the knife manuals are in your MANPATH, you can access help for the above topics using man knife-TOPIC; otherwise, you can view the documentation using knife help TOPIC.

OPTIONS

-s, --server-url URL
Chef Server URL, corresponds to Chef::Config chef_server_url.
-k, --key KEY
API Client Key, corresponds to Chef::Config client_key.
-c, --config CONFIG
The configuration file to use
-E, --environment ENVIRONMENT
Set the Chef environment
-e, --editor EDITOR
Set the editor to use for interactive commands
-F, --format FORMAT
Which format to use for output. See FORMATS for details.
-d, --disable-editing
Do not open EDITOR, just accept the data as is
-u, --user USER
API Client Username, corresponds to Chef::Config node_name.
-p, --print-after
Show the data after a destructive operation
-v, --version
Show chef version
-V, --verbose
More verbose output. Use twice for max verbosity.
-y, --yes
Say yes to all prompts for confirmation
--defaults
Accept default values for all questions
--[no-]color
Use colored output. Color enabled by default.
-h, --help
Show the available options for a command.

SUB-COMMANDS

Sub-commands that operate on the basic Chef data types are structured as NOUN verb NOUN (options). For all data types, the following commands are available:

Knife also includes commands that take actions other than displaying or modifying data on the Chef Server, such as knife-ssh(1).

CONFIGURATION

The knife configuration file is a Ruby DSL to set configuration parameters for Knife's GENERAL OPTIONS. The default location for the config file is ~/.chef/knife.rb. If managing multiple Chef repositories, per-repository config files can be created. The file must be .chef/knife.rb in the current directory of the repository.

If the config file exists, knife uses these settings for GENERAL OPTIONS defaults.

FILES

~/.chef/knife.rb

Ruby DSL configuration file for knife. See CONFIGURATION.

FORMATS

The amount of content displayed and the output format are modified by the --format option. If no alternate format is selected, the default is summary.

Valid formats are:

summary
displays the node in a custom, summarized format (default)
text
displays the node data in its entirety using the colorized tree display
json
displays the node in JSON format
yaml
displays the node in YAML format
pp
displays the node using Ruby's pretty printer.

For brevity, only the first character of the format is required, for example, -Fj will produce JSON format output.

CHEF WORKFLOW

When working with Chef and Knife in the local repository, the recommended workflow outline looks like:

A note about git: Opscode and many folks in the Chef community use git, but it is not required, except in the case of the cookbook site vendor sub-command, as it uses git directly. Version control is strongly recommended though, and git fits with a lot of the workflow paradigms.

EXAMPLES

ENVIRONMENT

EDITOR
The text editor to use for editing data. The --editor option takes precedence over this value, and the --disable-editing option supresses data editing entirely.

SEE ALSO

chef-client(8) chef-server(8) chef-shell(1)

knife-bootstrap(1) knife-client(1) knife-configure(1) knife-cookbook-site(1) knife-cookbook(1) knife-data-bag(1) knife-environment(1) knife-exec(1) knife-index(1) knife-node(1) knife-recipe(1) knife-role(1) knife-search(1) knife-ssh(1) knife-tag(1)

Complete Chef documentation is available online: http://wiki.opscode.com/display/chef/Home/

JSON is JavaScript Object Notation http://json.org/

SOLR is an open source search engine. http://lucene.apache.org/solr/

git(1) is a version control system http://git-scm.com/

This manual page was generated from Markdown with ronn(1) http://rtomayko.github.com/ronn/ronn.1.html

AUTHOR

Chef was written by Adam Jacob adam@opscode.com of Opscode (http://www.opscode.com), with contributions from the community.

DOCUMENTATION

This manual page was written by Joshua Timberman joshua@opscode.com.

LICENSE

Both Chef and this documentation are released under the terms of the Apache 2.0 License. You may view the license online: http://www.apache.org/licenses/LICENSE-2.0.html On some systems, the complete text of the Apache 2.0 License may be found in /usr/share/common-licenses/Apache-2.0.

CHEF

Knife is distributed with Chef. http://wiki.opscode.com/display/chef/Home

  1. Chef 11.0.0.beta.1
  2. January 2013
  3. knife(1)