Skip to content

Commit f7389c9

Browse files
authored
Merge pull request #773 from jupyterlab/release-v4.1.1-1
Release v4.1.1-1
2 parents eb6f06f + e92be34 commit f7389c9

File tree

4 files changed

+160
-3
lines changed

4 files changed

+160
-3
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ __pycache__
2525

2626
env_installer/jlab_server/
2727
env_installer/jlab_server.tar.gz
28-

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Previously opened sessions are stored as part of application data and they are l
6565
- Connect to existing JupyterLab server
6666
- `jlab https://example.org/lab?token=abcde`
6767

68-
For additional CLI options run `jlab --help` in command line.
68+
See [CLI documentation](cli.md) for more CLI commands and options.
6969

7070
### JupyterLab Extension support
7171

@@ -77,6 +77,8 @@ JupyterLab Desktop currently supports user-friendly [prebuilt](https://jupyterla
7777

7878
- [Python environment management](python-env-management.md) guide for managing Python environments on your system using JupyterLab Desktop
7979

80+
- See [CLI documentation](cli.md) for CLI commands and options
81+
8082
- See [troubleshooting guide](troubleshoot.md) for troubleshooting issues
8183

8284
- For contributing, see [developer documentation](dev.md)

cli.md

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# JupyterLab Desktop CLI
2+
3+
JupyterLab Desktop comes with a CLI (`jlab`) that provides a rich set of commands and options to launch and configure the application. Below are the CLI options with examples.
4+
5+
## Setting up the `jlab` CLI command
6+
7+
JupyterLab Desktop installers for Windows and Linux create `jlab` CLI command as part of the installation process. However, macOS application creates this command at first launch and after updates. This command creation might sometimes fail if the user doesn't have the required permissions. See this [troubleshooting section](troubleshoot.md#macOS-write-permission-issues) to properly setup CLI on macOS.
8+
9+
## Jupyterlab Desktop CLI commands
10+
11+
- [`jlab` _Application launch_](#jlab-options)
12+
- [`jlab env` _Python environment management_](#jlab-env-options)
13+
- [`jlab config` _Application and project setting management_](#jlab-config-options)
14+
- [`jlab appdata` _Access application cache data_](#jlab-appdata-options)
15+
- [`jlab logs` _Access application logs_](#jlab-logs-options)
16+
17+
## Application launch `jlab`
18+
19+
### `jlab <options>`
20+
21+
- Open directories using relative or absolute path
22+
- `jlab .` launch in current directory
23+
- `jlab ../notebooks` launch with relative path
24+
- `jlab /Users/username/notebooks` launch with absolute path
25+
- Open notebooks and other files using relative or absolute path
26+
- `jlab /Users/username/notebooks/test.ipynb` launch notebook with absolute path
27+
- `jlab ../notebooks/test.ipynb` launch notebook with relative path
28+
- `jlab ../test.py` launch python file with relative path
29+
- Open with a custom Python environment
30+
- `jlab --python-path /Users/username/custom_env/bin/python ../notebooks/test.ipynb` launch notebook with custom Python environment
31+
- Connect to existing JupyterLab server
32+
- `jlab https://example.org/lab?token=abcde`
33+
34+
### `jlab env <options>`
35+
36+
See Python environment management [documentation](python-env-management.md#python-environment-management-using-cli) for `jlab env` CLI options.
37+
38+
### `jlab config <options>`
39+
40+
- #### `jlab config list [--project-path]`
41+
42+
Show application settings together with any project level overrides. If `--project-path` is set then setting overrides for the project in the specified directory are listed otherwise overrides for the current working directory are listed.
43+
44+
Examples:
45+
46+
```bash
47+
# list global application settings and project overrides in current working directory
48+
jlab config list
49+
# list global application settings and project overrides in /opt/test-project
50+
jlab config list --project-path=/opt/test-project
51+
```
52+
53+
- #### `jlab config set <setting-key> <setting-value> [--project] [--project-path]`
54+
55+
Set global application setting or project setting. If called without `--project` and `--project-path` sets global application setting. Calling with `--project` sets the project override for the current working directory. Calling with `--project-path` sets the project override for the specified directory.
56+
57+
Examples:
58+
59+
```bash
60+
# set checkForUpdatesAutomatically to false
61+
jlab config set checkForUpdatesAutomatically false
62+
# set theme to "dark"
63+
jlab config set theme "dark"
64+
# set the global default Python path for JupyterLab server
65+
jlab config set pythonPath /Users/username/custom_env/bin/python
66+
# set the default Python path for JupyterLab server for project at current working directory
67+
jlab config set pythonPath /Users/username/custom_env/bin/python --project
68+
# set the default Python path for JupyterLab server for particular project
69+
jlab config set pythonPath /Users/username/custom_env/bin/python --project-path=/opt/test-project
70+
# set conda channels to ["conda-forge", "bioconda"] on Windows
71+
jlab config set condaChannels [\"conda-forge\",\"bioconda\"]
72+
# set conda channels to ["conda-forge", "bioconda"] on macOS and Linux
73+
config set condaChannels '["conda-forge","bioconda"]'
74+
```
75+
76+
- #### `jlab config unset <setting-key> [--project] [--project-path]`
77+
78+
Unset/reset global application setting or project setting. If called without `--project` and `--project-path` unsets global application setting. Calling with `--project` unsets the project override for the current working directory. Calling with `--project-path` unsets the project override for the specified directory. Once a project setting is unset it defaults to global setting. Once a global setting is unset its default value is used.
79+
80+
Examples:
81+
82+
```bash
83+
# unset checkForUpdatesAutomatically
84+
jlab config unset checkForUpdatesAutomatically
85+
# unset the global default Python path for JupyterLab server
86+
jlab config unset pythonPath
87+
# unset the default Python path for JupyterLab server for project at current working directory
88+
jlab config unset pythonPath --project
89+
# unset the default Python path for JupyterLab server for particular project
90+
jlab config unset pythonPath --project-path=/opt/test-project
91+
```
92+
93+
- #### `jlab config open-file [--project] [--project-path]`
94+
95+
Open the settings JSON file for the global settings or project settings using the default File editor on system. If called without `--project` and `--project-path` opens global application settings file. Calling with `--project` opens the settings file for the the project at current working directory. Calling with `--project-path` opens the settings file for the project at specified directory.
96+
97+
Examples:
98+
99+
```bash
100+
# open global settings file
101+
jlab config open-file
102+
# open settings file for project at current working directory
103+
jlab config open-file --project
104+
# open settings file for particular project
105+
jlab config open-file --project-path=/opt/test-project
106+
```
107+
108+
### `jlab appdata <options>`
109+
110+
- #### `jlab appdata list`
111+
112+
Show application data. This is the data cached by the app and reused at restart. Some of the data is not listed for simplicity but can be accessed using the `open-file` option.
113+
114+
Examples:
115+
116+
```bash
117+
# list application data
118+
jlab appdata list
119+
```
120+
121+
- #### `jlab appdata open-file`
122+
123+
Open the application data JSON file using the default File editor on system.
124+
125+
Examples:
126+
127+
```bash
128+
# open the application data file
129+
jlab appdata open-file
130+
```
131+
132+
### `jlab logs <options>`
133+
134+
- #### `jlab logs show`
135+
136+
Show application logs in system Terminal.
137+
138+
Examples:
139+
140+
```bash
141+
# show application data
142+
jlab logs show
143+
```
144+
145+
- #### `jlab logs open-file`
146+
147+
Open the application log file using the default File editor on system.
148+
149+
Examples:
150+
151+
```bash
152+
# open the application log file
153+
jlab logs open-file
154+
```
155+
156+
For additional CLI options run `jlab --help` in command line.

python-env-management.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python environment management
22

3-
JupyterLab Desktop (JLD) lets you manage Python environments on your system with a simple and user-friendly UI. You can launch the Python environment management dialog by using the `Hamburger Menu` on top right -> `Manage Python environments` or by clicking the gear icon on session environment selection popup. (Note: You can also manage Python environments usin JLD CLI (jlab), which comes with additional environment create options. See [this section](#python-environment-management-using-cli) for CLI commands to manage environments.)
3+
JupyterLab Desktop (JLD) lets you manage Python environments on your system with a simple and user-friendly UI. You can launch the Python environment management dialog by using the `Hamburger Menu` on top right -> `Manage Python environments` or by clicking the gear icon on session environment selection popup. (Note: You can also manage Python environments using JLD CLI (jlab), which comes with additional environment create options. See [this section](#python-environment-management-using-cli) for CLI commands to manage environments.)
44

55
<img src="media/env-select-popup-gear-hilited.png" alt="Environment select popup gear" width=700 />
66
<img src="media/manage-python-envs-menu.png" alt="Manage Python environments menu" width=300 />

0 commit comments

Comments
 (0)