Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

grid for viewers

Renders the output to a textual terminal grid.

Signature

> grid {flags} (column)

Flags

  • --width, -w {int}: Number of terminal columns wide (not output columns).
  • --color, -c: Draw output with color.
  • --icons, -i: Draw output with icons (assumes nerd font is used).
  • --separator, -s {string}: Character to separate grid with.

Parameters

  • column: Format this column in a grid.

Input/output types:

inputoutput
list<any>string
recordstring

Examples

Render a simple list to a grid

> [1 2 3 a b c] | grid
1 │ 2 │ 3 │ a │ b │ c

The above example is the same as:

> [1 2 3 a b c] | wrap name | grid name
1 │ 2 │ 3 │ a │ b │ c

Render a record to a grid (deprecated)

> {name: 'foo', b: 1, c: 2} | grid
foo

Render a list of records to a grid

> [{name: 'A', v: 1} {name: 'B', v: 2} {name: 'C', v: 3}] | grid name
A │ B │ C

Render a table with 'name' column in it to a grid

> [[name patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | grid name
0.1.0 │ 0.1.1 │ 0.2.0

Render a table with 'name' column in it to a grid with icons and colors

> ls | grid --icons --color name

Notes

The grid command creates a concise gridded layout for the input. It prints every item of the list in a grid layout. However, for table, you need to provide the name of the column you want to put in the grid.