Glazed Help Browser

Packages

Available packages

Sections

Terminology & Glossary
📖 Documentation
Navigation
77 sectionsv0.1
📄 Documentation

Documentation Index

77 sections available

📖 Topics

Adding New Field Types to Glazed

Comprehensive guide on implementing new field types in the Glazed framework.

Building Custom Processors

A comprehensive guide on how to build custom processors using the provided middleware and types system in Glazed.

Config Files and Overlays

Load one or more config files with clear precedence and traceable parse steps

Declarative Config Plans

Define layered config discovery as explicit source plans and preserve config provenance in parsed field history, either by resolving files yourself or by loading plans directly through source middlewares.

Documentation Guidelines for Go-Go-Golems Libraries

Learn how to write clear, engaging, and comprehensive documentation for Go-Go-Golems libraries and tools

Dual Commands

Build commands with both human-readable and structured output

Export Help as a Static Website

Use `glaze render-site` to export the Glazed help browser as a static site that can be previewed locally or hosted without a Go server.

Export Help Entries

Use `glaze help export` to export help section metadata and content to JSON, CSV, files, or SQLite for backup, indexing, and external tooling.

Flag Groups

Flag groups are a way to group flags together in the help system. This is useful if you have a lot of flags that are related to each other.

Glazed CLI linting with glazedclilint

Enforce Glazed CLI command conventions with the custom go vet analyzer.

Glazed Command Loaders

Understanding how to load Glazed commands dynamically from various sources.

Glazed Command Sections Guide

Complete guide to understanding and working with command field sections in Glazed

Glazed Commands Reference

Complete reference for creating, configuring, and running commands in Glazed

Glazed Middlewares Guide

Learn how to use Glazed's middleware system to load field values from various sources

Help System

Glazed provides a powerful, queryable help system for creating rich CLI documentation with sections, metadata, and programmatic access.

How to Write Good Documentation Pages

Style guide and best practices for creating clear, consistent, and helpful documentation.

Implementing Profiles in a Glazed (Cobra) Command

How to wire profiles.yaml into a Cobra CLI using Glazed middlewares (including proper profile-selection resolution).

Loading Fields from JSON

Explains how to load fields from a JSON file.

Logcopter Logging Architecture

Understand logcopter areas, generated package loggers, Glazed integration, and shared logging profiles.

Logging Section API Reference

Comprehensive logging configuration for CLI applications

Markdown and Code Blocks Parsing

This document explains the API and usage of the Markdown and Code parsing features in the application.

Markdown Style

glazed help system output style can be configured.

Parsing Fields

Learn how to define and parse fields in Go applications using the Field API.

Pattern-Based Config Mapping

Declarative mapping of config files to field sections using pattern matching rules

Profiles (profiles.yaml)

Use profiles.yaml to apply named configuration bundles across field sections, with predictable precedence and debugging.

Sections and Values

Learn how to use sections and values in Glazed to organize and manage field definitions.

Serve External Help Sources

Use `glaze serve` to browse help exported from other Glazed binaries, JSON files, SQLite snapshots, and markdown directories.

Serve Help Over HTTP

Use `glaze serve` to browse help pages in a browser, and reuse the help API and SPA handlers in your own HTTP server.

Table Output Format

Glazed supports a wide variety of table output formats. Besides HTML and Markdown, it leverages the go-pretty library to provide a rich set of styled terminal output.

TemplateCommand

Create commands that render Go template text using command-line flags and arguments as template variables.

Templates

Use go templates to customize output

Templating Helpers in Glazed

Guide to using the Glazed templating package.

Understanding Command Usage Strings

Explains how command argument usage is indicated within our application.

Using GatherFlagsFromStringList Function

Learn how to use the GatherFlagsFromStringList function for parsing command line flags programmatically. This function does not require the use of cobra bindings, but instead just requires a list of strings.

Using the Lua Wrapper for Glazed

A comprehensive guide to using Glazed commands within Lua scripts through the Glazed Lua wrapper

Using the MultiLoader

Learn how to use the MultiLoader to handle different types of command files with type-based dispatch

Working with Files in Commands

Describes how to work with file inputs in command fields.

Writing Help Entries for Glazed

Learn how to create and structure Markdown documents for the Glazed help system

Writing YAML Command Files

A comprehensive guide on writing YAML files to define glazed commands

📄 Examples

Add constant columns to your output

``` glaze yaml misc/test-data/test.yaml --input-is-array \ --add-fields name:Hello ```

