CLI¶
Manage data with LaminDB instances.
Manage connections¶
connect¶
Configure default instance for connections.
Python/R sessions and CLI commands will then auto-connect to the configured instance.
Pass a slug (account/name
) or URL (https://lamin.ai/account/name
).
See also: Connect in a Python session via connect()
.
Usage:
lamin connect [OPTIONS] INSTANCE
Options:
--use_proxy_db Use proxy database connection.
--help Show this message and exit.
info¶
Show info about the environment, instance, branch, space, and user.
See also: Print the instance settings in a Python session via settings()
.
Usage:
lamin info [OPTIONS]
Options:
--schema View database schema.
--help Show this message and exit.
init¶
Init a LaminDB instance.
See also: Init in a Python session via init()
.
Usage:
lamin init [OPTIONS]
Options:
--storage TEXT A local or remote folder (`'s3://...'` or `'gs://...'`).
Defaults to current working directory.
--name TEXT Instance name. If not passed, it will equal the folder name
passed to `storage`.
--db TEXT Database connection URL. Defaults to `None`, which implies
an SQLite file in the storage location.
--modules TEXT Comma-separated string of schema modules.
--help Show this message and exit.
disconnect¶
Clear default instance configuration.
See also: Disconnect in a Python session via disconnect()
.
Usage:
lamin disconnect [OPTIONS]
Options:
--help Show this message and exit.
Load, save, create & delete data¶
load¶
Load a file or folder into the cache or working directory.
Pass a URL, artifact
, or transform
. For example:
lamin load https://lamin.ai/account/instance/artifact/e2G7k9EVul4JbfsE
lamin load artifact --key mydatasets/mytable.parquet
lamin load artifact --uid e2G7k9EVul4JbfsE
lamin load transform --key analysis.ipynb
lamin load transform --uid Vul4JbfsEYAy5
lamin load transform --uid Vul4JbfsEYAy5 --with-env
Usage:
lamin load [OPTIONS] ENTITY
Options:
--uid TEXT The uid for the entity.
--key TEXT The key for the entity.
--with-env Also return the environment for a tranform.
--help Show this message and exit.
save¶
Save a file or folder.
Example: Given a valid project name “my_project”,
lamin save my_table.csv --key my_tables/my_table.csv --project my_project
By passing a --project
identifier, the artifact will be labeled with the corresponding project.
If you pass a --space
or --branch
identifier, you save the artifact in the corresponding Space
or on the corresponding Branch
.
Note: Defaults to saving .py
, .ipynb
, .R
, .Rmd
, and .qmd
as Transform
and
other file types and folders as Artifact
. You can enforce saving a file as
an Artifact
by passing --registry artifact
.
Usage:
lamin save [OPTIONS] PATH
Options:
--key TEXT The key of the artifact or transform.
--description TEXT A description of the artifact or transform.
--stem-uid TEXT The stem uid of the artifact or transform.
--project TEXT A valid project name or uid.
--space TEXT A valid space name or uid.
--branch TEXT A valid branch name or uid.
--registry TEXT Either 'artifact' or 'transform'. If not passed, chooses
based on path suffix.
--help Show this message and exit.
create¶
Create a record for an entity.
Currently only supports creating branches and projects.
lamin create branch --name my_branch
lamin create project --name my_project
Usage:
lamin create [OPTIONS] ENTITY
Options:
--name TEXT A name.
--help Show this message and exit.
delete¶
Delete an entity.
Currently supported: branch
, artifact
, transform
, collection
, and instance
. For example:
lamin delete https://lamin.ai/account/instance/artifact/e2G7k9EVul4JbfsEYAy5
lamin delete branch --name my_branch
lamin delete instance --slug account/name
Usage:
lamin delete [OPTIONS] ENTITY
Options:
--name TEXT
--uid TEXT
--slug TEXT
--force Do not ask for confirmation (only relevant for instance).
--help Show this message and exit.
Describe, annotate & list data¶
describe¶
Describe an artifact.
Examples:
lamin describe --key example_datasets/mini_immuno/dataset1.h5ad
lamin describe https://lamin.ai/laminlabs/lamin-site-assets/artifact/6sofuDVvTANB0f48
See also: Describe an artifact in a Python session via describe()
.
Usage:
lamin describe [OPTIONS] [ENTITY]
Options:
--uid TEXT The uid for the entity.
--key TEXT The key for the entity.
--help Show this message and exit.
annotate¶
Annotate an artifact or transform.
Entity is either ‘artifact’ or ‘transform’. If not passed, chooses based on key suffix.
You can annotate with projects and valid features & values. For example,
lamin annotate --key raw/sample.fastq --project "My Project"
lamin annotate --key raw/sample.fastq --features perturbation=IFNG,DMSO cell_line=HEK297
lamin annotate --key my-notebook.ipynb --project "My Project"
Usage:
lamin annotate [OPTIONS] [ENTITY]
Options:
--key TEXT The key of an artifact or transform.
--uid TEXT The uid of an artifact or transform.
--project TEXT A valid project name or uid.
--features TEXT Feature annotations. Supports: feature=value,
feature=val1,val2, or feature="val1","val2"
--help Show this message and exit.
list¶
List records for an entity.
lamin list branch
lamin list space
Usage:
lamin list [OPTIONS] ENTITY
Options:
--name TEXT A name.
--help Show this message and exit.
Configure¶
switch¶
Switch between branches or spaces.
lamin switch --branch my_branch
lamin switch --space our_space
Usage:
lamin switch [OPTIONS]
Options:
--branch TEXT A valid branch name or uid.
--space TEXT A valid branch name or uid.
--help Show this message and exit.
cache¶
Manage cache.
Usage:
lamin cache [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
clear Clear the cache directory.
get Get the cache directory.
set Set the cache directory.
settings¶
Manage settings.
Call without subcommands and options to show settings:
lamin settings
Allows to get and set these settings:
work-dir
→work_dir
private-django-api
→private_django_api
branch
→ current branch (uselamin switch --branch
to change)space
→ current space (uselamin switch --space
to change)
Examples for getting a setting:
lamin settings get work-dir
lamin settings get branch
Examples for setting the working directory:
lamin settings set work-dir . # set work-dir to current directory
lamin settings set work-dir ~/my-project # set work-dir to ~/my-project
lamin settings set work-dir none # unset work-dir
Usage:
lamin settings [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
get Get a setting.
set Set a setting.
migrate¶
Manage database schema migrations.
Usage:
lamin migrate [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
create Create a new migration.
deploy Deploy migrations.
squash Squash migrations.
Auth¶
login¶
Log into LaminHub.
lamin login
prompts for your API key unless you set it via environment variable LAMIN_API_KEY
.
You can create your API key in your account settings on LaminHub (top right corner).
After authenticating once, you can re-authenticate and switch between accounts via lamin login myhandle
.
See also: Login in a Python session via login()
.
Usage:
lamin login [OPTIONS] [USER]
Options:
--help Show this message and exit.
logout¶
Log out of LaminHub.
Usage:
lamin logout [OPTIONS]
Options:
--help Show this message and exit.
Other¶
lamin get¶
Query metadata about an entity.
Currently equivalent to lamin describe
.
Usage: lamin get [OPTIONS] [ENTITY]
Options:
--uid TEXT The uid for the entity.
--key TEXT The key for the entity.
--help Show this message and exit.
lamin run¶
Run a compute job in the cloud.
This is an EXPERIMENTAL feature that enables to run a script on Modal.
Example: Given a valid project name “my_project”,
lamin run my_script.py --project my_project
Usage: lamin run [OPTIONS] FILEPATH
Options:
--project TEXT A valid project name or uid. When running on Modal,
creates an app with the same name. [required]
--image-url TEXT A URL to the base docker image to use.
--packages TEXT A comma-separated list of additional packages to install.
--cpu FLOAT Configuration for the CPU.
--gpu TEXT The type of GPU to use (only compatible with cuda images).
--help Show this message and exit.