Problem: Script can’t find commands that work in your terminal.Explanation: Raycast runs scripts in a non-login shell, which has a minimal PATH.Solution:Raycast automatically includes /usr/local/bin. For other locations, add them explicitly:
#!/bin/bash# Add custom pathsexport PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"# Now your command should workmy-custom-command
Login shell behavior
Problem: Script works with #!/bin/bash -l but you can’t use this in the community repo.Explanation: The community repository doesn’t allow login shells to ensure portability.Solution:Instead of relying on your shell profile, explicitly set what you need:
#!/bin/bash# Explicitly set PATHexport PATH="/opt/homebrew/bin:$PATH"# Set any needed environment variablesexport MY_VAR="value"# Your script logic here
For personal scripts (not in the community repo), you can use #!/bin/bash -l if needed.
Environment variables not available
Problem: Environment variables from your shell profile aren’t accessible.Solution:Set required variables at the top of your script:
#!/bin/bash# Set environment variablesexport API_URL="https://api.example.com"export EDITOR="vim"# Your script logic
Raycast has plans to support environment variables natively. Track progress in this issue.
Problem: The script runs but you don’t see any output.Cause: Wrong output mode for your use case.Solution:Choose the appropriate mode:
silent mode: Shows output in HUD after Raycast closes (for quick actions)
compact mode: Shows last line in toast (for progress updates)
fullOutput mode: Shows all output (for detailed results)
inline mode: Shows first line in command list (for dashboard items)
# Change this to match your needs# @raycast.mode fullOutput
Inline mode script not refreshing
Problem: Script in inline mode doesn’t update automatically.Cause: Missing or invalid refreshTime parameter.Solution:Add a valid refresh interval:
# @raycast.mode inline# @raycast.refreshTime 30s
Valid formats:
10s (seconds, minimum 10)
5m (minutes)
2h (hours)
1d (days)
Only the first 10 inline commands are refreshed automatically. Others must be manually refreshed.
Long-running task shows partial output
Problem: Tasks like zip or tar show lots of partial progress in compact/silent modes.Solution:Use quiet flags for commands that generate progress output:
# ❌ Will show lots of partial outputzip -r archive.zip folder/# ✅ Quiet mode for clean outputzip -qr archive.zip folder/echo "Archive created successfully"
Or switch to fullOutput mode:
# @raycast.mode fullOutput
Colors not displaying
Problem: ANSI color codes aren’t showing in output.Cause: Colors are only supported in inline and fullOutput modes.Solution:Use one of these modes and proper ANSI escape codes:
# @raycast.mode fullOutput# Red text on green backgroundecho -e '\033[31;42mColored text\033[0m'
# ❌ Not helpfulecho "Error"exit 1# ✅ Clear and actionableecho "Error: Configuration file not found at ~/.config/myapp/config.json"echo "Run 'myapp init' to create the configuration file."exit 1
For compact and inline modes, only the last line is shown in the error toast.
Always test your script from the terminal before trying it in Raycast:
# Navigate to your script directorycd ~/path/to/scripts# Run the scriptbash ./your-script.sh# Or make it executable and run directlychmod +x ./your-script.sh./your-script.sh