Installation
Requirements
- Node.js 18+ - Tuna uses modern Node.js features
- macOS - Currently the only supported platform (Linux/Windows coming soon)
- Cloudflare account - With at least one domain added
Install from npm
npm
npm install -g tunaVerify Installation
tuna --versionUsing npx
You can also use tuna without installing globally:
npx tuna npm run devFirst-Time Setup
After installation, you need to configure your Cloudflare credentials:
1. Create a Cloudflare API Token
- Go to Cloudflare API Tokens
- Click "Create Token"
- Use "Create Custom Token"
- Add these permissions:
| Scope | Resource | Permission |
|---|---|---|
| Account | Cloudflare Tunnel | Edit |
| Account | Access: Apps and Policies | Edit |
| Zone | DNS | Edit |
| Account | Account Settings | Read |
- Under "Zone Resources", select your domain or "All zones"
- Click "Continue to summary" → "Create Token"
- Copy the token (you won't see it again!)
2. Run Login
tuna --loginYou'll be prompted for:
- Your API token
- Your root domain (e.g.,
example.com)
Credentials are stored securely in your macOS Keychain.
3. Initialize Your Project
cd your-project
tuna --initOr manually add to package.json:
{
"tuna": {
"forward": "my-app.example.com",
"port": 3000
}
}4. Start Using Tuna
tuna npm run devCloudflared Binary
Tuna needs the cloudflared binary to create tunnels. It will:
- Check if
cloudflaredis already installed (via Homebrew, etc.) - If not found, automatically download it to
~/.tuna/bin/
To install cloudflared manually:
# macOS with Homebrew
brew install cloudflared
# Or download directly
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64 -o /usr/local/bin/cloudflared
chmod +x /usr/local/bin/cloudflaredUpdating
npm update -g tunaUninstalling
# Remove the package
npm uninstall -g tuna
# Optional: Remove credentials from Keychain
# Open Keychain Access, search for "tuna-credentials"
# Optional: Remove tuna data
rm -rf ~/.tuna