Quick launcher utility for OpenCode - eliminates repetitive terminal commands when starting OpenCode in different directories.
English | 中文
Problem: Starting OpenCode requires opening a terminal, navigating to the target directory, and typing commands each time.
Solution: OpenCode Now provides platform-native launchers (macOS app, Windows context menu) that detect your OpenCode installation and launch it instantly in the desired directory.
| Feature | Implementation |
|---|---|
| Auto-detection | Searches npm, yarn, pnpm, nvm, Go bin, and system paths |
| Context-aware | Launches in current Finder window or specified directory |
| Terminal agnostic | Supports iTerm2, Warp, Kitty, Alacritty, Terminal.app |
| Permission bypass | Uses --dangerously-skip-permissions flag |
| Cross-platform | macOS (app bundle + shell) and Windows (PowerShell + batch) |
- OpenCode CLI must be installed and accessible in your PATH
# Install OpenCode (example - adjust for actual installation method)
go install github.com/opencode-ai/opencode@latest
# Verify
which opencode
opencode --version# 1. Clone repository
git clone https://github.com/EthanAlgoX/open-code-now.git
cd open-code-now
# 2. Set executable permissions
chmod +x "OpenCode Now.app/Contents/MacOS/OpenCodeLauncher"
# 3. Copy to Applications folder
cp -R "OpenCode Now.app" /Applications/
# 4. Refresh icon cache (if icon doesn't appear)
killall Finder
# 5. Launch methods:
# - **Launchpad**: Search and click OpenCode Now
# - **Dock**: Drag from Applications to Dock, click to launch
# - **Finder Toolbar**: Hold ⌘ and drag app to toolbar for folder-specific launches# 1. Clone repository
git clone https://github.com/EthanAlgoX/open-code-now.git
cd open-code-now
# 2. Set executable permissions
chmod +x macos/opencode-now.sh
# 3. Direct execution (specify directory)
./macos/opencode-now.sh ~/Documents/MyProject
# Or install globally (callable from anywhere)
sudo cp macos/opencode-now.sh /usr/local/bin/opencode-now
# Usage: opencode-now /path/to/project# 1. Clone or download repository
# 2. Run installation
.\windows\install.bat
# 3. (Optional) Add context menu integration
.\windows\install-context-menu.bat # Run as Administrator
# Usage: Right-click any folder → "OpenCode Now"OpenCode Now.app/
├── Contents/
│ ├── Info.plist # Bundle metadata, CFBundleIdentifier: com.opencode.launcher
│ └── MacOS/
│ └── OpenCodeLauncher # Launcher script (detects Finder window, terminal preference)
macos/
├── opencode-now.sh # Core launcher (PATH detection, OpenCode execution)
└── set-terminal.sh # Terminal preference configuration
Execution Flow:
- App launched →
OpenCodeLauncherexecutes - Detects current Finder window path via AppleScript
- Reads terminal preference from
~/.opencode-now-terminal - Calls
opencode-now.shwith target directory - Script searches for OpenCode binary (npm/yarn/pnpm/nvm/Go)
- Launches OpenCode with
--dangerously-skip-permissions
windows/
├── opencode-now.ps1 # PowerShell launcher (OpenCode detection + execution)
├── install.bat # Copies script to %USERPROFILE%\bin
├── install-context-menu.bat # Registry modifications for right-click menu
├── uninstall-context-menu.bat # Registry cleanup
└── diagnose.bat # Environment diagnostics
Registry Keys (Context Menu):
HKEY_CLASSES_ROOT\Directory\shell\OpenCodeNowHKEY_CLASSES_ROOT\Directory\Background\shell\OpenCodeNowHKEY_CLASSES_ROOT\Drive\shell\OpenCodeNow
./macos/set-terminal.shStores preference in ~/.opencode-now-terminal. Auto-detects if not set.
Priority: iTerm2 → Warp → Kitty → Alacritty → Terminal.app
Both macOS and Windows remember the last-used directory:
- macOS:
~/.opencode-now-last-dir - Windows:
%USERPROFILE%\.opencode-now-last-dir
Search Paths (in order):
- Current
$PATH/%PATH% - Package manager global bins (npm, yarn, pnpm)
- nvm Node.js versions (
~/.nvm/versions/node/*/bin) - Common installation directories:
- macOS:
~/.local/bin,/usr/local/bin,/opt/homebrew/bin,~/go/bin - Windows:
%APPDATA%\npm,%LOCALAPPDATA%\npm,%USERPROFILE%\go\bin
- macOS:
Diagnostics:
# macOS: Run launcher in terminal to see search output
./macos/opencode-now.sh
# Windows: Run diagnostic tool
.\windows\diagnose.bat# Fix executable permissions
chmod +x macos/opencode-now.sh
chmod +x macos/set-terminal.sh
chmod +x "OpenCode Now.app/Contents/MacOS/OpenCodeLauncher"- Verify script installation: Check
%USERPROFILE%\bin\opencode-now.ps1exists - Re-run
install-context-menu.batas Administrator - Restart Explorer:
taskkill /f /im explorer.exe && start explorer.exe
.
├── macos/
│ ├── opencode-now.sh # Launcher implementation
│ └── set-terminal.sh # Terminal config utility
├── windows/
│ ├── opencode-now.ps1 # PowerShell launcher
│ ├── install.bat # Installation script
│ ├── install-context-menu.bat # Context menu setup
│ ├── uninstall-context-menu.bat
│ └── diagnose.bat # Diagnostic tool
├── OpenCode Now.app/ # macOS app bundle
│ └── Contents/
│ ├── Info.plist
│ └── MacOS/OpenCodeLauncher
├── README.md
├── README.zh.md
└── .gitignore
# macOS: Syntax check
bash -n macos/opencode-now.sh
bash -n macos/set-terminal.sh
# Validate Info.plist
plutil -lint "OpenCode Now.app/Contents/Info.plist"
# Test launcher (dry run)
./macos/opencode-now.sh /tmp- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Test on target platform(s)
- Submit pull request with description of changes
Apache License 2.0 - See LICENSE for details.
- CLI Flag: Uses
--dangerously-skip-permissionsinstead of interactive prompts - Bundle ID:
com.opencode.launcher(macOS) - Minimum macOS: 10.13 (High Sierra)
- Windows: Requires PowerShell 5.0+