run-shell¶
Run a shell command in an isolated container.
Description¶
The run-shell prompt provides a simple way to execute shell commands in a container with a specified base image.
Parameters¶
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Shell command to execute |
|
string |
No |
|
Base image to use |
Generated Instructions¶
When invoked with:
{
"command": "uname -a && cat /etc/os-release",
"image": "alpine:latest"
}
Returns:
Run this command in a container:
```bash
uname -a && cat /etc/os-release
Use image tag:alpine:latest. If the image doesn’t exist, import it first with import_image.
## Example Usage
### Basic Command
```json
{
"prompt": "run-shell",
"args": {
"command": "ls -la /etc"
}
}
With Specific Image¶
{
"prompt": "run-shell",
"args": {
"command": "go version",
"image": "golang:1.21"
}
}
System Information¶
{
"prompt": "run-shell",
"args": {
"command": "df -h && free -m && nproc"
}
}
Implementation Notes¶
The agent should:
Check if the specified image exists with
list_imagesIf not found, import it with
import_imageExecute the command with
run:{ "command": "<shell_command>", "image": "tag:<image>" }
See Also¶
run-python - Run Python code
sync-and-run - Run with local files
inspect-image - Explore image contents