console-rendering

Featured

Use Go struct tags to render styled terminal output in gh-aw.

AI & Automation 5,125 stars 539 forks Updated today MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Console Rendering System Usage Use this guide for the struct tag-based console rendering system. ## Struct Tag Support Use the `console` struct tag to control rendering behavior: - **`header:"Name"`** - Sets the display name for fields (used in both structs and tables) - **`title:"Section Title"`** - Sets the title for nested structs, slices, or maps - **`format:"type"`** - Sets the formatting type for the field value - `format:number` - Formats integers as human-readable numbers (e.g., "1k", "1.2M") - `format:cost` - Formats floats as currency with $ prefix (e.g., "$1.234") - **`omitempty`** - Skips the field if it has a zero value - **`"-"`** - Always skips the field ## Example Usage ```go type Overview struct { RunID int64 `console:"header:Run ID"` Workflow string `console:"header:Workflow"` Status string `console:"header:Status"` Duration string `console:"header:Duration,omitempty"` } data := Overview{ RunID: 12345, Workflow: "test-workflow", Status: "completed", Duration: "5m30s", } // Simple rendering fmt.Print(console.RenderStruct(data)) // Output: // Run ID : 12345 // Workflow: test-workflow // Status : completed // Duration: 5m30s ``` ## Format Tag Examples ### Number Formatting ```go type Metrics struct { TokenUsage int `console:"header:Token Usage,format:number"` Errors int `console:"header:Errors"` } data := Metrics{ TokenUsage: 250000, Errors: 5, } // Renders as: // ...

Details

Author
github
Repository
github/gh-aw
Created
1 years ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category