@@ -532,6 +532,37 @@ Example:
532532>> > bash.unmount(" /mnt/ext" )
533533```
534534
535+ ### ` set_env `
536+
537+ ``` python
538+ Bash.set_env(key: str , value: str ) -> None
539+ ```
540+
541+ Set an exported environment variable on the live interpreter.
542+
543+ The env counterpart to :meth:` mount ` — usable after construction, so a
544+ reusable setup bundle (mount + env + builtins) can be applied to an
545+ existing instance instead of only through the constructor. Scripts see
546+ it as `` $NAME `` ; child contexts see it in `` env `` . A later script
547+ assignment wins.
548+
549+ Survives :meth:` reset ` , like custom builtins and unlike env a * script*
550+ exported: only host-set values are replayed on rebuild.
551+
552+ ** Parameters:**
553+
554+ - ** ` key ` ** — Variable name.
555+ - ** ` value ` ** — Variable value.
556+
557+ Example:
558+
559+ ``` python
560+ >> > bash = Bash()
561+ >> > bash.set_env(" SKILL_PATH" , " /skills/my-skill" )
562+ >> > bash.execute_sync(" echo $SKILL_PATH" ).stdout
563+ ' /skills/my-skill\n '
564+ ```
565+
535566## BashTool
536567
537568Sandboxed bash interpreter for AI agents.
@@ -1076,6 +1107,25 @@ Example:
10761107>> > tool.unmount(" /mnt/ext" )
10771108```
10781109
1110+ ### ` set_env `
1111+
1112+ ``` python
1113+ BashTool.set_env(key: str , value: str ) -> None
1114+ ```
1115+
1116+ Set an exported environment variable. See :meth:` Bash.set_env ` .
1117+
1118+ Survives :meth:` reset ` .
1119+
1120+ Example:
1121+
1122+ ``` python
1123+ >> > tool = BashTool()
1124+ >> > tool.set_env(" SKILL_PATH" , " /skills/my-skill" )
1125+ >> > tool.execute_sync(" echo $SKILL_PATH" ).stdout
1126+ ' /skills/my-skill\n '
1127+ ```
1128+
10791129## ScriptedTool
10801130
10811131Compose Python callbacks as bash builtins for multi-tool orchestration.
0 commit comments