# Repository Briefing: langchain-ai/langsmith-cli
> Source: https://repoforai.com/repo/langchain-ai/langsmith-cli (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/langchain-ai/langsmith-cli
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (90/100 · Maintenance 35/35 · Adoption 15/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.6.0 (2026-12-01) — https://github.com/langchain-ai/langsmith-cli/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: CLI, API
- **Momentum**: 81 ★ total (+0 24h / +0 7d) · 23 forks
- **When to Use**: Best for: Teams already using LangSmith that want developers or coding agents to turn production trace failures into reproducible evaluation cases and compare candidate fixes from the terminal. Skip if: You need a vendor-neutral tracing backend, an offline evaluation store, or application-level control better served by a direct API integration.

## Overview
```text
### Architecture & Core Mechanics
LangSmith CLI is a local Go client for the LangSmith API, not a tracing backend or an MCP-only service. The Go 1.26.7 module directly depends on `github.com/langchain-ai/langsmith-go`; the repository has a `cmd/` tree and GoReleaser configuration. The PyPI distribution ships the same platform binary as the other install methods rather than a Python implementation. Coding agents can invoke commands directly, while `langsmith setup` adds LangSmith skills and MCP integration.

The CLI discovers deployment capabilities through `/info`. Cloud and self-hosted servers at 0.16 or later use the v2 SmithDB query path; older self-hosted versions use v1. On v2, trace selection uses `/v2/traces/query`, while reading the runs for an individual trace uses `/v2/traces/{trace_id}/runs` and requires a project. If the caller omits the project, the client first tries to resolve it from the trace's root run in the active workspace.

### Key Capabilities & Differentiators
The CLI turns trace investigation into a repeatable evaluation workflow. It can filter runs by type, include feedback or metadata, and export runs and traces as JSONL. A failing run can become a dataset example, then `experiments run` and `experiments compare` can evaluate a candidate against a baseline. Shared evaluators are separate from the project or dataset rules that bind them with sampling rates and filters; the CLI supports uploading an evaluator or configuring an LLM scorer with prompt, schema, model, and variable mappings.

Interactive output uses tables and trees. Automation can request JSON explicitly or use built-in `--jq` filtering without a separate jq binary. Result data stays on stdout; workspace, truncation, and default time-window notices go to stderr. The experimental `gateway wrap` starts a loopback proxy for a child command, routes Anthropic and OpenAI API requests through LangSmith Gateway, and refreshes OAuth access tokens when needed.

### Trade-offs & Limitations
Compared with the LangSmith UI, the CLI is better suited to repeatable, versioned workflows that connect trace investigation to regression evaluation. Compared with direct API calls, it saves code for authentication, output shaping, and query-version selection. An SDK or direct API integration gives an application more control over request scope and error handling. The MIT license applies to the client; the CLI does not replace the LangSmith backend or provide an offline store for traces and evaluations.

Scripts should set `--format json` explicitly and opt into `LANGSMITH_EXIT_CODES=detailed` if they need distinct error codes before 1.0.0. A projectless trace lookup defaults to seven days, skips unreadable projects, and is capped at 1,000 projects and 1,000 experiments; pass the project when the lookup misses or needs a predictable scope. Trace and thread message commands are unavailable on self-hosted versions older than 0.16. Full exports can carry sensitive application data, so review output destinations and retention before automating them.

### Hardware & Deployment Guide
Install a platform binary from GitHub Releases or use Homebrew, Scoop, or the `langchain-langsmith-cli` PyPI package. The package named `langsmith-cli` on PyPI is unrelated. The client needs no Python runtime or GPU. For regular operations, it needs network access to LangSmith Cloud or a self-hosted endpoint and credentials via `LANGSMITH_API_KEY` or OAuth. Profiles can scope the endpoint, workspace, and project. Password-hash generation for self-hosted recovery is offline; it does not configure the server.

The supplied release history points to two upgrade checks. v0.5.0 added OS keychain support and required explicit permissions for sandbox access delegation. Keychain profiles suit API keys, not `auth login`; if no keychain is available, the CLI warns and leaves the key in the config file. v0.6.0 adds `--wait` and `--timeout` to sandbox create and start, so test readiness assumptions in provisioning scripts before upgrading.
```

## Key Capabilities
```text
- Query compatibility: `/info` selects v2 SmithDB queries for Cloud and self-hosted 0.16+, and v1 for older self-hosted servers.
- Trace lookup: A projectless lookup searches the current workspace within a default seven-day window, bounded to 1,000 projects and 1,000 experiments.
- Script output: `--json` or `--jq` produces structured results; truncation and default time-window notices are emitted separately on stderr.
- Regression workflow: Turn a failing run into a dataset example, run a named experiment, and compare it with a baseline from the terminal.
- Evaluator management: Shared scorers are distinct from the rules that attach them to projects or datasets with sampling and filters.
- Credential storage: API-key profiles support environment or command references and optional OS keychains, with a warned file fallback if the keychain is unavailable.
```

## Quick Start / Clone
```bash
curl -fsSL https://cli.langsmith.com/install.sh | sh
```
