Skip to main content
The lmnr-cli dataset command manages datasets in Laminar from your terminal: list them, create new ones from local files, and push or pull datapoints. It ships in the standalone lmnr-cli npm package, so you do not need the @lmnr-ai/lmnr SDK installed to use it.
lmnr-cli replaces the dataset commands that used to ship with the @lmnr-ai/lmnr SDK (lmnr datasets ...). The old SDK-bundled CLI is deprecated; use lmnr-cli dataset instead.

Install

The rest of this page assumes a global install (lmnr-cli dataset ...). With npx, prefix each command with npx lmnr-cli@latest.

Usage

Creating a new dataset and iterating on it

1

Prepare input files

Prepare input files for the dataset. Supported formats are: .json, .jsonl, .csv. Every datapoint must at least have a data field. Save this file as data.json (or data.jsonl or data.csv).For JSON, the file must contain one array of datapoints.For JSONL, the file must contain one datapoint per line.For CSV, the file must contain a header row and one datapoint per row.Examples:
2

Authenticate and link your project

The CLI authenticates as you, the signed-in user. Run lmnr-cli setup once in your project: it logs you in (opens a browser to authorize the CLI) and links the current directory to a project by writing .lmnr/project.json. Every dataset command then runs against that linked project.
Alternatively, target a project explicitly with --project-id on any command:
Unlike the old SDK-bundled CLI, lmnr-cli does not use a project API key. See Authenticate and Directory-scoped projects for details.
3

Create a new dataset

Create a new dataset from the input file. This command will create a new dataset with the name my-cli-dataset and save the datapoints to the file my-cli-dataset.json.The datapoints are saved to a new file in order to:
  • Store datasets in the Laminar format. In particular, datapoint id is crucial for versioning (Learn more).
  • Not overwrite existing files.
4

Work on the dataset locally

Make any changes required to the dataset by editing the file my-cli-dataset.json.Make sure to not edit the id field of the datapoints.
If you delete a datapoint, this will not affect the dataset in Laminar. This is because the push operation only pushes new datapoint (versions) to the dataset.
5

Push the changes to Laminar

Push the changes to Laminar.
This will push the changes to the dataset in Laminar.
6

Pull the changes from Laminar

If you need to update the local dataset with the latest changes from Laminar, you can pull the changes.
This will pull the changes from the dataset in Laminar to the local file my-cli-dataset.json.
This will overwrite the contents of the current file my-cli-dataset.json.

Working on an existing dataset

1

Authenticate and link your project

Run lmnr-cli setup once to log in and link the current directory to your project (see above):
2

Select the dataset to work on

List all datasets and select the one you want to work on.
3

Pull the data from Laminar

Pull the data from Laminar to a local file.
This will pull the changes from the dataset in Laminar to the local file my-dataset.json.
If my-dataset.json already exists, this will overwrite the contents of the file.
4

Work on the dataset locally

Make any changes required to the dataset by editing the file my-dataset.json.Make sure to not edit the id field of the datapoints.
If you delete a datapoint, this will not affect the dataset in Laminar. This is because the push operation only pushes new datapoint (versions) to the dataset.
5

Push the changes to Laminar

Push the changes to Laminar.
This will push the changes to the dataset in Laminar.

Setting the CLI to call a local Laminar instance

The dataset command has optional arguments for pointing at a self-hosted instance:
  • --base-url: The base URL of the Laminar instance. Do NOT include port here. Default is https://api.lmnr.ai (or the LMNR_BASE_URL env variable).
  • --port: The HTTP port of the Laminar instance. Default is 443 (or the LMNR_HTTP_PORT env variable). For local self-hosted Laminar, use 8000.
  • --project-id: The id of the project to target. If not provided, resolves from the nearest .lmnr/project.json.
See Self-hosting for the full self-hosted setup.

Reference

General options

These are shared by every dataset subcommand.

Commands

List all datasets

List all datasets.

Create a new dataset

Create a dataset from input files.

Push datapoints to a dataset

Push datapoints to an existing dataset from a file or files.

Pull datapoints from a dataset

Pull datapoints from a dataset to a file or print them to the console.