Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

extensions/nu-bang/README.md

Raw
Rendered preview
nu-bang

nu-bang

Use Pi's ! and !! input with Nushell syntax instead of your usual shell.

nu-bang demo: a bang runs Nushell inline, !! repeats it, an interactive command hands the terminal to nvim and back

Use

Install nu, open Pi, then type a bang command such as:

!ls | where type == file

Pi runs bang commands through Nushell and offers Nushell completions while you type them. Use !! as you normally would to repeat a bang command. No slash command or activation step is needed.

Pi recognizes common full-screen editors, pagers, and terminal interfaces such as nvim, less, lazygit, and interactive Git commands. It temporarily hands those commands the terminal, then returns to Pi. Prefix any command with !i to force that behavior:

!i my-interactive-command

Interactive bang commands need Pi's terminal UI. They do not run in print or RPC mode.

By default, Pi finds nu on PATH. Set nu-bang.command only when Nushell has a different executable name or location:

{
  "nu-bang": { "command": "/usr/bin/nu" }
}

If this setting is invalid, Pi warns and uses nu from PATH.

Installation

Reference

Setting names

Setting Environment
nu-bang.command PI_NU_BANG_COMMAND

Changelog.

<img src="assets/banner.svg" alt="nu-bang" height="70">

# nu-bang

Use Pi's `!` and `!!` input with Nushell syntax instead of your usual shell.

![nu-bang demo: a bang runs Nushell inline, !! repeats it, an interactive command hands the terminal to nvim and back](assets/demo.gif)

## Use

Install `nu`, open Pi, then type a bang command such as:

```text
!ls | where type == file
```

Pi runs bang commands through Nushell and offers Nushell completions while you type them.
Use `!!` as you normally would to repeat a bang command.
No slash command or activation step is needed.

Pi recognizes common full-screen editors, pagers, and terminal interfaces such as `nvim`, `less`, `lazygit`, and interactive Git commands.
It temporarily hands those commands the terminal, then returns to Pi.
Prefix any command with `!i` to force that behavior:

```text
!i my-interactive-command
```

Interactive bang commands need Pi's terminal UI.
They do not run in print or RPC mode.

By default, Pi finds `nu` on `PATH`.
Set `nu-bang.command` only when Nushell has a different executable name or location:

```json
{
  "nu-bang": { "command": "/usr/bin/nu" }
}
```

If this setting is invalid, Pi warns and uses `nu` from `PATH`.

[Installation](../../README.md#install)

## Reference

<!-- config:start -->
### Setting names

| Setting | Environment |
| --- | --- |
| `nu-bang.command` | `PI_NU_BANG_COMMAND` |
<!-- config:end -->

[Changelog](./CHANGELOG.md).