I\'d like to create a nice wrapper class around knife to allow a program to run knife commands in a readable manner. I\'m currently trying to use the knife.rb file in the chef
You could refer to following solution: http://lists.opscode.com/sympa/arc/chef/2011-08/msg00014.html
require 'rubygems'
require "chef"
require "chef/knife/core/bootstrap_context"
require 'chef/knife'
require 'chef/knife/ssh'
require 'net/ssh'
require 'net/ssh/multi'
require 'chef/knife/bootstrap'
Chef::Config.from_file(File.expand_path('~/.chef/knife.rb'))
kb = Chef::Knife::Bootstrap.new
kb.name_args = "some.host"
kb.config[:ssh_user] = "ubuntu"
kb.config[:run_list] = "role[test]"
kb.config[:use_sudo] = true
kb.run