Skip to content

feat(cli): add Nushell support#1305

Draft
XiNiHa wants to merge 1 commit intovoidzero-dev:mainfrom
XiNiHa:nushell
Draft

feat(cli): add Nushell support#1305
XiNiHa wants to merge 1 commit intovoidzero-dev:mainfrom
XiNiHa:nushell

Conversation

@XiNiHa
Copy link
Copy Markdown

@XiNiHa XiNiHa commented Apr 5, 2026

This PR adds Nushell support to the Vite+ global CLI setup and environment commands.

It introduces:

  • Nushell shell detection in the CLI
  • env.nu generation alongside existing POSIX, Fish, and PowerShell env files
  • Nushell support for vp env use
  • Nushell profile detection in vp env doctor
  • Nushell cleanup support in uninstall-related flows
  • Installer updates so Nushell can be configured automatically when available

It also refactors shared shell/profile handling to keep setup, doctor, and cleanup behavior consistent across shells and platforms.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 5, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 259b9e6
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d7edb7ac7a51000957061a

fengmk2 pushed a commit that referenced this pull request Apr 10, 2026
resolves #1144

While comprehensive support for Nushell seems to be under development in
#1305, that pull request has a large impact. Therefore, I have limited
the scope of this change to env support to align with the existing
issue.

```nushell
# nushell

# 1. Setup
vp env setup
source ~/.vite-plus/env.nu  # or restart Nushell

# 2. Set a specific version
vp env use 20
# Using Node.js v20.20.2 (resolved from 20)
$env.VP_NODE_VERSION
# 20.20.2

# 3. Resolve from .node-version
vp env use
# Using Node.js v22.18.0 (resolved from .node-version)
$env.VP_NODE_VERSION
# 22.18.0

# 4. Completion (requires Fish)
vp <Tab>
# add        Add packages to dependencies
# build      Build application
# cache      Manage the task cache
# check      Run format, lint, and type checks
# ... (all subcommands shown)

# 5. False detection regression (bash launched from Nushell)
# NU_VERSION is inherited by child processes, but VP_SHELL_NU is not set,
# so vp correctly uses POSIX eval mode inside bash.
bash -c 'vp env use 20 && echo $VP_NODE_VERSION'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant