> ## Documentation Index
> Fetch the complete documentation index at: https://docs.piebald.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Builtin tool calls

Piebald provides a set of built-in tools that are available to all models.

* `ReadFile`: Reads a file from the file system.  Does not add line prefixes.  Auto-approved for file paths in the current project.
* `WriteFile`: Writes the given contents to a file on disk.  Overwrite existing files, if any.  Auto-approved in auto-accept edits mode for file paths in the current project.
* `EditFile`: Replaces a given old string with a given new string.  Auto-approved in auto-accept edits mode for file paths in the current project.
* `Glob`: Search for file paths via glob patterns, e.g. `**/*.ts`.
* `Grep`: Search for text in a folder recursively using regular expressions.  Accepts a variety of [ripgrep](https://github.com/BurntSushi/ripgrep)-like options.
* `WebFetch`: Returns the text content of page at the given URL.
* `WebSearch`: Searches the web for the given query using the configured search service.
* `RunTerminalCommand`: Runs the given terminal command.  Uses `sh` on macOS and Linux and `cmd /C` on Windows by default.
* `TodoWrite`: Updates the current todo list for the chat.
* `ProposePlanToUser`: Prompts you to exit plan mode by displaying the given plan text as markdown.
* `AskUserQuestion`: Allows the model to ask you any number of questions with one or more answers per question.
* `LaunchSubagent`: Launches a [subagent](/features/agentic/subagents).
* `CreateGoal`: Allows the model to create a [goal](/features/agentic/goals).
* `UpdateGoal`: Allows the model to update its goal.
* `GetGoal`: Gets the objective and status of the current goal.

## `RunTerminalCommand`

### Configuring the shell to be used for command execution

Internally, the `RunTerminalCommand` tool executes the given command using `sh -c` on UNIX systems (macOS and Linux) and `cmd.exe /C` on Windows.  However, you can change the default shell to a preset or a custom command.

Go to **Settings → Built-in Tools** and select a preset for **Terminal Shell.**  The default presets are:

**UNIX:**

* Bourne Shell (`/bin/sh`)
* Bash (`/bin/bash`)
* Zsh (`/bin/zsh`)

**Windows**

* Command Prompt (cmd.exe)
* Windows PowerShell
* Git Bash (MinGW)

Git for Windows must be installed in order to use Git Bash in Piebald.  Download it from [gitforwindows.org](https://gitforwindows.org/).

#### Using a custom shell

You can also specify a custom shell, which is useful when you want to use a shell not explicitly mentioned above.  For example, if you have custom aliases in a shell like Fish.

To use a custom shell, set **Terminal Shell** to **Custom...** and then enter each individual argument required to invoke the shell with a command.  Most UNIX shells accept a `-c` argument, e.g. `fish -c "..."`.  Use `{command}` as the last argument.

<Warning>**Do not wrap the `{command}` argument in quotes** unless you're using a custom shell that requires it.  When you use a custom shell, Piebald passes each argument to the shell directly without needing to quote arguments.</Warning>

We plan to automatically detect installed shells so you won't have to go the custom route for the majority of cases.

### Live, interactive terminal commands

<Badge color="blue">Available in Piebald Basic (Free)</Badge>

When the model runs a terminal command, Piebald executes the command in an integrated terminal instance embedded in the app.  This means that interactive commands and commands that output colors and other ANSI escape codes are supported.

When the command is interactive (i.e. requires user interaction/input like `npm init`, `sudo` commands, etc.), you can enter input and navigate options directly inside the tool call UI.  This opens interesting possibilities, including running full REPLs like `node`, or even TUIs like `claude`!

<video src="https://mintcdn.com/piebald/4FtGqNeaL7sgvJi4/imgs/live_terminal_commands.mp4?fit=max&auto=format&n=4FtGqNeaL7sgvJi4&q=85&s=8162ef1d38f772d7bdc69df7cf65a0af" name="live_terminal_commands.mp4" controls data-path="imgs/live_terminal_commands.mp4">Video showing live terminal commands</video>

Terminal sessions are not currently preserved across multiple terminal commands.  For example, if the model sets a shell variable in one command, the next command will not be able to `echo` it.  This is a limitation that we plan on removing in the future.

### Command output is truncated

Many commands return lots of output—compiling large projects, running large test suites, installing applications, etc.  Instead of returning all this output directly to the LLM, the output is truncated to the first 10,000 and last 10,000 characters, as these windows usually contain the most important, useful information.

## `ProposePlanToUser`

### Copying plans to clipboard

<Badge color="green">Available in [Piebald Pro](https://piebald.ai/pricing)</Badge>

When the model proposes a plan, it can be convenient to copy the plan to your clipboard to paste into a new chat, share to a teammate, or save to a file.  With [Piebald Pro](https://piebald.ai/pricing), plans proposed by the AI have a copy button (<Icon icon="copy" />) that will copy the markdown contents of the plan to your clipboard:

<img className="shadow-md rounded-xl" alt="Screenshot of a plan with the copy button circled" src="https://mintcdn.com/piebald/sDAg3NkddSXbITtn/imgs/copying_plans.png?fit=max&auto=format&n=sDAg3NkddSXbITtn&q=85&s=807ce9ef9a42ca95ed65d9f789420973" width="1380" height="265" data-path="imgs/copying_plans.png" />

## `WebSearch`

### Using DuckDuckGo for web search

By default, the `WebSearch` tool uses the free web search service [Exa](https://exa.ai/).  However, if you've hit your Exa rate limits or you're not satisfied with the results from Exa web searches, you can change the search service to DuckDuckGo by setting **Settings → Web Search → Search Backend** to **DuckDuckGo**.
