summaryrefslogtreecommitdiff
path: root/docs/tools
diff options
context:
space:
mode:
authorDaniel Lee <[email protected]>2025-07-24 10:13:00 -0700
committerGitHub <[email protected]>2025-07-24 17:13:00 +0000
commit3dd6e431df057af47b96990d0c9c6477ccfbe452 (patch)
tree8a75c928b0c558d82a5470a504ff57f48002f801 /docs/tools
parent52980510c92deb4af4c9012ae23bd67f169c1a32 (diff)
feat: add GEMINI_CLI environment variable to spawned shell commands (#4791)
Diffstat (limited to 'docs/tools')
-rw-r--r--docs/tools/shell.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/tools/shell.md b/docs/tools/shell.md
index 021cede1..3e2a00e4 100644
--- a/docs/tools/shell.md
+++ b/docs/tools/shell.md
@@ -60,6 +60,10 @@ run_shell_command(command="npm run dev &", description="Start development server
- **Error handling:** Check the `Stderr`, `Error`, and `Exit Code` fields to determine if a command executed successfully.
- **Background processes:** When a command is run in the background with `&`, the tool will return immediately and the process will continue to run in the background. The `Background PIDs` field will contain the process ID of the background process.
+## Environment Variables
+
+When `run_shell_command` executes a command, it sets the `GEMINI_CLI=1` environment variable in the subprocess's environment. This allows scripts or tools to detect if they are being run from within the Gemini CLI.
+
## Command Restrictions
You can restrict the commands that can be executed by the `run_shell_command` tool by using the `coreTools` and `excludeTools` settings in your configuration file.