langchain-ai/langsmith-cli
Go CLI for debugging LangSmith traces and automating regression evaluations
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
/info selects v2 SmithDB queries for Cloud and self-hosted 0.16+, and v1 for older self-hosted servers.--json or --jq produces structured results; truncation and default time-window notices are emitted separately on stderr.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.
You need a vendor-neutral tracing backend, an offline evaluation store, or application-level control better served by a direct API integration.
Quick Start & Installation
curl -fsSL https://cli.langsmith.com/install.sh | sh
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| langsmith-cli ★ | 81 | — | Python | MIT | Go CLI for debugging LangSmith traces and automating regression evaluations |
| gemini-cli | 109.6k | +376 | TypeScript | Apache-2.0 | A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools |
| oh-my-pi | 40.5k | +483 | TypeScript | MIT | A Bun/Rust terminal agent for model-flexible coding with LSP and editor integrat |
| goose | 57.3k | +219 | Rust | Apache-2.0 | Rust coding agent with MCP tools and local or hosted models, embeddable via ACP |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/langchain-ai/langsmith-cli.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about langsmith-cli
Should an agent call the CLI directly or use MCP?
langsmith binary directly with --json or --jq for shell and agent workflows. langsmith setup is the documented route for adding LangSmith skills and MCP integration to supported coding agents. The CLI itself talks to the LangSmith API and does not require MCP for ordinary commands.Does the CLI need Python, a GPU, or dedicated VRAM?
experiments run has its own runtime and resource requirements.Does the MIT license cover commercial use and self-hosting?
When is this preferable to the LangSmith UI or direct API calls?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy