langsmith-cli

An agent-first CLI: LangSmith projects, traces, runs, datasets and experiments from Claude Code or Cursor.

  • 81 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • The CLI reads traces and workspace data that can hold user prompts and personal data.
  • The key opens every resource of the chosen workspace.
All reasons and checks

langchain-ai/langsmith-cli

Install

Manual install

curl -fsSL https://cli.langsmith.com/install.sh | sh

macOS and Linux. On Windows use `irm https://cli.langsmith.com/install.ps1 | iex`. Read the script before running it.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The CLI reads traces and workspace data that can hold user prompts and personal data.
  • The key opens every resource of the chosen workspace.

This is third-party code. Review the repository files before installing.

What it does

langsmith-cli, an official LangChain tool, gives coding agents fast scriptable access to LangSmith resources. The commands `langsmith projects list`, `traces list`, `traces get <id> --full`, `runs list --run-type llm --include-metadata`, `datasets list` and `experiments list --dataset <name>` show projects, traces, model calls with token counts, datasets and experiments. Authentication uses the `LANGSMITH_API_KEY` variable or profiles: `langsmith auth login` through OAuth, `langsmith profiles create` with a key from an environment variable, a command or the OS keychain. Profiles live in `~/.langsmith/config.json`, written with owner-only permissions. For self-hosted setups set `LANGSMITH_ENDPOINT`.

Who it is for. Developers of LangChain and LangGraph agents who go through LangSmith traces and experiments together with a coding agent.

Good fit when

  • A production agent replied oddly and Claude Code must find the trace and show model calls with tokens.
  • You need to export an evaluation dataset and the experiments list for it.
  • A CI script polls a LangSmith project and parses the output.
  • The API key must live in the keychain rather than in a config file.

Not a fit when

  • You do not use LangSmith.
  • You need a graphical interface: the tool is console-only.
  • The API key must not be given to the agent.

Example request

Show the last five traces of project my-app and the model calls with token counts, then find the most expensive one.

Limitations

You need a LangSmith account and an API key like `lsv2_pt_...`. By default the key in a profile is stored in `~/.langsmith/config.json`, and without a keychain the CLI prints a warning. The `auth login` flow does not yet work with keychain profiles. The Go SDK reads such profiles while the Python, JavaScript and Java SDKs do not. An agent that runs the CLI can reach every resource of the chosen workspace, so scope the key to the workspace you need.

How to disable. Delete the `langsmith` binary, the `~/.langsmith/` directory with profiles and the `LANGSMITH_*` variables from your environment. Revoke the API key in LangSmith.

FAQ

How do I install langsmith-cli?

macOS and Linux: `curl -fsSL https://cli.langsmith.com/install.sh | sh`. Windows: `irm https://cli.langsmith.com/install.ps1 | iex`. Update with `langsmith self-update`, and prebuilt binaries are in the GitHub releases.

How do I keep the key out of a file?

Create a profile with `--api-key-env` or `--api-key-cmd`, or with `--keychain`. The `LANGSMITH_SECRET_STORE=keychain` variable turns on the keychain for all profiles.

How do I use a self-hosted LangSmith?

Set `LANGSMITH_ENDPOINT` to your server address. Default workspace and project come from `LANGSMITH_WORKSPACE_ID` and `LANGSMITH_PROJECT`.

Where can I see where the key comes from?

`langsmith auth info` shows the source of the active profile key.

How does this differ from the LangSmith skills?

The CLI provides data-access commands, while the LangChain skills teach the agent to query traces and build datasets. They are installed together.

Discussion

No questions or reviews yet.

CLI tools

LangSmith skills

LangSmith Skills

Official LangChain skills for LangSmith: query and export traces, build eval datasets and write custom evaluators from your agent

SkillExtended access166Repository stars

Nine skills for LangChain, LangGraph, LangSmith and Deep Agents: project setup, agent patterns, testing, traces and deployment.

SkillMinimal access106Repository stars
Official

Official LangChain skills: choose between LangChain, LangGraph and Deep Agents, quickstarts, RAG, memory, human approval and eval engineering

SkillMinimal access1.3KRepository stars
Official

Official Langfuse skills: Claude Code and Cursor set up LLM tracing, manage prompts and datasets, and migrate projects from LangSmith

SkillExtended access339Repository stars

A LangGraph 1.0 guide as a skill: ReAct agents, StateGraph, middleware, memory, MCP and RAG, so Claude Code writes LangChain code without outdated APIs

SkillMinimal access471Repository stars

A TypeScript terminal agent: streaming REPL, OpenAI-compatible and Anthropic models, plan mode and edit rollback.

CLIBroad access110Repository stars

README in short

A Go CLI for agents working with LangSmith: listing and inspecting projects, traces, runs, datasets and experiments, with profiles and OAuth.

README badge

Report a problem