Interactive Mode

Explore JSON interactively with fuzzy search and expression building.

Opening Interactive Mode

Open a file without an expression to enter interactive mode.

bash
1ls readFile data.json

Works with all supported formats.

bash
1ls readFile config.yaml
1ls readFile config.toml

Mode 1: Path Explorer

Navigate and search JSON paths.

  • Fuzzy search: Type to filter paths
  • Live preview: See values as you navigate
  • Type information: Shows String, Number, Array, Object, Boolean, or null

Smart Tooltips

As you type expressions, 1ls provides intelligent assistance:

Method Hints

When you type a . followed by characters, matching method signatures appear:

Search: .fil

Method hints:
 .filter(x => ...) - Filter by condition
  .find(x => ...) - Find first match
  .findIndex(x => ...) - Find first match index
  • Fuzzy matching: Type partial names to find methods
  • Type-aware: Shows methods relevant to your data type (Array, String, Object, Number)
  • Builtin tags: Custom 1ls methods are marked with [builtin]

Live Result Preview

After completing a method expression, see the evaluated result instantly:

Search: .filter(x => x > 2)

Result:
[3, 4, 5]

This helps you verify your expression works before executing it.

Mode 2: Expression Builder

Build complex expressions with guided method selection.

  1. Navigate to a path in Explorer mode → Press Tab
  2. Type to fuzzy search methods → → to accept
  3. Type to fuzzy search properties → → to complete
  4. Repeat to chain methods
  5. Press Enter to execute

Example Session

bash
1. Navigate to .users (Array) → Tab
2. Type "fil" (accepts .filter(x => ...))
3. Type "act" (completes with x.active)
4. Type "map" (accepts .map(x => ...))
5. Type "name" (completes with x.name)
6. Enter executes: .users.filter(x => x.active).map(x => x.name)

Keyboard Shortcuts

KeyAction
↑/↓Navigate methods/properties
→ or TabAccept/complete method or property
Undo last segment
EnterExecute expression
EscGo back to Explorer / Quit
qQuit (from Explorer)

Available Methods by Type

Array

map, filter, reduce, find, findIndex, some, every, sort, reverse, slice, concat, join, flat, flatMap, length

String

toUpperCase, toLowerCase, trim, trimStart, trimEnd, split, replace, replaceAll, substring, slice, startsWith, endsWith, includes, match, length

Object

{keys}, {values}, {entries}, {length}

Number

toFixed, toString