LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Traceable
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerTraceableJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithexperimentalsandboxSandboxrun
Method●Since v0.6

run

Execute a command in the sandbox.

Copy
run(command: string, options: RunOptions = {}): Promise<ExecutionResult>

Parameters

NameTypeDescription
command*string

Shell command to execute.

optionsRunOptions
Default:{}

Execution options.

Example

Copy
const result = await sandbox.run("echo hello");
console.log(result.stdout); // "hello\n"
console.log(result.exit_code); // 0
View source on GitHub