You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tree visualization, syntax highlighting, interactive TUI mode with inline editing.
Features
Feature
Description
Tree View
Beautiful tree visualization (Unicode/ASCII/Indent styles)
Syntax Highlighting
Color-coded keys, values, and types
Interactive TUI
Navigate, fold/unfold, search with vim-like keybindings
Inline Editing
Edit scalar values directly in TUI mode
Path Extraction
Query values with JSONPath-like syntax
JSON Support
Bidirectional YAML/JSON conversion
Formatting
Format YAML files with consistent styling
Diff
Structural comparison between YAML/JSON files
Installation
# Go install
go install github.com/simota/yam@latest
# From source
git clone https://github.com/simota/yam.git
cd yam && go build -o yam .
Quick Start
# View a YAML file
yam config.yaml
# Interactive TUI mode
yam -i config.yaml
# Pipe from stdin
cat config.yaml | yam
# Extract a value
yam '.metadata.name' config.yaml
# Output as JSON
yam --json config.yaml
# Format a YAML file
yam fmt config.yaml
# Format in-place
yam fmt -w config.yaml
# Compare two files
yam diff config-dev.yaml config-prod.yaml
Usage
yam [flags] [path] [file]
Flags:
-i, --interactive Interactive TUI mode
-s, --style string Tree style: unicode, ascii, indent (default "unicode")
-t, --types Show type annotations
-j, --json Output as JSON
-r, --raw Output raw value without decoration
-h, --help Help for yam
-v, --version Version for yam
Subcommands
yam fmt - Format YAML files
yam fmt [flags] [file]
Flags:
-w, --write Write result to source file instead of stdout
-i, --indent int Indentation width in spaces (default 2)
-s, --sort-keys Sort keys alphabetically
yam diff - Compare YAML/JSON files
yam diff [flags] <file1> <file2>
Flags:
-i, --interactive Interactive TUI mode with split view
-s, --summary Show only summary (no detailed diff)