Apply templates at the row level

``` glaze json misc/test-data/[123].json --template '{{.a}}-{{.b}}: {{.d_f}}' \ --use-row-templates --fields a,_0 \ --output csv ```

Create cliopatra YAML

``` glaze yaml misc/test-data/test.yaml \ --input-is-array --rename baz:blop \ --create-cliopatra | tee /tmp/yaml-rename.yaml ```

Declarative Config Plan Example

Use `config.Plan` with either `sources.FromResolvedFiles(...)` or `sources.FromConfigPlan(...)` to build layered config loading with provenance.

Examples of how to use the pagination flags skip and limit

This document provides examples of how to use the pagination flags 'glazed-skip' and 'glazed-limit' in Glazed.

Filter fields using Regular Expressions

``` glaze json misc/test-data/sample.json --input-is-array --regex-fields "^name_.*" --regex-filters ".*_last

quot; ```

Outputting multiple output files

``` glaze csv misc/test-data/employees.csv --output csv \ --output-file /tmp/employee.csv --output-multiple-files ```

Remove duplicates

``` glaze json misc/test-data/duplicates.json --input-is-array --remove-duplicates a,b,c --fields a,b,c ```

Rename columns using a YAML file

``` glaze yaml misc/test-data/test.yaml --input-is-array \ --rename-yaml misc/rename.yaml ```

Rename one or multiple columns

``` glaze yaml misc/test-data/test.yaml --input-is-array --rename baz:blop ```

Rename one or multiple columns using a regular expression

``` glaze yaml misc/test-data/test.yaml --input-is-array \ --rename-regexp '^(.*)bar:${1}blop' ```

Sanitize YAML

``` glaze yaml --sanitize misc/broken.yaml --output yaml ```

Select a single column and output raw

``` glaze json misc/test-data/[123].json --select-template '{{.a}}-{{.b}}' ```

Show examples for the `json` command

``` glaze help json --examples ```

Show the list of all toplevel topics

``` glaze help --list ```

Sort by columns

``` glaze json misc/test-data/sort.json --input-is-array --sort-by city,-name ```

Specifying multiple templates with --template-field

``` glaze json misc/test-data/[123].json \ --template-field 'foo:{{.a}}-{{.b}},bar:{{.d_f}}' \ --use-row-templates --fields a,foo,bar ```

SQL Output Flags

Learn how to use the flags that control SQL output in the `glaze` program.

Use a single template for single field output

``` glaze json misc/test-data/[123].json --template '{{.a}}-{{.b}}: {{.d.f}}' ```

Use jq to filter out rows

``` glaze json misc/test-data/[123].json --jq '.select(.a > 10) // []' ```

Use jq to replace one column with another

``` glaze json misc/test-data/[123].json --jq '.b = .c' ```

📦 Applications

Cool Application - Managing User Records with Glazed

A comprehensive application example for managing user records using Glazed commands.

Exposing a simple SQL table using glaze

Placeholder for what will be a small application overview of what can be done by reading from SQLite

Iterating over a column with a shell script

Shows different ways glaze can be used to iterate over columns with a shell script

🎓 Tutorials

Add Package-Scoped Logging with Logcopter

Generate package loggers and configure area-specific levels through Glazed logging settings.

Build Your First Glazed Command

Quick hands-on tutorial to build, run, and use a Glazed command with structured output

Config Files Quickstart

Minimal examples to load single and multiple config files with clear precedence

Convert a go-go-golems package to logcopter

A step-by-step playbook for adopting generated logcopter package loggers in go-go-golems repositories.

Creating a help system for a CLI application with glaze

A tutorial that shows how to build a small but rich help system for a demo CLI application, with embedded markdown files for additional examples, tutorials and topic pages.

Creating Custom Field Sections

Step-by-step tutorial for creating reusable custom field sections in Glazed

Distribute the Help Browser SPA to Other Go Binaries

Fetch the versioned `glazed-spa` GitHub Release asset and embed it in another Glazed-based binary.

Getting Started with the Glazed Lua Wrapper

A step-by-step tutorial for implementing and using the Glazed Lua wrapper in your applications

Migrating from Viper to Config Files

Step-by-step guide to migrate existing Glazed applications from Viper-based configuration to the new config file middleware system

Migration Playbook: Legacy Layers/Parameters API to Schema/Fields/Values/Sources

Exhaustive, no-compat playbook for migrating Glazed code from the legacy layers/parameters API to the schema/fields/values/sources API.