Skip to main content

CLI

CLI

The easiest way to use the SheetXL CLI is by running it directly without a permanent installation. All you need is Node.js (v22+) installed (v24 recommended),

Open your terminal and run:

npx sheetxl

(If you use pnpm, you can use dlx sheetxl)

This will start an interactive REPL (Read-Eval-Print Loop), pre-loaded with the SheetXL SDK.

SheetXL >
tip

Type help in CLI for a list of commands.

Usage

The CLI can be used in three main ways: as an interactive REPL, for executing scripts files, or for running direct commands.

Interactive REPL

Running the CLI with no arguments starts the interactive session. This is a powerful JavaScript environment for prototyping, running calculations, or managing your workbooks programmatically.

npx sheetxl

Inside the REPL, you have access to the @sheetxl/sdk and @sheetxl/io packages and special commands:

  • help: Displays help message.
  • .help: Shows all available dot commands.

Accessing the SDK API

You can access the sdk directly

Create a new Workbook and save with a single value.

New Workbook
wb = new Workbook();
wb.getRange('a1').setValues([[1]]);
saveWorkbook('myWorkbook.xlsx', wb);
API Reference

See our full SDK API Documentation for a complete list of all available classes and methods.

Executing Scripts

For automation and more complex tasks, you can pass a local JavaScript file to the CLI for execution. The script will run within the SheetXL environment, with the SDK available.

npx sheetxl path/to/your/script.js

Direct Commands

You can also run specific built-in commands directly. This is useful for one-off tasks.

Activate Your License

To activate your license key, run the activate command:

npx sheetxl activate YOUR_LICENSE_KEY_HERE

This will store your license key for future use.