Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions commands/developer-utils/ghostty/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
# Ghostty AI Terminal Launchers

Launch Ghostty terminal with distinct visual themes for different AI CLI tools. Instant visual identification prevents confusion when working with multiple AI terminals.

## Features

- **5 Visual Themes**: Claude Code, Codex, Gemini, Kimi, Standard
- **Dropdown Menu**: Quick selection via `Launch AI Terminal`
- **Direct Launch**: Individual scripts for hotkey assignment
- **Unique Cursors**: block, bar, underline, block_hollow styles
- **High Contrast**: WCAG AAA compliant colors
- **Fast Launch**: <1 second terminal spawn

## Preview

![Dropdown Menu](images/dropdown-menu.png)

![Terminals Comparison](images/terminals-comparison.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced image is missing


## AI Tools Supported

| Tool | Theme | Background | Cursor | Icon |
|------|-------|------------|--------|------|
| Claude Code | Warm gold | #1E1E2E | Block (violet) | πŸ€– |
| Codex | Tech green | #1A1D21 | Bar (green) | ⚑ |
| Gemini | Sky blue | #1A1F2E | Underline (blue) | 🌟 |
| Kimi | Dark Side | #0F1419 | Hollow (violet) | πŸŒ™ |
| Standard | Neutral | #282A36 | Block (violet) | πŸ–₯️ |

## Installation

### Prerequisites

Install Ghostty terminal:
```bash
brew install ghostty
```

### Setup

1. Copy scripts to your Raycast scripts directory
2. Open Raycast β†’ Extensions β†’ Script Commands
3. Click "Reload Script Directories"
4. Search "Launch AI Terminal" or individual tool names

## Usage

### Dropdown Menu

1. Trigger Raycast (⌘+Space)
2. Type "Launch AI Terminal"
3. Select your AI tool from dropdown
4. Ghostty opens with themed terminal

### Direct Hotkeys (recommended)

Assign hotkeys in Raycast Preferences β†’ Extensions β†’ Script Commands:

```
βŒ₯⌘A - Launch AI Terminal (dropdown)
βŒ₯⌘C - Claude Code
βŒ₯⌘X - Codex
βŒ₯⌘G - Gemini
βŒ₯⌘K - Kimi
βŒ₯⌘T - Standard
```

## Customization

Edit script files to modify themes:

```bash
--background="#HEX" # Background color
--foreground="#HEX" # Text color
--cursor-style=[type] # block|bar|underline|block_hollow
--cursor-color="#HEX" # Cursor color
--background-opacity=[0-1] # Transparency (0.96-1.0)
--background-blur-radius=[px] # Blur effect (0-4)
--window-padding-x=[px] # Horizontal padding (12-24)
--window-padding-y=[px] # Vertical padding (12-20)
```

### Example Customization

Create your own theme for a new AI tool:

```bash
#!/bin/bash
# @raycast.schemaVersion 1
# @raycast.title Your AI Tool
# @raycast.mode silent
# @raycast.packageName AI Development
# @raycast.icon πŸ”₯
# @raycast.iconColor "#FF6B35"

open -na Ghostty.app --args \
--title="πŸ”₯ Your AI" \
--background="#1A1B26" \
--foreground="#A9B1D6" \
--cursor-style=bar \
--cursor-color="#FF6B35" \
--window-padding-x=18 \
--window-padding-y=14 \
> /dev/null 2>&1

exit 0
```

## Benefits

- **Eliminate Confusion**: Instantly identify which AI tool is running
- **Parallel Workflows**: Work with multiple AI tools simultaneously without mixing contexts
- **Muscle Memory**: Consistent hotkeys for each tool
- **Professional Look**: Polished visual distinctions for client demos or screencasts
- **Extensible**: Easy to add more AI tools following the same pattern

## Technical Details

- **Compatibility**: macOS 12+ (Bash 3.2+)
- **Dependencies**: Ghostty terminal
- **Performance**: <1s launch time, GPU-accelerated rendering
- **Validation**: ShellCheck passed with 0 warnings/errors
- **Standards**: WCAG AAA contrast ratios for accessibility

## Scripts Included

1. `launch-ai-terminal.sh` - Dropdown menu with 5 options
2. `launch-claude-code.sh` - Direct Claude Code launch
3. `launch-codex.sh` - Direct Codex launch
4. `launch-gemini.sh` - Direct Gemini launch
5. `launch-kimi.sh` - Direct Kimi launch
6. `launch-terminal-standard.sh` - Direct standard terminal
7. `list-recommended-themes.sh` - Theme reference documentation

## FAQ

### Why Ghostty instead of iTerm2/Alacritty?

Ghostty is GPU-accelerated, launches faster (<1s), and has simpler CLI arguments for theming. However, this pattern can be adapted to other terminals.

### Can I use this with other AI CLI tools?

Yes! Follow the customization example above. Popular tools that work well:
- Aider
- Cursor CLI
- Continue CLI
- GitHub Copilot CLI
- Amazon Q

### Does this work with multiple monitors?

Yes, Ghostty respects macOS window management. Each terminal can be placed on different displays.

### Can I change themes without editing scripts?

Currently themes are defined in scripts. For dynamic theme switching, consider using Ghostty's config file approach instead.

## Troubleshooting

### Ghostty not found
```bash
# Verify installation
which ghostty

# Install if missing
brew install ghostty
```

### Scripts don't appear in Raycast
1. Check file permissions: `chmod +x *.sh`
2. Reload: Raycast β†’ "Reload Script Directories"
3. Verify metadata: Each script must have `@raycast.schemaVersion 1`

### Theme colors don't match
Ghostty may use your system's color profile. For consistent colors:
```bash
# Add to Ghostty config
color-profile = srgb
```

## Contributing

Found a bug or want to add a new AI tool theme?
1. Test your changes locally
2. Validate with `shellcheck your-script.sh`
3. Submit PR with screenshots

## Author

Created by **rolldav** (David, drg) - Emergency physician & developer
GitHub: [@rolldav](https://github.com/rolldav)

Inspired by the need to manage multiple AI coding assistants during complex development workflows.

## License

Same as Raycast Script Commands repository (MIT)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 146 additions & 0 deletions commands/developer-utils/ghostty/launch-ai-terminal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/bin/bash
# Compatible: Bash 3.2+ (macOS default)

# @raycast.schemaVersion 1
# @raycast.title Launch AI Terminal
# @raycast.mode silent
# @raycast.packageName AI Development
# @raycast.icon πŸš€
# @raycast.iconColor "#7C3AED"
# @raycast.argument1 { "type": "dropdown", "placeholder": "Select AI Tool", "data": [{"title": "πŸ€– Claude Code", "value": "claude"}, {"title": "⚑ Codex", "value": "codex"}, {"title": "🌟 Gemini", "value": "gemini"}, {"title": "πŸŒ™ Kimi", "value": "kimi"}, {"title": "πŸ–₯️ Standard", "value": "standard"}] }
# @raycast.description Launch Ghostty terminal with AI-specific visual themes
# @raycast.author David (drg)

# ============================================================
# Find Ghostty binary
# ============================================================
find_ghostty() {
local SEARCH_PATHS=(
"/Applications/Ghostty.app/Contents/MacOS/ghostty"
"/opt/homebrew/bin/ghostty"
"/usr/local/bin/ghostty"
"$HOME/.local/bin/ghostty"
)

local path
for path in "${SEARCH_PATHS[@]}"; do
if [ -x "$path" ]; then
echo "$path"
return 0
fi
done

local path_result
path_result=$(command -v ghostty 2>/dev/null)
if [ -n "$path_result" ] && [ -x "$path_result" ]; then
echo "$path_result"
return 0
fi

echo "❌ Ghostty not found" >&2
echo "πŸ’‘ Install: brew install ghostty" >&2
return 1
}

find_ghostty || exit 1

# ============================================================
# Validate argument
# ============================================================
TOOL="$1"
case "${TOOL}" in
claude|codex|gemini|kimi|standard) ;;
*)
echo "❌ Invalid tool: ${TOOL}" >&2
echo "πŸ’‘ Valid options: claude, codex, gemini, kimi, standard" >&2
exit 1
;;
esac

