    # File lib/chef/knife/configure.rb, line 52
          def run
            ask_user_for_config_path

            FileUtils.mkdir_p(chef_config_path)

            ask_user_for_config

            ::File.open(config[:config_file], "w") do |f|
              f.puts "log_level                :info\nlog_location             STDOUT\nnode_name                '\#{new_client_name}'\nclient_key               '\#{new_client_key}'\nvalidation_client_name   '\#{validation_client_name}'\nvalidation_key           '\#{validation_key}'\nchef_server_url          '\#{chef_server}'\ncache_type               'BasicFile'\ncache_options( :path => '\#{File.join(chef_config_path, \"checksums\")}' )\n"
              unless chef_repo.empty?
                f.puts "cookbook_path [ '#{chef_repo}/cookbooks', '#{chef_repo}/site-cookbooks' ]"
              end
            end

            if config[:initial]
              ui.msg("Creating initial API user...")
              Chef::Config[:chef_server_url] = chef_server
              Chef::Config[:node_name] = admin_client_name
              Chef::Config[:client_key] = admin_client_key
              client_create = Chef::Knife::ClientCreate.new
              client_create.name_args = [ new_client_name ]
              client_create.config[:admin] = true
              client_create.config[:file] = new_client_key
              client_create.config[:yes] = true
              client_create.config[:no_editor] = true
              client_create.run
            else
              ui.msg("*****")
              ui.msg("")
              ui.msg("You must place your client key in:")
              ui.msg("  #{new_client_key}")
              ui.msg("Before running commands with Knife!")
              ui.msg("")
              ui.msg("*****")
              ui.msg("")
              ui.msg("You must place your validation key in:")
              ui.msg("  #{validation_key}")
              ui.msg("Before generating instance data with Knife!")
              ui.msg("")
              ui.msg("*****")
            end

            ui.msg("Configuration file written to #{config[:config_file]}")
          end