All docs
Docs/ API Reference/ CLI commands
API Reference

CLI commands

Practical CLI workflows for package authoring, project runs, tool commands, runtime introspection and source backend profiles.

The lsd command comes from lsd-cli, separately from lsdtools. A source checkout can use python -m lsd_cli; an installed runtime contains its own LSDCli.exe. Use lsd --help and each subcommand's --help for the parser accepted by that runtime.

This is a human-authored workflow guide. The SDK reference is generated from the bounded source artifact; command help and runtime introspection serve different purposes.

Usage#

powershell
lsd package new mypkg
lsd package lint mypkg
lsd api describe --json
lsd run project.lsd --json

Project commands operate on an existing .lsd file; create it in Hub/Desktop first. Opening a document through the CLI does not grant permission to run neighboring project scripts.

Where to start#

Package commands#

lsd package new#

Scaffold a manifest-backed Local package. The command prints the code module's tool.py path. An optional workspace directory is only an authoring convenience:

powershell
lsd package workspace new C:\work\local-packages
lsd package new mypkg --output-dir C:\work\local-packages

workspace new requires a new or empty directory and writes no marker. --output-dir may also be an existing real source directory.

lsd package lint#

Check imports against the supported SDK boundary, including lsdtools.extend:

powershell
lsd package lint C:\work\local-packages\mypkg

The default target is the current directory. This import check does not replace manifest validation, executing examples or package tests.

In a source-development runtime, link a manifest-valid Local source by reference, or copy an exact Local fixture for testing:

powershell
lsd package link C:\work\local-packages\mypkg
lsd package list
lsd package info mypkg
# Alternative fixture workflow, in an isolated test environment:
lsd package snapshot C:\work\local-packages\mypkg

These commands create Local records only. They are not packaged-runtime installation channels and cannot acquire Core, Store or URL content or remove coordinates. Activate a linked package in Desktop Settings → Project Packages. Restart the Desktop process after source edits; off/on activation and same-process project reopen do not reload its module.

Preparing a Store submission#

lsd package prepare <directory> --out <file.lsdpackage> validates an eligible distributable source and writes a private submission artifact. Local manifests are not eligible. Configure the independent free/paid publisher lane and follow Publish a package; upload is a signed-in Creator Studio action. The filename alone does not authorize installation.

Native Hub owns installation, update, downgrade and removal. Public lsd market commands can browse the catalog or acquire account access, but do not install package bytes. The runtime's Hub worker is an internal protocol, not a public CLI installation command.

Tool commands#

lsd <tool> <cmd>#

Run a command declared with @tool.command. Typed parameters become CLI options when the package is available in the command's supported discovery context:

bash
# @tool.command("count") def count(ctx, path: str): ...
lsd mypkg count --path data.csv

See A CLI command for a complete example.

API introspection#

lsd api describe#

Print runtime API descriptions as text by default. Select JSON explicitly:

powershell
lsd api describe
lsd api describe --json > api.json

lsd api context#

Print an editor-oriented Markdown cheat sheet, optionally writing a file:

powershell
lsd api context --out LSD_CONTEXT.md

These commands import runtime description machinery and can reflect available registrations or optional agent skills. They do not inventory every declared facade export, resolve every alias or produce the complete deterministic SDK artifact. Use the generated reference for those source facts and its distinct provenance versions.

Profiles#

For a source runtime, LSD_PROFILE selects a named backend. Inspect or change the saved source default with:

powershell
lsd profile list
lsd profile show
lsd profile use local

The built-ins are prod (https://lsd.tools) and local (http://127.0.0.1:8080). The environment selection wins over the saved default in ~/.lsd/profiles.json; an explicit source URL override can take precedence over the profile URL. profile show reports the effective backend. Profiles do not carry a default package set.

Installed runtimes resolve only their authenticated server target and refuse profile changes. Changing LSD_PROFILE does not switch that target or choose another Desktop version. Runtime selection belongs to Hub and the project's exact pin; find_runtime and Runtime are retired SDK helpers. Backend profiles also differ from execution profiling via lsd run --profile.

LearnDevelop a package

APIdescribe_api · Runtime migration note · PackageManager

ExamplesA CLI command

By LSD Team · Last updated Sep 09, 2026 Ask a question View as Markdown
Type to search every doc, guide, and tutorial.
↑↓ navigate openesc close