Skip to content

Nushell failed: Can't run alias directly. Unwrap it first. #18725

Closed

Description

@kuchta

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

Describe the bug

: alias "from jsonc" = from json
: open deno.jsonc
Error: nu::shell::error

  × Error while parsing as jsonc
   ╭─[repl_entry #3:1:6]
 1 │ open deno.jsonc
   ·      ─────┬────
   ·           ╰── Could not parse '/Users/kuchta/Projects/RadixVerse/deno.jsonc' with `from jsonc`
   ╰────
  help: Check out `help from jsonc` or `help from` for more options or open raw data with `open --raw '/Users/kuchta/Projects/RadixVerse/
        deno.jsonc'`

Error: nu::shell::nushell_failed_spanned

  × Nushell failed: Can't run alias directly. Unwrap it first.
   ╭─[repl_entry #3:1:1]
 1 │ open deno.jsonc
   · ──┬─
   ·   ╰── originates from here
   ╰────
  help: This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues

How to reproduce

^^^

Expected behavior

Either allow aliases to be used wherever custom commands are supported or deprecate them altogether. Their definition is not much shorter than custom commands and learning and maintaining two syntaxes for commands is a waste of time.

Configuration

key value
version 0.114.1
major 0
minor 114
patch 1
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.96.1 (31fca3adb 2026-06-26) (Homebrew)
cargo_version cargo 1.96.1 (356927216 2026-06-26) (Homebrew)
build_time 2026-07-11 15:27:28 +00:00
build_rust_channel release
allocator standard
features default, lsp, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins dns 4.0.6
experimental_options example=false, dc-glob=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=false, cell-path-types=false

Activity

  1. added
    status:needs-triage
    on Jul 25, 2026
  2. fdncred commented on Jul 25, 2026

    @fdncred
    Contributor

    Why would we have aliases work identically to custom commands? This would make one of them essentially useles. You can do much more with custom commands than aliases. Aliases are meant for small things like alias l = ls -l.

  3. kuchta commented on Jul 25, 2026

    @kuchta
    Author

    @fdncred

    First of all, I created this issue to report situation that nushell says shouldn't happen and should be reported.

    Second, what's that syntactically "great" (as opposed to your small things) about def l [] { ls -l }? If superfluous empty parameters array was made optional it would be exactly the same number of characters. That makes aliases essentially quite (redundant and) useless... I would say even harmful, if they can't be used where custom commands can, which can confuse new users...

  4. fdncred commented on Jul 25, 2026

    @fdncred
    Contributor

    Thanks for the info. I still don't think we should have aliases do everything that custom commands do. custom commands can be hundreds of lines long. That doesn't seem right for aliases. However, if we removed aliases altogether, I wouldn't have a problem with it, especially since abbreviations exist now.

    I do get your point about your example with from jsonc. We could probably make that work, but still, that's not the same of having it do everything custom commands do.

  5. kuchta commented on Jul 25, 2026

    @kuchta
    Author

    Maybe I didn't express myself clearly enough, but I definitely didn't mean to make aliases more powerful. Quite the contrary. I meant either to remove them completely or to make them just syntactic sugar for custom commands.

  6. fdncred commented on Jul 25, 2026

    @fdncred
    Contributor

    oh, I didn't get that at all from your issue. LOL. Probably a me problem. Thanks for clarifying. I could go for making them syntactic sugar for custom commands. I could also go for removing them completely but I'm sure that would cause an uproar.

  7. kuchta commented on Jul 25, 2026

    @kuchta
    Author

    The important thing is that we finally understood each other. 🙏🏻

    I'm personally more inclined to remove aliases completely, especially if the superfluous empty parameters array is made optional in the custom command definition. When there are two syntax options for similar functionality, new users will inevitably wonder what the difference is.

  8. added this to the 1.0 milestone on Oct 13, 2026
  9. added a commit that references this issue on Oct 13, 2026
    b23af9f
  10. modified the milestones: 1.0, v0.117.0 on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions