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

overlay use for core

Use definitions from a module as an overlay.

Signature

> overlay use {flags} (name) (as)

Flags

  • --prefix, -p: Prepend module name to the imported commands and aliases
  • --reload, -r: If the overlay already exists, reload its definitions and environment.

Parameters

  • name: Module name to use overlay for (null for no-op).
  • as: as keyword followed by a new name.

Input/output types:

inputoutput
nothingnothing

Examples

Create an overlay from a module

> module spam { export def foo [] { "foo" } }
    overlay use spam
    foo

Create an overlay from a module and rename it

> module spam { export def foo [] { "foo" } }
    overlay use spam as spam_new
    foo

Create an overlay with a prefix

> 'export def foo { "foo" }'
    overlay use --prefix spam
    spam foo

Create an overlay from a file

> 'export-env { $env.FOO = "foo" }' | save spam.nu
    overlay use spam.nu
    $env.FOO

Notes

This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html