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

# Terminal Commands

> Run shell commands with your voice.

## What it does

Terminal Commands execute shell commands on your Mac. Run scripts, manage files, control system settings, or automate development tasks—all with your voice.

> [!WARNING]
>
> Terminal commands run with your user permissions. Be careful with destructive commands like `rm -rf`.

## Configuration

| Setting | Default | Description |
| - | - | - |
| **Commands** | Required | List of shell commands to run |
| **Execution Mode** | Background | Background (silent) or Visual (shows terminal) |
| **Terminal App** | System Default | Which terminal to use |
| **Working Directory** | None | Directory to run commands in |
| **Close Tab When Complete** | Off | Auto-close terminal tab after running |
| **Close Tab Delay** | 2000ms | Wait before closing |

***

## Execution modes

### Background (silent)

Commands run without opening a terminal window. Output is captured but not displayed.

**Use cases**:

* Quick file operations
* System commands
* Scripts that don't need interaction
* Automation that should be invisible

### Visual

Commands run in a terminal window you can see.

**Use cases**:

* Interactive commands
* Long-running processes
* Debugging scripts
* Commands where you want to see output

***

## Supported terminals

| Terminal | Notes |
| - | - |
| Terminal.app | macOS built-in, full support |
| iTerm | Full support |
| Warp | Keystroke fallback |
| Hyper | Keystroke fallback |
| Alacritty | Keystroke fallback |
| kitty | Keystroke fallback |

***

## Environment variables

Your commands have access to special variables:

| Variable | Description |
| - | - |
| `$HERMES_INPUT` | Your transcription (the remainder after trigger) |
| `$HERMES_SCREENSHOT` | Path to screenshot (if captured) |

### Example: Use transcription in command

**Trigger**: "create file"
**Command**: `touch ~/Desktop/"$HERMES_INPUT".txt`

Say: "create file meeting notes"
Result: Creates `~/Desktop/meeting notes.txt`

***

## Examples

### Open project in VS Code

**Trigger**: "open project"
**Command**: `cd ~/projects/myapp && code .`

### Git status

**Trigger**: "git status"
**Command**: `git status`
**Mode**: Visual

### Create and open file

**Trigger**: "new note"
**Command**:

```bash theme={null}
touch ~/Desktop/note-$(date +%Y%m%d).txt && open ~/Desktop/note-$(date +%Y%m%d).txt
```

### Kill process by name

**Trigger**: "kill"
**Command**: `pkill -f "$HERMES_INPUT"`

Say: "kill chrome"
Result: Kills Chrome processes

### Copy text to clipboard

**Trigger**: "clip"
**Command**: `echo "$HERMES_INPUT" | pbcopy`

Say: "clip hello world"
Result: "hello world" copied to clipboard

***

## Command sequences

You can run multiple commands in sequence:

| Command | Delay After |
| - | - |
| `cd ~/projects` | 0ms |
| `git pull` | 0ms |
| `npm install` | 0ms |
| `npm run dev` | 0ms |

Each command runs after the previous one completes.

***

## Security warnings

Hermes warns about potentially dangerous commands:

| Pattern | Risk |
| - | - |
| `rm -rf` | Recursive deletion |
| `sudo` | Elevated privileges |
| `mkfs` | Filesystem formatting |
| `dd if=` | Disk operations |
| `curl \| sh` | Remote script execution |
| `wget \| bash` | Remote script execution |
| `shutdown` | System shutdown |
| `reboot` | System restart |

You can still run these commands, but Hermes will ask for confirmation.

***

## Creating a terminal trigger

**1. Open Triggers**

Go to **Settings → Triggers**.

**2. Create new trigger**

Click **+** or **New Trigger**.

**3. Set the phrase**

Enter your trigger phrase (e.g., "git status").

**4. Choose matching mode**

**Exact** for simple commands, **Prefix** if you need input.

**5. Select Terminal**

Choose **Terminal Commands** as the action type.

**6. Add commands**

Enter your shell commands. Add delays if needed.

**7. Set execution mode**

Choose Background (silent) or Visual.

**8. Save**

Click **Save**.

***

## Tips

* **Use background mode** for quick, non-interactive commands
* **Use visual mode** for long-running or interactive commands
* **Set working directory** to avoid `cd` commands
* **Use `$HERMES_INPUT`** to pass voice input to scripts
* **Test commands manually first** before creating triggers

***

## Related

> [card] [Keyboard Shortcuts](https://docs.hermesvoice.com/triggers/types/keyboard-shortcuts.md)
>
> Simulate key presses instead.

> [card] [Apple Shortcuts](https://docs.hermesvoice.com/triggers/types/apple-shortcuts.md)
>
> Run Shortcuts app workflows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.