WLJS LogoWLJS Notebook

Notebook Tools

WLJS Notebook is fully accessible from the keyboard. One of the most important key combinations to know is Ctrl-P or ⌘-P, which brings up the Command Palette. From here, you have access to many small helper utilities, toolboxes, shortcuts, and AI copilot:

Command Palette

Most of the utilities are notebooks themselves, which are evaluated in an isolated context whenever you click on a command palette item. You can find the information on each by clicking on icon, that will open the source notebook.

User's utilities are stored in ~/Documents/WLJS Notebooks/User palette/

Shortcuts

Type any of those words to call the action:

  • New notebook - create a new notebook (in a new window)
  • New notebook from template - create a new notebook from a template
  • Rename notebook - rename current notebook
  • Debug - attach a debugger
  • Print - export an entire notebook to PDF
Notebooks are heavily cached to avoid excessive writing to disk, therefore avoid renaming an opened notebook outside the WLJS application

Utilities

Every tool is a normal notebook, which is evaluated in the background and manipulates your working notebook, creating temporal cells whenever you call it from the palette.

Insert matrix

Creates a small widget in the cell below the focused one that helps to generate and insert matrices (lists of lists).

Place a cursor to the desired place in the cell and click Insert on the widget.

Special characters

Adds a toolbar to the notebook with special characters and snippets for writing nice-looking integrals, sums, and other constructs.

Select the piece of code and apply operation from the toolbar. Or place a cursor to a cell and insert a symbol/expression from the toolbar.

Format text

Adds a toolbar to the notebook for formatting code (font size, color, background, font face).

The widget automatically detect the cell type (Wolfram, Markdown or HTML) of the selected text and adjust wrapping accordingly

Select the piece of code and apply operation from the toolbar.

Upload ASCII data file

Creates a widget with importing wizard allowing to import CSV/TSV/DAT files, strip headers and insert a file to a cell as an iconized expression

Upload file

Basic widget for uploading files

Escape string

A helper tool to safely insert strings containing double quotes or other "unsafe" sequences. It will prompt a user to enter text and print a cell with the result.

Beautify code

Formats selected code or entire Wolfram input cell and attempts to apply syntax sugar if possible. If it fails, try Format code instead.

Select the code or place a cursor in the desired cell and call this tool from the command palette.

Format code

Formats selected code or entire Wolfram input cell. Action is the same as the previous one, but syntactic sugar is not applied.

Find in cells

Creates a floating search window and tries to find given expression in all visible cells of the notebook.

You can still use a standard search box locally in the individial cells with Ctrl/⌘-F

Show options

Attempts to discover the possible options of the given symbol in the cell and present them as an interactive table.

Start typing:

