In chef workstation client, I want to start an interactive console to debug and check the role/recipe, or use search api, e.g.
chef-client > nodes=search ("node","name:*")
chef-client > puts "#{nodes}"
…
Just like in rails, use “rails console” to load all your rails environment into irb.
How to do it?
The “shef” tool may be what you’re looking for, it starts an IRB session in your chef environment where you can do things like search, browse and manipulate your nodes, roles, etc. There’s even a debugger to step through your recipes using the “breakpoint” resource.
Here’s a real basic example
etc.. check out the OpsCode wiki page about it: http://wiki.opscode.com/display/chef/Shef