Skip to Content
GuidesDeployment

Deployment

Local development, secrets, and production deployment.

Local development

Start the dev server:

npm run dev

This runs at http://localhost:5173 with:

  • Hot module replacement — UI changes appear instantly
  • Local Worker — Your Hono API runs via Wrangler
  • Full auth — The Myco auth flow works locally

Local environment variables

Create a .dev.vars file in your project root:

MYCO_APP_KEY=your-app-key OPENAI_API_KEY=sk-...

Wrangler reads this file automatically during npm run dev.

Production secrets

For production, set Cloudflare secrets:

npx wrangler secret put MYCO_APP_KEY npx wrangler secret put OPENAI_API_KEY

These are encrypted and only accessible by your Worker at runtime.

Never put production secrets in .dev.vars or wrangler.jsonc. Use wrangler secret put for production values.

Deploying

myco app deploy

This handles everything:

  1. Runs npm run build to build the frontend
  2. Deploys static assets and the Worker to Cloudflare
  3. Deploys skills from skills/ (if present)

Deploy options

FlagDescription
--force, -fForce deploy even if no changes detected
--skip-buildSkip npm run build (useful if you already built)

Skills-only deploy

To deploy skills without redeploying the Worker:

myco skills deploy

Alternative: npm scripts

npm run build # Build frontend only npm run deploy # Deploy via wrangler only npm run publish # Build + deploy

Build process

When you run myco app deploy or npm run build:

  1. Vite builds the React SPA into static assets (dist/)
  2. @cloudflare/vite-plugin bundles the Worker
  3. The Worker serves static assets and handles API routes

Custom domains

After deploying, your app runs at <app-name>.myco.com.

Redeployment

Myco uses content hashing for efficient deploys:

  • Skills — Only changed skills are updated; unchanged skills are skipped
  • Worker — Cloudflare handles incremental deploys

Just run myco app deploy whenever you want to update.