console-rendering

Render Go structs, slices, and maps into console output using struct tags.

4.9k|489|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/githubnext/gh-aw --skill console-rendering
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: console-rendering
Source: https://github.com/githubnext/gh-aw/tree/main/skills/console-rendering
Command: npx skills add https://github.com/githubnext/gh-aw --skill console-rendering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the creation of human-readable console output from Go structs, slices, and maps, making AI workflow logs and reports easier to understand and debug. It helps developers quickly grasp complex data.

Core Features & Use Cases

  • Struct Tag-Based Formatting: Control display names, titles, and value formats (e.g., format:number, format:cost) directly in Go struct tags.
  • Automatic Table Generation: Slices of structs are automatically rendered as clean, aligned tables.
  • Smart Type Handling: time.Time fields are automatically formatted, and unexported fields are safely handled.
  • Use Case: A developer wants to display a list of AI workflow runs with their status and token usage. This skill guides them to use console:"header:Token Usage,format:number" to get a clean, formatted table output.

Quick Start

Consult the console-rendering skill to format your Go struct MyData with a custom header and format:cost for a Price field.

Frequently Asked Questions about console-rendering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format Go struct output for the console?▼

Format Go struct output using console struct tags to control display names, titles, and value formatting. Tags like `console:"header:Name,format:cost"` render structs as human-readable console output with automatic alignment and type-specific formatting for numbers, costs, and timestamps.

Can I render a slice of Go structs as a table?▼

Yes, slices of structs automatically render as clean, aligned tables. The console-rendering approach applies formatting rules from struct tags to each row, generating formatted table output without manual table construction logic.

What formatting options are available for console output in Go?▼

Console rendering supports format directives including `format:number` for numeric display, `format:cost` for currency, automatic `time.Time` formatting, `omitempty` to hide zero values, and the `-` tag to exclude fields entirely from output.

How do I handle unexported fields when rendering Go data to console?▼

The console-rendering approach safely handles unexported fields by respecting Go visibility rules during rendering. Unexported fields are excluded from console output automatically, preventing runtime panics and maintaining encapsulation.

Can I render maps to console output?▼

Yes, maps render as markdown-style headers in console output. This approach transforms map data into structured, human-readable console displays that align with Go struct and slice rendering patterns.

What's the best way to display AI workflow logs with token usage in Go?▼

Use console struct tags with `header` and `format:number` directives on struct fields to automatically generate formatted table output of workflow runs. This renders token counts and status information as clean, aligned console tables without custom formatting code.