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

idx watch for filesystem

Stream filesystem change events from the live idx index.

Signature

> idx watch {flags} (pattern)

Flags

  • --ignore, -i {list<string>}: List of globs or path-prefixes to exclude.
  • --timeout, -t {duration}: Stop streaming after this duration.
  • --max-events, -n {int}: Stop after emitting this many events.

Parameters

  • pattern: Base-relative glob, path, or directory to watch. Omit or pass empty to watch the whole indexed tree.

Input/output types:

inputoutput
nothingtable<kind: string, path: string>

Examples

Watch the whole indexed tree after initializing idx.

> idx init .; idx watch

Watch only Rust files, ignoring a vendor-style path prefix.

> idx watch "**/*.rs" --ignore [target]

Take action on modified files in a pipeline.

> idx watch | where kind == "modified" | each { |e| print $"changed: ($e.path)" }

Stop after a single event (useful in scripts).

> idx watch --max-events 1

Stop after a duration if no more events are needed.

> idx watch --timeout 5sec

Notes

Requires a live runtime initialized without --no-watch. Events are debounced by fff-search and emitted as records with kind (created, modified, removed, rescan) and absolute path. Gitignored and other index-ignored files do not produce events. Patterns must be inside the indexed base path. Use plain watch for ad-hoc path watching without an index.