-
Notifications
You must be signed in to change notification settings - Fork 2.3k
skills / cli changes #2901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
skills / cli changes #2901
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fbb20be
add langsmith skills documentation
Palashio c1ced51
u
Palashio c193790
u
Palashio ea18e4f
add cli info [do not merge until mar 4th]
Palashio 3b26ec4
remove fetch and mcp server pages
Palashio 725f4a1
Merge branch 'palash/add-langsmith-skilsl' into palash/remove-fetch-cli
Palashio 6c77dc7
Merge branch 'palash/add-langsmith-cli' into palash/remove-fetch-cli
Palashio 38e24e7
update
Palashio c3e3685
update
Palashio 7fda3d4
update
Palashio 96c12a6
updated
Palashio aa43756
update docs
Palashio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| --- | ||
| title: LangSmith CLI | ||
| sidebarTitle: LangSmith CLI | ||
| description: Query and manage LangSmith projects, traces, runs, datasets, evaluators, experiments, and threads from the terminal | ||
| --- | ||
|
|
||
| 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. | ||
|
|
||
| <Callout icon="terminal" color="#504B5F"> | ||
| Built for agents and scripts: defaults to JSON, supports clean stdout/stderr separation, and offers `--yes` flags for non-interactive use. | ||
| </Callout> | ||
|
|
||
| ## Installation | ||
|
|
||
| Choose any method below. | ||
|
Palashio marked this conversation as resolved.
Outdated
|
||
|
|
||
| <CodeGroup> | ||
| ```bash Install script (recommended) | ||
| curl -sSL https://raw.githubusercontent.com/langchain-ai/langsmith-cli/main/scripts/install.sh | sh | ||
| ``` | ||
|
|
||
| ```bash Install to a custom directory | ||
| INSTALL_DIR=$HOME/.local/bin \ | ||
| curl -sSL https://raw.githubusercontent.com/langchain-ai/langsmith-cli/main/scripts/install.sh | sh | ||
| ``` | ||
|
|
||
| ```bash GitHub Releases | ||
| # Download the latest binary for your platform | ||
| # https://github.com/langchain-ai/langsmith-cli/releases | ||
| ``` | ||
|
|
||
| ```bash Go install | ||
| go install github.com/langchain-ai/langsmith-cli/cmd/langsmith@latest | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| ## Authentication | ||
|
|
||
| Set your API key as an environment variable: | ||
|
Palashio marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```bash | ||
| export LANGSMITH_API_KEY="lsv2_..." | ||
| ``` | ||
|
|
||
| Optional defaults: | ||
|
|
||
| ```bash | ||
| export LANGSMITH_ENDPOINT="https://api.smith.langchain.com" # self-hosted/hybrid | ||
| export LANGSMITH_PROJECT="my-default-project" # default project for queries | ||
| ``` | ||
|
|
||
| Or pass them as flags when running commands: | ||
|
|
||
| ```bash | ||
| langsmith --api-key lsv2_... trace list --project my-app | ||
| ``` | ||
|
|
||
| ## Quickstart | ||
|
|
||
| Common tasks to get oriented: | ||
|
Palashio marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```bash | ||
| # List tracing projects (sessions) | ||
| langsmith project list | ||
|
|
||
| # List recent traces in a project | ||
| langsmith trace list --project my-app --limit 5 | ||
|
|
||
| # Get a specific trace with full detail | ||
| langsmith trace get <trace-id> --project my-app --full | ||
|
|
||
| # List LLM runs with token counts | ||
| langsmith run list --project my-app --run-type llm --include-metadata | ||
|
|
||
| # Datasets and experiments | ||
| langsmith dataset list | ||
| langsmith experiment list --dataset my-eval-set | ||
|
|
||
| # Conversation threads in a project | ||
| langsmith thread list --project my-chatbot | ||
| ``` | ||
|
|
||
| ## 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>` | ||
|
|
||
| ```bash | ||
| langsmith trace list --project my-app # JSON array to stdout | ||
| langsmith --format pretty trace list --project my-app # tables/trees | ||
| langsmith trace list --project my-app -o traces.json # write JSON to file | ||
| ``` | ||
|
|
||
| ## Commands overview | ||
|
|
||
| The CLI groups functionality by resource. Each command supports filters like `--limit`, `--last-n-minutes`, and more. | ||
|
|
||
| <AccordionGroup> | ||
|
Palashio marked this conversation as resolved.
Outdated
|
||
| <Accordion title="project — list tracing projects" icon="folders"> | ||
|
|
||
| ```bash | ||
| langsmith project list # default limit: 20 | ||
| langsmith project list --name-contains chatbot | ||
| langsmith --format pretty project list | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="trace — query and export traces" icon="route"> | ||
|
|
||
| ```bash | ||
| langsmith trace list --project my-app --limit 50 --last-n-minutes 60 | ||
| langsmith trace list --project my-app --error --include-metadata | ||
| langsmith trace get <trace-id> --project my-app --full | ||
| langsmith trace export ./traces --project my-app --limit 20 --full | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="run — query individual runs" icon="list-details"> | ||
|
|
||
| ```bash | ||
| langsmith run list --project my-app --run-type llm | ||
| langsmith run list --project my-app --run-type tool --name search | ||
| langsmith run get <run-id> --full | ||
| langsmith run export llm_calls.jsonl --project my-app --run-type llm --full | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="thread — query conversation threads" icon="messages"> | ||
|
|
||
| ```bash | ||
| langsmith thread list --project my-chatbot --last-n-minutes 120 | ||
| langsmith thread get <thread-id> --project my-chatbot --full | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="dataset — manage evaluation datasets" icon="database"> | ||
|
|
||
| ```bash | ||
| langsmith dataset list --name-contains eval | ||
| langsmith dataset get my-dataset | ||
| langsmith dataset create --name my-eval-set --description "QA pairs for v2" | ||
| langsmith dataset export my-dataset ./data.json --limit 500 | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="evaluator — manage evaluators" icon="scale"> | ||
|
|
||
| ```bash | ||
| langsmith evaluator list | ||
| langsmith evaluator upload evals.py --name accuracy --function check_accuracy --dataset my-eval-set | ||
| langsmith evaluator delete accuracy --yes | ||
| ``` | ||
| </Accordion> | ||
|
|
||
| <Accordion title="experiment — results and summaries" icon="chart-bar"> | ||
|
|
||
| ```bash | ||
| langsmith experiment list --dataset my-eval-set | ||
| langsmith experiment get my-experiment-2024-01-15 | ||
| ``` | ||
| </Accordion> | ||
| </AccordionGroup> | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.