-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathjupyter.ts
266 lines (264 loc) · 6.29 KB
/
jupyter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
const commonOptions: Fig.Option[] = [
{
name: "--debug",
description: "Set log level to logging.DEBUG (maximize logging output)",
},
{ name: ["-h", "--help"], description: "Show this message" },
];
const logConfigOptions: Fig.Option[] = [
{
name: "--log-level",
description: "Set the log level by value or name",
args: {
name: "level",
},
},
{
name: "--config",
description: "Choose a config file",
args: {
name: "config",
template: "filepaths",
},
},
];
const completionSpec: Fig.Spec = {
name: "jupyter",
description: "An interactive computing environment for notebook programming",
subcommands: [
{
name: "bundlerextension",
description: "Work with Jupyter bundler extensions",
subcommands: [
{
name: "enable",
description: "Enable a bundler extension",
},
{
name: "disable",
description: "Disable a bundler extension",
},
{
name: "list",
description: "List bundler extensions",
},
],
options: [
...commonOptions,
...logConfigOptions,
{
name: "--user",
description: "Apply the operation only for the given user",
args: {
name: "user",
},
},
{
name: "--system",
description: "Apply the operation system-wide",
},
{
name: "--sys-prefix",
description:
"Use sys.prefix as the prefix for installing nbextensions (for environments, packaging)",
},
{
name: ["--py", "--python"],
description: "Install from a Python package",
},
],
},
{
name: "kernel",
description: "Run a kernel locally in a subprocess",
options: [
...commonOptions,
{
name: "--kernel",
args: { name: "KernelApp.kernel_name" },
},
{
name: "--ip",
args: { name: "KernelManager.ip" },
},
],
},
{
name: "kernelspec",
description: "Manage Jupyter kernel specifications",
subcommands: [
{
name: "list",
options: [
{
name: "--json",
description: "Output spec name and location as json",
},
],
},
{
name: "install",
description: "Install a kernel specification directory",
options: [...logConfigOptions, ...commonOptions],
args: {
name: "kernel",
},
},
{
name: "uninstall",
description: "Alias for remove",
args: {
name: "kernel",
},
},
{
name: "remove",
description: "Remove one or more Jupyter kernelspecs by name",
args: {
name: "kernel",
},
},
],
},
{
name: "migrate",
description:
"Migrate configuration and data from .ipython prior to 4.0 to Jupyter locations",
options: [
...commonOptions,
...logConfigOptions,
{
name: "--generate-config",
description: "Generate default config file",
},
{
name: "-y",
description: "Answer yes to any questions instead of prompting",
},
],
},
{
name: "nbconvert",
description:
"This application is used to convert notebook files (*.ipynb) to various other formats",
options: [...commonOptions, ...logConfigOptions],
args: {
name: "file",
template: "filepaths",
},
},
{
name: "nbextension",
description: "",
options: [...commonOptions, ...logConfigOptions],
subcommands: [
{
name: "install",
description: "Install an nbextension",
args: {
name: "extension",
},
},
{
name: "uninstall",
description: "Uninstall an nbextension",
args: {
name: "extension",
},
},
{
name: "enable",
description: "Enable an nbextension",
args: {
name: "extension",
},
},
{
name: "disable",
description: "Disable an nbextension",
args: {
name: "extension",
},
},
{
name: "list",
description: "List nbextensions",
},
],
},
{
name: "notebook",
description: "Run the Jupyter notebook server",
subcommands: [
{
name: "list",
description: "List currently running notebook servers",
},
{
name: "stop",
description: "Stop currently running notebook server",
},
{
name: "password",
description: "Set a password for the notebook server",
},
],
options: [...commonOptions, ...logConfigOptions],
},
{
name: "run",
description: "Run a notebook",
options: [...commonOptions, ...logConfigOptions],
},
{
name: "serverextension",
description: "Manage server extensions",
options: [...commonOptions, ...logConfigOptions],
},
{
name: "troubleshoot",
description: "Log for troubleshooting",
},
{
name: "trust",
description: "Manage trust",
options: [...commonOptions, ...logConfigOptions],
},
],
options: [
{
name: ["--help", "-h"],
description: "Show help for jupyter",
},
{
name: "--version",
description: "Show the jupyter command's version and exit",
},
{
name: "--config-dir",
description: "Show Jupyter config dir",
},
{
name: "--data-dir",
description: "Show Jupyter data dir",
},
{
name: "--runtime-dir",
description: "Show Jupyter runtime dir",
},
{
name: "--paths",
description:
"Show all Jupyter paths. Add --json for machine-readable format",
},
{
name: "--json",
description: "Output paths as machine-readable json",
},
{
name: "--debug",
description: "Output debug information about paths",
},
],
};
export default completionSpec;