# ============================================================
# Launch Ghostty with selected AI theme
# ============================================================
case "${TOOL}" in
claude)
open -na Ghostty.app --args \
--title="πŸ€– Claude Code" \
--background="#1E1E2E" \
--foreground="#D4A574" \
--cursor-style=block \
--cursor-color="#5865F2" \
--window-padding-x=20 \
--window-padding-y=16 \
--font-size=13.5 \
--background-opacity=0.98 \
--background-blur-radius=2 \
--selection-background="#3A2F47" \
--selection-foreground="#F2E5D7" \
> /dev/null 2>&1
;;
codex)
open -na Ghostty.app --args \
--title="⚑ Codex" \
--background="#1A1D21" \
--foreground="#7DB8A8" \
--cursor-style=bar \
--cursor-color="#10A37F" \
--window-padding-x=16 \
--window-padding-y=12 \
--font-size=13 \
--background-opacity=1.0 \
--background-blur-radius=0 \
--selection-background="#243B35" \
--selection-foreground="#C2E5DB" \
> /dev/null 2>&1
;;
gemini)
open -na Ghostty.app --args \
--title="🌟 Gemini" \
--background="#1A1F2E" \
--foreground="#8BABCC" \
--cursor-style=underline \
--cursor-color="#4285F4" \
--window-padding-x=24 \
--window-padding-y=20 \
--font-size=14 \
--background-opacity=0.96 \
--background-blur-radius=4 \
--selection-background="#2B3547" \
--selection-foreground="#D4E3F0" \
> /dev/null 2>&1
;;
kimi)
open -na Ghostty.app --args \
--title="πŸŒ™ Kimi" \
--background="#0F1419" \
--foreground="#C9D1D9" \
--cursor-style=block_hollow \
--cursor-color="#A78BFA" \
--window-padding-x=18 \
--window-padding-y=14 \
--font-size=13.5 \
--background-opacity=1.0 \
--background-blur-radius=0 \
--selection-background="#1F2937" \
--selection-foreground="#E5E7EB" \
> /dev/null 2>&1
;;
standard)
open -na Ghostty.app --args \
--title="πŸ–₯️ Standard" \
--background="#282A36" \
--foreground="#C5AED6" \
--cursor-style=block \
--cursor-color="#BD93F9" \
--window-padding-x=18 \
--window-padding-y=14 \
--font-size=14 \
--background-opacity=1.0 \
--background-blur-radius=0 \
--selection-background="#3D3A4F" \
--selection-foreground="#F0E6FF" \
> /dev/null 2>&1
;;
esac

exit 0
Loading