Skip to main content

Syntax Highlighting

Atmos provides syntax highlighting for YAML and JSON output in the terminal. You can customize the color scheme, enable line numbers, and control line wrapping behavior.

Configuration

atmos.yaml

settings:
terminal:
syntax_highlighting:
enabled: true # Enable/disable syntax highlighting
formatter: terminal # Output formatter
theme: dracula # Color scheme to use
line_numbers: false # Show line numbers
wrap: false # Wrap long lines

Configuration Reference

enabled

Enable or disable syntax highlighting for terminal output.

Default: true

formatter

Output formatter to use for rendering highlighted code.

Default: terminal

theme

Color scheme for syntax highlighting. Atmos supports a wide range of themes.

Default: dracula

Popular themes:

  • dracula - Dark theme with vibrant colors
  • monokai - Classic dark theme
  • github - Light theme matching GitHub's style
  • vim - Vim's default color scheme
  • solarized-dark - Solarized dark variant
  • solarized-light - Solarized light variant
  • nord - Arctic, bluish color palette

See the full list of supported themes.

line_numbers

Show line numbers in syntax-highlighted output.

Default: false

wrap

Wrap long lines to fit terminal width.

Default: false

Example Usage

Syntax highlighting is automatically applied when using commands that output YAML or JSON:

# Display config in YAML format with syntax highlighting
atmos describe config -f yaml

# Display config in JSON format with syntax highlighting
atmos describe config

# View stack configuration
atmos describe stacks -s plat-ue2-prod
NOTE:

When output is piped to another command, syntax highlighting is automatically disabled to ensure compatibility:

# Syntax highlighting is disabled when piping
atmos describe config | grep base_path

Automatic Behavior

Syntax highlighting behavior adapts to the environment:

  • Interactive terminal: Full syntax highlighting with configured theme
  • Piped output: Highlighting automatically disabled
  • Redirected to file: Highlighting automatically disabled
  • With --force-color: Highlighting preserved even when piping