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
  • Introduction
  • Installation
    • Default Shell
  • Getting Started
    • Quick Tour
    • Moving Around the System
    • Thinking in Nu
    • Nushell Cheat Sheet
  • Nu Fundamentals
    • Types of Data
    • Loading Data
    • Pipelines
    • Working with Strings
    • Working with Lists
    • Working with Records
    • Working with Tables
    • Navigating and Accessing Structured Data
    • Special Variables
  • Programming in Nu
    • Custom Commands
    • Aliases
    • Operators
    • Variables
    • Control Flow
    • Scripts
    • Modules
      • Using Modules
      • Creating Modules
    • Overlays
    • Sorting
    • Testing your Nushell Code
    • Debugging Scripts
    • Best Practices
  • Nu as a Shell
    • Configuration
    • Environment
    • Stdout, Stderr, and Exit Codes
    • Running System (External) Commands
    • How to Configure 3rd Party Prompts
    • Directory Stack
    • Reedline, Nu's Line Editor
    • Custom Completions
    • Externs
    • Coloring and Theming in Nu
    • Hooks
    • Background Jobs
  • Coming to Nu
    • Coming from Bash
    • Coming from CMD.EXE
    • Coming from PowerShell
    • Nu map from other shells and domain specific languages
    • Nu Map from Imperative Languages
    • Nu Map from Functional Languages
    • Nushell operator map
  • Design Notes
    • How Nushell Code Gets Run
  • (Not So) Advanced
    • Standard Library
    • Dataframes
    • Metadata
    • Creating Your Own Errors
    • Parallelism
    • Plugins
    • explore
    • Building TUIs with tui
    • MCP Server

explore

explore is a table pager, like less but for structured data. Pipe any value into it to scroll through it, drill down into nested records and tables, search, and run Nushell commands on what you are looking at.

Signature

> explore --head <bool> --index --tail --peek

Parameters

  • --head <bool>: Show or hide column headers (default true)
  • --index, -i: Show row indexes when viewing a list
  • --tail, -t: Start with the viewport scrolled to the bottom
  • --peek, -p: When quitting, output the value of the cell the cursor was on

Get Started

ls | explore -i

explore-ls-png

A few more ways to start:

# Explore the system host information record
sys host | explore

# Explore the output of ls without column names
ls | explore --head false

# Start at the end of a long list
help commands | explore --tail

# Explore a JSON file, then save the part you were looking at when you quit
open file.json | explore --peek | to json | save part.json

Moving Around

KeysAction
Arrow keys, or h j k lMove the cursor
Ctrl+p / Ctrl+nMove up / down (Emacs style)
PageUp / PageDown, Ctrl+b / Ctrl+f, Alt+v / Ctrl+vPage up / page down
Home / End, or g / GJump to the first / last row
Enter or iEnter cursor mode; in cursor mode, drill into the selected cell
Esc or qLeave cursor mode; otherwise go back up a level, and exit from the top level
tTranspose (flip rows and columns), in view mode
eExpand (show all nested data)

explore starts in view mode (VIEW in the status bar), where the arrow keys scroll the table. Press Enter (or i) to switch to cursor mode (EDIT in the status bar), where the arrow keys move a cursor from cell to cell. Pressing Enter again on a cell that holds a record or a list opens it in a new view, so you can walk down into nested data. Esc leaves cursor mode, and pressing it again goes back up one level.

Searching

Press / to search forward or ? to search backward. Results are highlighted as you type. Then use n and N to move between the matches.

Commands

explore has a few built-in commands. Press : and then type a command name:

CommandAction
:helpShow the help page
:tryOpen an interactive REPL on the current data
:nu <cmd>Run a Nushell command on the current data
:qExit explore

Config

explore's colors are configured in $env.config.explore. Each value takes the same forms as color_config: a color name, a #RRGGBB hex code, or a {fg, bg, attr} record. For example:

$env.config.explore = {
    selected_cell: { bg: light_blue }
    highlight: { fg: black, bg: yellow }
    title_bar_text: { fg: white }
    title_bar_background: { bg: blue }
    status: {
        success: { fg: black, bg: green }
        error: { fg: white, bg: red }
    }
    try: { reactive: false }
}

The supported keys are selected_cell, highlight, status_bar_text, status_bar_background, command_bar_text, command_bar_background, title_bar_text, title_bar_background, status (with info, success, warn, and error entries), and try.reactive. When try.reactive is true, :try re-runs your command as you type instead of only when you press Enter.

Run config nu --doc to see the documentation and defaults for every key.

Examples

Peeking a Value

$nu | explore --peek

explore-peek-gif

:try Command

There's an interactive environment which you can use to navigate through data using nu.

explore-try-gif

Keeping the chosen value by $nu

Remember you can combine it with --peek.

explore-try-nu-gif

Exploring Your Configuration

explore config opens your current $env.config as a tree with an editor pane. Use Tab to switch between the tree and the editor, the arrow keys to move and to expand or collapse nodes, and Enter to start editing a value. Press Ctrl+S to apply an edit. When you quit with q, your changes are applied to the running session; Ctrl+C quits without saving them.

# Browse and edit the running configuration
explore config

# Explore any JSON data as a tree
open --raw data.json | explore config

# Print the tree without starting the TUI
open --raw data.json | explore config --tree

Building Regular Expressions

explore regex opens an interactive editor for building and testing a regular expression against some sample text. Press Ctrl+Q to quit, and the expression you built is returned:

let pattern = open notes.txt | explore regex
open notes.txt | lines | where $it =~ $pattern

Building Your Own Interface

explore is a ready-made viewer. To build your own interactive interface, such as a picker, a form, or a dashboard, see Building TUIs with tui.

Edit this page on GitHub
Contributors: Maxim Zhiburt, fdncred, Justin Ma, amtoine, Hofer-Julian, Máté FARKAS, Stefan Holderbach, Mate Farkas, Viktor Poletansky, Filipp Samoilov, paulie4, hank20010209, Ethan Hawksley
Prev
Plugins
Next
Building TUIs with tui