class Chef::Knife::Core::NodePresenter

def summarize(data)

in the ui object.
the volume of output is adjusted accordingly. Uses colors if enabled
terminal. If config[:medium_output] or config[:long_output] are set
Converts a Chef::Node object to a string suitable for output to a
def summarize(data)
  if data.is_a?(Chef::Node)
    node = data
    # special case clouds with their split horizon thing.

    ip = (node[:cloud] && node[:cloud][:public_ipv4_addrs] && node[:cloud][:public_ipv4_addrs].first) || node[:ipaddress]
    summarized = <<~SUMMARY

      #{ui.color("Node Name:", :bold)}   #{ui.color(node.name, :bold)}
    SUMMARY

    show_policy = !(node.policy_name.nil? && node.policy_group.nil?)
    if show_policy
      summarized << <<~POLICY

        #{key("Policy Name:")}  #{node.policy_name}
        #{key("Policy Group:")} #{node.policy_group}
      POLICY

    else
      summarized << <<~ENV

        #{key("Environment:")} #{node.chef_environment}
      ENV

    end
    summarized << <<~SUMMARY

      #{key("FQDN:")}        #{node[:fqdn]}
      #{key("IP:")}          #{ip}
      #{key("Run List:")}    #{node.run_list}
    SUMMARY

    unless show_policy
      summarized << <<~ROLES

        #{key("Roles:")}       #{Array(node[:roles]).join(", ")}
      ROLES

    end
    summarized << <<~SUMMARY

      #{key("Recipes:")}     #{Array(node[:recipes]).join(", ")}
      #{key("Platform:")}    #{node[:platform]} #{node[:platform_version]}
      #{key("Tags:")}        #{node.tags.join(", ")}
    SUMMARY

    if config[:medium_output] || config[:long_output]
      summarized += <<~MORE

        #{key("Attributes:")}
        #{text_format(node.normal_attrs)}
      MORE

    end
    if config[:long_output]
      summarized += <<~MOST

        #{key("Default Attributes:")}
        #{text_format(node.default_attrs)}
        #{key("Override Attributes:")}
        #{text_format(node.override_attrs)}
        #{key("Automatic Attributes (Ohai Data):")}
        #{text_format(node.automatic_attrs)}
      MOST

    end
    summarized
  else
    super
  end
end