LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexLocalShellBackendexecute
Method●Since v1.8

execute

Execute a shell command directly on the host system.

Commands are executed directly on your host system using spawn() with shell: true. There is NO sandboxing, isolation, or security restrictions. The command runs with your user's full permissions.

The command is executed using the system shell with the working directory set to the backend's rootDir. Stdout and stderr are combined into a single output stream, with stderr lines prefixed with [stderr].

Copy
execute(command: string): Promise<ExecuteResponse>

Parameters

NameTypeDescription
command*string

Shell command string to execute

View source on GitHub