@@ -21,3 +21,100 @@ It can be used with a drop-in installation without further steps:
2121
2222 /path/to/micromamba create -p /tmp/env ' pytest>=8.0'
2323 /path/to/micromamba run -p /tmp/env pytest myproject/tests
24+
25+ Shell Command
26+ =============
27+
28+ The ``micromamba shell `` command provides functionality for launching shells and managing shell initialization scripts for environment activation.
29+
30+ Launching a Shell
31+ -----------------
32+
33+ When used without subcommands, ``micromamba shell `` launches a new shell session in the specified environment:
34+
35+ .. code-block :: shell
36+
37+ # Launch a shell in the specified environment
38+ micromamba shell -p /path/to/env
39+ micromamba shell -n myenv
40+
41+ This is particularly useful in CI/CD environments and Docker containers where you need to work within a specific environment.
42+
43+ Shell Initialization Management
44+ -------------------------------
45+
46+ The ``micromamba shell `` command also includes several subcommands for managing shell initialization scripts:
47+
48+ ``micromamba shell init ``
49+ Add micromamba initialization scripts to your shell's configuration files (e.g., ``.bashrc ``, ``.zshrc ``).
50+
51+ ``micromamba shell deinit ``
52+ Remove micromamba initialization scripts from your shell's configuration files.
53+
54+ ``micromamba shell reinit ``
55+ Restore micromamba initialization scripts in your shell's configuration files.
56+
57+ Environment Activation Scripts
58+ ------------------------------
59+
60+ These subcommands generate shell-specific activation code that can be used in scripts or sourced directly:
61+
62+ ``micromamba shell activate ``
63+ Generate activation code for the specified environment.
64+
65+ ``micromamba shell deactivate ``
66+ Generate deactivation code to leave the current environment.
67+
68+ ``micromamba shell reactivate ``
69+ Generate reactivation code to refresh the current environment.
70+
71+ ``micromamba shell hook ``
72+ Generate shell hook scripts for environment activation.
73+
74+ .. code-block :: shell
75+
76+ # Generate activation code for bash
77+ micromamba shell activate -p /path/to/env -s bash
78+
79+ # Generate deactivation code
80+ micromamba shell deactivate -s bash
81+
82+ # Use in a script
83+ eval " $( micromamba shell activate -p /path/to/env -s bash) "
84+
85+ Supported Shells
86+ ----------------
87+
88+ The shell command supports the following shells:
89+
90+ * ``bash `` - Bash shell
91+ * ``zsh `` - Z shell
92+ * ``fish `` - Fish shell
93+ * ``powershell `` - PowerShell
94+ * ``cmd.exe `` - Windows Command Prompt
95+ * ``xonsh `` - Xonsh shell
96+ * ``tcsh `` - Tcsh shell
97+ * ``dash `` - Dash shell
98+ * ``nu `` - Nu shell
99+ * ``posix `` - POSIX-compliant shells
100+
101+ Common Options
102+ --------------
103+
104+ ``-s, --shell SHELL ``
105+ Specify the shell type. If not provided, micromamba will attempt to detect your shell automatically.
106+
107+ ``-p, --prefix PATH ``
108+ Specify the environment by its installation path.
109+
110+ ``-n, --name NAME ``
111+ Specify the environment by its name.
112+
113+ ``-r, --root-prefix PATH ``
114+ Specify the root prefix (base environment location).
115+
116+ Platform-Specific Features
117+ ---------------------------
118+
119+ ``micromamba shell enable_long_path_support ``
120+ On Windows, this command enables long path support, which allows working with file paths longer than 260 characters.
0 commit comments