Plot[x, {x,0} 

and then call this widget. It will automatically find the unclosed bracket and fetch the head Plot. Click on the desired options in the table to insert them later, once you click on the green mark icon.

Notebook directory

Opens a notebook directory using OS's explorer.

This will only work with WLJS desktop application

Inline navigation helper (Slider)

A helper tool that creates a syntactic sugar inline widget on a selected number. It is used in 2D and 3D graphics or any other expression that supports Offload aka live-updates:

For example: select a number you want to manipulate and call this tool. It will create an inline widget with a slider. Evaluate your cell, manipulate the slider, and once you are satisfied, click on the mark icon.

Check the reference for primitives, that support live updates with Offload

Inline navigation helper (Drag)

A helper tool that creates a syntactic sugar inline widget on a selected pair {x,y} or triplet of numbers {x,y,z}. It is used in 2D and 3D graphics that support Offload aka live-updates:

For example: select a parameter's initial value you want to manipulate and call this tool. It will create an inline widget with a display and place a dragging gizmo on your 2D or 3D canvas. Evaluate your cell, drag the red dot (or 3D sphere), and once you are satisfied, click on the mark icon.

If your dragging point overlaps with an object, offset the coordinates before applying this tool:

Text["Hello World", Offload[{-0.3,-0.3} + (*BB[*)({0,0})(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRAeB5AILqnMSXXKr0hjgskHleakFnMBGU6JydnpRfmleSlpzDDlQe5Ozvk5+UVFDGDwwR6dwcAAAAHdFiw="*)(*]BB*)]]

Apply dragging tool on highlighted list. Why we used Offload - check this guide.

Inline navigation helper (Joystick)

A helper tool that creates a syntactic sugar inline widget on a selected pair {x,y}. It is used in 2D and any other expression that supports Offload aka live-updates and accepts a pair of numbers:

For example: select a parameter's initial value you want to manipulate and call this tool. It will create an inline widget with a joystick. Evaluate your cell, manipulate the joystick, and once you are satisfied, click on the mark icon.

Take a picture

Creates a widget, which uses any available video recording device to take a picture and place it as Image to a notebook's cell.

Record voice

Creates a widget which uses any available audio recording device to record live audio and place it to a cell as Audio object.

Crop image

Select an image or image-producing expression in your cell and call this tool. It will evaluate the selected expression and append an interactive widget allowing to do rectangular cropping.

Copy InputForm

Select the code in the cell and call this tool. It will strip all syntactic sugar from it and copy the pure InputForm of the expression to your clipboard.

Debugger

Debugger can be called from the top Misc menu or from the command palette. It is a tool that attaches to a notebook and a working kernel to intercept the evaluation process and monitor symbol changes.

What it can do:

  • Interrupt cell evaluation and possibly inspect the intermediate results
  • Track changes in symbols values
  • Break on assertions or symbol changes
  • See low-level system log

What it cannot do:

  • Profile and trace evaluation
  • Step in / step out

Let's have a look at the interface:

Command Palette

Inspect is a central mode for debugging.

Inspecting Mode

It stops the current execution and allows you to interact with any other cells in the sub-session, enabling you to check the status of various symbols. You can write and evaluate other cells in Inspect mode.

For example, evaluate this one:

Do[k = i; Pause[1], {i, 100}];

Then switch to Inspect mode; it will pause the evaluation. Now, you can check the state of the k symbol by running a new cell with:

k

You can always continue execution from this mode by clicking Continue until the next possible break. All transitions take time and depend on the current kernel occupancy.

Watching Symbols

You can add a symbol to a tracking list to monitor its OwnValue in real-time automatically. It won't interrupt your execution unless you enable the checkbox for that option.

Live updates are supported only for assignments, i.e., when symbol = *newValue*. If you mutate a part of a List, it won't trigger an update.

Breakpoints

In Wolfram Language, traditional breakpoints are difficult to implement since there is no source code file in the classical sense. Everything is an expression, and a breakpoint must be an expression as well.

There are two sources for breaking events, both of which immediately switch the kernel to Inspecting Mode.

Asserts

First, enable breaking on assertions from the dropdown menu in the top bar of the debugger. Then, whenever execution encounters False in an Assert, it will break.

For example:

Do[k = i; If[i > 6, Assert[False, "Hey"]]; Pause[1], {i, 100}];

This code will break automatically after 6 seconds. In Inspect mode, evaluating k will return 7.

If you track the k symbol at the same time, you will see it changing in the debugger window.

Symbols

When a symbol is assigned a new value, it generates an event in the debugger. Use the Break on checkbox to enable breaking.

For example:

Do[k = i; If[i > 6, test = Now]; Pause[1], {i, 100}];

This code will break after 6 iterations.

AI Copilot

If nothing is selected, text typed into the command palette is sent to a remote or local LLM, which has read/write access to the whole notebook. We use a "knowledge on demand" concept, meaning that additional notebook-specific information (like cell types) is only fetched when needed — saving tokens if your request is unrelated.

Given tools are somewhat similar to VSCode Copilot:

  • Create and evaluate cells (any types)
  • Read/Edit cells by lines
  • Operate in batches
  • See a notebook structure
  • See selection lines and focused cell
  • Access the knowledge library
  • Read symbols truncated documentation
  • Manage internal TODO list
  • Evaluate any WL expresson in the background


Tips

  • Mention focused cell in the prompt to avoid model to spend tokens for searching the whole notebook.

  • Mention consult docs in the prompt for weaker models to force them checking the documentation on different cell types or features of interactive evaluation in Wolfram language cells.

  • In general most LLMs perform much worse in Wolfram Language coding compared to other languages. Try to formulate your task better.

  • Use smaller models for grammar corrections, primitive tasks, i.e. Haiku 3.0 for example

Examples

Here are two notebooks for the comparison: original one with arbitrary data inside and processed by AI copilot (Anthropic Opus 4.6 model). The initial prompt:

Read carefully all cells. Improve description (add or edit markdown cells). Add a nice header to this notebook

Endpoints, Models, and Local LLMs

There are 3 different models provided available:

  • OpenAI (Anything higher than gpt-4o is recommended for complex tasks)
  • Anthropic (Haiku 4.5, Opus 4.1 or higher are recommended for complex tasks)
  • Custom model provider (your local LLM for example)
We recommend Anthropic models for coding in WL from our experience

You will be prompted automatically for the model to pick (except for a custom provider) and API key if applicable. Model-autodiscovery feature is present.

There is a dedicated section in the settings menu of WLJS Notebook to setup your local/custom model and reset existing API keys:

Settings
Command palette
AI Assistant

You can configure the following for Custom Model:

  • Endpoint: By default, WLJS Notebook sends requests to the address: <endpoint>/v1/chat/completions
  • Model
  • Max tokens
  • Temperature

Local LLM

We recommend using the Ollama server to take advantage of locally running models. For example, the following parameters can be set initially:

  • Endpoint: http://localhost:11434/ — the default Ollama server
  • Model: qwen3:8b, a small 5 GB tested model

With local LLMs, the performance and quality of the AI assistant may depend on many parameters. In general, the waiting time increases significantly compared to the commertical ones.

Note on cell types

The assistant is aware of being in a notebook environment. The following cell types are well-described in the initial system prompt:

  • Wolfram
  • JavaScript
  • HTML
  • Slides
  • Mermaid diagrams

Additionally, differences between Wolfram Mathematica and WLJS Notebook are included to the library (on-demand).

Printing option

Locate Print from the File menu or from the command palette to print an entire notebook as PDF.

This feature requires WLJS desktop application and will not work from a web-browser

Page breaks

Use Markdown cell with PageBreakAbove or PageBreakBelow symbols to force page breaks, i.e.:

.md

<PageBreakAbove/>

Installing Packages

How to install new packages locally?

Via Command Palette

Open your notebook and paste the GitHub link to a repo+ or URL to .paclet file to the command palette located on the top bar.

+ It must contain a PacletInfo.wl file in the root directory of the repository.

Via LPM

Create a new cell and insert:

LPMRepositories[{
    "Github" -> "https://github.com/user/MyLibrary"
}]

<<MyLibrary`

or using direct link to a paclet file

LPMRepositories[{
    "Github" -> "https://publicURL/MyLibrary.paclet"
}]

<<MyLibrary`

This will create a local folder named wl_packages, where installed packages will be stored.

Global Installation (Classic)

Via Paclets

If the package is hosted on the Wolfram repository, then you can simply run:

PacletInstall["Username/Paclet"]

<<PacletContextName`

Or from a local paclet file:

PacletInstall["path_to_it.paclet"]

<<PacletContextName`

Namespaces

If you have conflicting symbol names or want to scope loaded package into an alias context:

Needs["PacletContextName`"->"myAlias`"]

Cli

WLJS Notebook app registers (if you allowed this during the installation) a tiny CLI-tool globally in your operating system.

Here is a list of commands you can use

Open current folder

wljs .

Open a file by path

wljs "full path..."

Execute a command

wljs -c [command] [args...]

This pattern sends a command to all extensions used by WLJS Notebook. The list of known commands follows

share

It allows to share notebooks programmatically in different forms

Export notebook to HTML

wljs -c share -i "path to wln notebook" -o "path to output file" -t html

Export notebook to HTML using the same path

wljs -c share -i "path to wln notebook" -t html

List of supported output types:

  • html
  • nb
  • md
  • mdx

Version of CLI

wljs -v

On this page