--format pretty option for human-readable tables. Use it when you need scriptable access to your LangSmith data, such as bulk exports, automation, or giving a coding agent direct access to your traces, runs, and datasets.
Install
--dry-run flag to preview the update without installing.
Querying a SmithDB-backed deployment requires LangSmith CLI
v0.2.44 or later.Authenticate
langsmith auth login requires LangSmith CLI v0.2.30 or later. langsmith profile commands require LangSmith CLI v0.2.26 or later.
The recommended local setup is to authenticate with OAuth:
langsmith auth login also works against self-hosted instances from LangSmith CLI v0.2.46 and newer, provided the deployment is on LangSmith 0.16 or later with the OAuth authorization server enabled (requires a signing JWKS to be configured). See Self-hosted instances. On earlier deployments, or without a signing JWKS, authenticate with an API key or create an API-key profile.~/.langsmith/config.json under the selected profile. Select a profile with --profile or LANGSMITH_PROFILE:
--no-browser and open the printed URL manually:
Self-hosted instances
Point the CLI at your instance with--api-url, or with LANGSMITH_ENDPOINT. Both the browser-based login and API keys are supported.
- OAuth
- API key
Requires LangSmith CLI Pass your instance’s base URL. The CLI reads the deployment’s authorization server metadata to find the OAuth endpoints, so
v0.2.46 or later and a deployment on LangSmith 0.16 or later, with the OAuth authorization server enabled. The chart exposes the OAuth authorization server under /api, but those endpoints stay inert until you configure a signing JWKS. For setup steps, see Enabling Remote MCP.The OAuth authorization server is enabled automatically when config.hostname is set in your Helm chart and a signing JWKS is configured (via config.signingJwks, or the key langsmith_signing_jwks in config.existingSecretName). Without the signing JWKS, the OAuth endpoints are inactive and the CLI will receive a 404 — use the API key tab instead.https://langsmith.example.com and https://langsmith.example.com/api both work.Tokens are stored under the named profile, so later commands only need --profile:Quickstart
The following commands cover the core resource types:Output formats
Default JSON to stdout — easy to pipe, script, or feed to an agent:--format pretty for human-readable output:
-o <path>:
Commands
Each command group targets a specific LangSmith resource. Most commands support--limit, --offset, and a shared set of filter flags.
List projects
Returns up to 20 projects by default, sorted by most recent activity. Lists tracing projects only. (Useexperiment list to list evaluation experiments.)
Query traces
Defaults to the last 7 days, newest first. Use--since or --last-n-minutes to change the time window.
Query runs
Defaults to 50 results (most other commands default to 20). The same 7-day time window applies. Use--since or --last-n-minutes to override.
Query threads
--project is required for all thread commands.
Manage datasets
dataset export exports the examples (rows) within a dataset, not the dataset metadata itself.
Manage examples
Use--split to assign examples to named splits (such as test or train) when creating or listing.
Manage evaluators
Evaluators can be offline (run against a dataset during experiments) or online (run against a live project). Use--sampling-rate to evaluate only a fraction of production runs, and --replace to overwrite an existing evaluator by name.
View experiments
experiment list shows evaluation experiments, not tracing projects. (Use project list to list tracing projects.)
Manage sandboxes
Sandbox commands let you build snapshots, create sandboxes, execute commands, open interactive consoles, and tunnel TCP ports to services running inside sandboxes. See Sandbox CLI for the full sandbox command reference.Call the LangSmith API directly
Theapi command is an authenticated, scriptable wrapper around the raw LangSmith REST API — useful for endpoints the typed commands above don’t cover, or for piping JSON into and out of shell scripts. It’s modeled after gh api and curl: pass the path as the only positional argument, and use -X to set the HTTP method (defaults to GET). Auth headers (x-api-key, x-tenant-id) are injected automatically.
--input and --body are mutually exclusive. Subcommands langsmith api ls and langsmith api info browse and describe endpoints from the cached OpenAPI spec — pass --refresh to re-fetch.
Filter flags
Mosttrace and run commands share these filters:
Detail flags — control which fields are included in the response:
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

