Skip to main content
The LangSmith CLI is a fast, agent-friendly command-line tool for working with your LangSmith data and workflows directly from the terminal. It’s designed for both humans and AI coding agents to list, filter, retrieve, and export data—with predictable JSON output by default and a pretty table mode for humans.
Built for agents and scripts: defaults to JSON, supports clean stdout/stderr separation, and offers --yes flags for non-interactive use.

Installation

Use one of the follow methods for installation:

Authentication

Set your API key as an environment variable:
Optional defaults:
Or pass them as flags when running commands:

Quickstart

The following commands cover the core resource types—projects, traces, runs, datasets, experiments, and threads:

Output formats

  • Default: JSON to stdout for easy piping and scripting
  • Pretty tables: --format pretty for human-readable tables and trees
  • Write to file: -o <path>

Commands overview

The CLI groups functionality by resource. Each command supports filters like --limit, --last-n-minutes, and more.

project—list tracing projects

trace—query and export traces

run—query individual runs

thread—query conversation threads

dataset—manage evaluation datasets

evaluator—manage evaluators

experiment—results and summaries