Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

tuna --init

Interactive setup wizard for configuring tuna in your project.

Usage

tuna --init

What It Does

  1. Checks for existing package.json
  2. Detects if tuna is already configured
  3. Prompts for configuration options
  4. Writes config to package.json

Interactive Flow

$ tuna --init
 
🐟 Tuna Project Setup
 
? Use $USER variable for unique subdomains per developer? Yes
? Subdomain pattern (will become $USER-<pattern>.example.com): api
? Local port to forward: 3000
? Enable Zero Trust Access control? Yes
? Access rules (comma-separated emails or @domains): @mycompany.com
 
 Configuration saved to package.json
 
Added to package.json:
{
  "tuna": {
    "forward": "$USER-api.example.com",
    "port": 3000,
    "access": ["@mycompany.com"]
  }
}
 
Next steps:
  Run: tuna npm run dev
 
Your tunnel URL will be:
  https://alice-api.example.com

Options

Subdomain Pattern

Choose a pattern for your subdomain:

  • With $USER: $USER-api.example.comalice-api.example.com
  • Without: api.example.com (fixed subdomain)

Port

The local port your dev server runs on. Common defaults:

FrameworkDefault Port
Vite5173
Next.js3000
Create React App3000
Express3000
FastAPI8000

Access Control

Optionally restrict who can access your tunnel:

  • @company.com - Anyone with that email domain
  • user@example.com - Specific email addresses

Overwriting Existing Config

If tuna is already configured, you'll be asked to confirm:

$ tuna --init
 
? Tuna config already exists. Overwrite? No
Keeping existing config.

Manual Alternative

Instead of --init, you can manually add to package.json:

{
  "name": "my-app",
  "tuna": {
    "forward": "$USER-api.example.com",
    "port": 3000,
    "access": ["@mycompany.com"]
  }
}

Prerequisites

  • Must have a package.json in current directory
  • Should have run tuna --login first (for domain suggestion)

See Also