Add lite-command to run Lab/Lite commands from the terminal #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is experimental code to support the running of JupyterLab/JupyterLite commands from the terminal. Here is a demonstration; note there is a lot of tab completion which is key to this being a good user experience:
lite-command.mp4
It is the first example of a
cockle
"ExternalCommand" (a TypeScript command running in the main UI thread) that uses the cockleArgument
classes to give semi-automatic tab completion. The API for this has been changing a lot and I am not sure it is a particularly good API yet, and if/when this is merged it will bake-in the API incockle
.This needs
jupyterlite 0.7.0
so initially using the0.7.0a7
pre-release.The command name is called
lite-command
. I am experimenting with similar commands for accessing JupyterLite settings (lite-setting
) and kernels (lite-kernel
). I think it is sensible to keep them as separate commands registered in their own plugins so that they can be individually disabled. I think it is probably good to have them part of theterminal
repo rather than in their own repo, but I could be persuaded otherwise. I am also not 100% sure about the command names yet.Handling of non-string command arguments is not supported yet, and there will need to be some sanitisation of path names as you can
filebrowser:open-path path months.txt
but not./months.txt
.cc @bollwyvl who first suggested this idea.