Deployment
Local development, secrets, and production deployment.
Local development
Start the dev server:
npm run devThis 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_KEYThese 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
Full deploy (recommended)
myco app deployThis handles everything:
- Runs
npm run buildto build the frontend - Deploys static assets and the Worker to Cloudflare
- Deploys skills from
skills/(if present)
Deploy options
| Flag | Description |
|---|---|
--force, -f | Force deploy even if no changes detected |
--skip-build | Skip npm run build (useful if you already built) |
Skills-only deploy
To deploy skills without redeploying the Worker:
myco skills deployAlternative: npm scripts
npm run build # Build frontend only
npm run deploy # Deploy via wrangler only
npm run publish # Build + deployBuild process
When you run myco app deploy or npm run build:
- Vite builds the React SPA into static assets (
dist/) - @cloudflare/vite-plugin bundles the Worker
- 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.