Blog

Clusy has a terminal now

Install a package, check a dataset, follow a training log, or see the agent's shell commands without leaving your notebook.

Product3 min read

You can now open a terminal in Clusy with Ctrl + ` or the Terminal button above your notebook. It runs in your project's sandbox, alongside your cells and the agent.

Sometimes it's quicker to run a command yourself. You want to check what's in a file, install a library you know you need, or see whether a job is still making progress. Here's where the terminal comes in handy.

Install a package and keep working

If you're halfway through an analysis and need another Python package, install it in the terminal. It uses the same Python environment as the notebook, so the package is available to your cells.

Say you've finished an analysis and want to send someone an Excel file. In this recording, the orders are already loaded in a pandas DataFrame. We install xlsxwriter in the terminal, then use it to save orders.xlsx from the next cell.

Installing xlsxwriter in Clusy's terminal, then exporting the notebook's existing orders DataFrame to an Excel file.
Install an Excel writer and export the data already in memory. Recorded with sample orders; idle time trimmed.

This also works for analysis libraries such as xgboost or openpyxl. If you're upgrading a package you've already imported, you may still need to restart the kernel.

Check a dataset before loading it

A quick look at a file can save you a failed import. Use ls -lh to check its size and head to inspect the header and first few rows. For example, with a file called data/train.csv:

ls -lh data/train.csv
head -n 5 data/train.csv

In this recording, the sample CSV uses semicolons. After checking the first few rows, we load it with pandas using sep=";". The terminal and notebook share the same files, so there's nothing to upload again.

Inspecting data/train.csv in Clusy's terminal, then loading its semicolon-separated columns into a pandas table in the notebook.
Check the delimiter in the terminal, then load the same file in the notebook. Recorded with sample data.

The agent also gets a short summary of your recent terminal commands and output. If you ask it to work with the file you just inspected, it has that context and can look up more terminal history when it needs to.

See what the agent runs

When the agent uses the shell, its commands and output appear in the terminal's Agent tab. Here, we ask it to inspect a CSV and count the rows. You can see the commands it chose, read the output, and check whether each command finished successfully.

Watching the agent run head and wc in Clusy's Agent terminal tab, then bringing its head command into a personal terminal and running it.
Follow the agent's dataset checks, then try a command yourself. Recorded with sample data; idle time trimmed.

Want to check something yourself? Run in my terminal puts the command at your prompt. Press Enter when you're ready to run it. You can also copy the output or jump back to the conversation for context.

Check on a run without interrupting it

The terminal runs independently of the notebook kernel. While a cell is busy, you can inspect the files it's producing or watch a log from the terminal.

If your training script writes to training.log, for example:

tail -f training.log

You'll see new log lines as they're written. Press Ctrl + C in the terminal to stop following the log; the notebook cell keeps running. In the recording below, a second look at the log shows the training has moved on to later epochs.

Following a notebook's training log in Clusy's terminal, pressing Ctrl+C to stop following it, then checking newer log entries while the notebook continues training.
Stop following the log while training carries on. This small regression run uses generated data, with pauses between epochs to make the progress readable.

On a GPU sandbox, nvidia-smi is also useful for checking GPU memory use while a job runs.

You can keep several terminal tabs open and resize the dock by dragging its top edge. Ctrl + Shift + ` opens another shell; Ctrl + ` shows or hides the dock.

A few things to know

Files under /home/user are saved with your workspace, and Python packages installed with pip are restored with the project. A page reload can reconnect to an existing shell while it's still running. A sandbox pause or restart can end the shell process, so don't rely on an open terminal tab to keep a long job alive.

For system packages, use sudo clusy-apt install <package>. These need to be reinstalled if the sandbox is recreated. General sudo access isn't available.

Open a notebook and try the terminal.