Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

shell

Set shell-specific environment (current shell session only).

Unlike scuv use which writes to a file, scuv shell sets the SCUV_VERSION environment variable for the current shell session only.

Usage

eval "$(scuv shell --shell bash <name>)"   # Bash (Zsh: --shell zsh)
scuv shell --shell fish <name> | source   # Fish (fish does not export FISH_VERSION, so name the shell)

Note: If you have shell integration set up (scuv init), the eval is automatic:

scuv shell myenv    # Works directly

Arguments

ArgumentRequiredDescription
nameNoEnvironment name or system

Options

OptionDescription
--unsetClear shell-specific environment
--shell <SHELL>Target shell type (auto-detected if not specified)

Behavior

  • Sets SCUV_VERSION environment variable
  • If name is an environment: also outputs activation script
  • If name is system: also outputs deactivation script
  • --unset: outputs unset SCUV_VERSION

Priority

SCUV_VERSION has the highest priority in version resolution:

1. SCUV_VERSION env var    <- scuv shell (highest)
2. .scuv-version file      <- scuv use
3. ~/.scuv/version         <- scuv use --global

This means scuv shell overrides any file-based settings until:

  • You run scuv shell --unset
  • You close the terminal

Examples

# Use a specific environment in this terminal
scuv shell myproject

# Use system Python in this terminal
scuv shell system

# Clear the shell setting (return to file-based resolution)
scuv shell --unset

# Explicit shell type
scuv shell --shell fish myenv

Use Cases

Temporary Testing

# Currently using myproject
scuv shell testenv        # Switch to testenv temporarily
python test.py             # Test something
scuv shell myproject      # Switch back

Override Project Settings

cd ~/project               # Has .scuv-version = projectenv
scuv shell system         # Use system Python anyway
python --version           # System Python
scuv shell --unset        # Back to projectenv