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

# Writing Terminal Commands

Agent can integrate directly run bash commands on your terminal.

## Supported Shells

* Bash
* Sh
* Zsh

## Command Format

```bash theme={null}
# Single command
command --flag value

# Multi-line command
command1 && \
  command2 | \
  grep 'pattern'
```

## Examples

### Basic Command

```bash theme={null}
# Get system uptime
uptime
```

### Piped Commands

```bash theme={null}
# Find and count Java processes
ps aux | grep java | wc -l
```

### Environment Variables

```bash theme={null}
# Use environment variables
echo "Current user is $USER"
```

## Best Practices

* Keep commands simple and focused
* Use full paths to binaries when possible
* Handle errors with `||` operator
* Use `set -e` at the start of scripts to fail fast

## Security Considerations

* Avoid using root privileges unless necessary
* Never include sensitive data directly in commands
* Use environment variables for secrets
* Validate all user inputs
