Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A drop in replacement for knife that helps you build out processes around Chef
Branch: master

Merge pull request #1 from bscott/campfire-notifier

Merged in campfire patch from bscott
latest commit 775ad8fff3
@knuckolls authored


A drop in replacement for knife that helps you build out processes around Chef.



Santoku is primarily used for firing off notifications when knife commands are run. There are two concepts in Santoku: callbacks, and notifiers. Santoku fires off callbacks before and after any knife command is run. Callbacks can be any arbitrary ruby code in config/santoku-before.rb or config/santoku-after.rb. However, they are primarily made up of regexp matcher functions that fire off notifications to Santoku notification plugins.

Right now only Hipchat & Campfire support has been written. More work will be done to let you drop your own notification classes into the lib/santoku/ folder of your chef repo to build integrations with your favorite systems. If you build out something and would like it added to the master project just send me a pull request.

You don't have to use Santoku for notifications, that's just what it was originally built for.


Just run knife commands with the santoku command instead of knife.

For example, any time you would have run this:

knife cookbook upload rabbitmq

just run it with santoku instead

santoku cookbook upload rabbitmq

And if you reallly love santoku just make it an alias, put it in your profile, and forget all about it:

alias knife="santoku"


Put something like this in your config/santoku-before.rb or config/santoku-after.rb. These matchers will make sure that only commands that alter the chef server send off a notification.

match /spork/ do
  notify :hipchat, "Someone used the spork plugin"

match /from file/ do
  notify :hipchat

require 'etc'
match /cookbook upload (.*)/ do |cookbook|
  notify :hipchat, "#{Etc.getlogin} finished uploading #{cookbook}"

match /create/ do
  notify :hipchat

match /delete/ do
  notify :hipchat

match /bootstrap/ do 
  notify :hipchat

Put this in config/santoku-config.yml

    token: "your_hipchat_api_token"
    room: "developers"
    from: "Knife"
    notify: false
    color:  "yellow"

After configuring all of that you should start receiving notifications in your hipchat room whenever someone alters something on the server with knife. This can easily be adapted to add in notifications to other services.


Add this line to your application's Gemfile:

gem 'knife-santoku'

And then execute:

$ bundle

Or install it yourself as:

$ gem install knife-santoku


  • Add in the logic for end user drop in notification plugins
  • Better tests
  • Merge real callback functionality into the upstream knife codebase.
    • Santoku only lets you notify before and after knife commands.
    • It would be best and most flexible to be able to hook right in with knife inside opscode's codebase.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.