bini-deploy

Official

Zero-config deployment for Bini.js projects - web, desktop, and mobile, all from one CLI.

Overview

bini-deploy scans your project, generates the right hosting configuration for your target platform, and pushes it straight to GitHub. No YAML spelunking, no platform-specific docs to read first.

One command from zero to deployed. Handles git identity, GitHub auth, branch naming, and cleanup automatically.

Features

Web Hosting

Netlify, Vercel, Cloudflare Workers, Deno Deploy. Picks adapter, writes config, wires API routes.

File-based API

Drop files in src/app/api/, bini-deploy scans and mounts each as route with dynamic segments.

Automatic CORS

API routes get permissive CORS headers out of the box on every non-Node adapter.

Native Support

Windows, macOS, Linux, iOS, Android via Tauri with tailored next-step instructions.

Git Built-in

Init repo if needed, sets up identity and auth if missing, commits and pushes.

Smart Diagnostics

Push failures diagnosed - bad credentials, repo not found, or diverged history with accurate recovery.

Installation

>_Terminal
$ npm install --save-dev bini-deploy

Quick Start

Interactive mode - just run it and answer the prompts:

>_Terminal
$ npx bini-deploy

bini-deploy will guide you through two prompts:

>_Terminal
? Select your target platform:
> Web
Windows
macOS
iOS
Linux
Android
 
↑↓ navigate • ⏎ select
>_Terminal
? Select hosting provider:
> Node.js (default - bini-server)
Netlify
Vercel
Cloudflare Workers
Deno Deploy
 
↑↓ navigate • ⏎ select

Non-interactive mode - for scripts and CI:

>_Terminal
$ npx bini-deploy --platform web --hosting vercel --repo https://github.com/you/your-app --yes

Usage

>_Terminal
$ npx bini-deploy [options]
FlagDescription
--platform <type>web, windows, macos, ios, linux, android
--hosting <name>node (default), netlify, vercel, cloudflare, deno (web only)
--repo <url>GitHub repo URL, e.g. https://github.com/you/app
--generate-entry <host>Generate production entry file only
--yes, -ySkip prompts and use flags
--help, -hShow usage information

Examples:

>_Terminal
$ npx bini-deploy --platform web --hosting vercel --repo https://github.com/you/your-app --yes
$ npx bini-deploy --platform windows --repo https://github.com/you/your-app -y
$ npx bini-deploy --generate-entry netlify
$ npx bini-deploy

Supported Hosting Providers

ProviderRuntimeConfig Generated
Node.js (default)Node (bini-server)None - bini-server handles build/serve
NetlifyEdge Functions (Deno)netlify.toml + netlify/edge-functions/api.ts
VercelNode.js Runtimevercel.json + api/index.ts
Cloudflare WorkersWorkerswrangler.toml + worker.ts
Deno DeployDenoserver/index.ts
Node is default because Bini.js ships with bini-server, a zero-dependency production server. Choosing it skips config generation entirely.

API Routes

Any file in src/app/api/ becomes an API route. Nested folders map to URL segments, bracket segments become dynamic params, and spread segments become wildcards:

api
ƒindex.ts
users
ƒindex.ts
ƒ[id].ts
posts
ƒ[...slug].ts
src/app/api/users/[id].ts
export default async function handler(req) {
  const id = new URL(req.url).pathname.split('/').pop();
  return { id, name: 'Ada Lovelace' };
}
If your package.json has "type": "module", every relative import must include its file extension explicitly - ./utils.js not ./utils - or deployed function will crash with ERR_MODULE_NOT_FOUND.

Hono Support

If your route file imports from hono, bini-deploy detects it and mounts it as a full Hono app:

src/app/api/hello/route.ts
import { Hono } from 'hono';

const app = new Hono();

app.get('/', (c) => c.json({ message: 'Hello from Hono!' }));
app.post('/', async (c) => {
  const body = await c.req.json();
  return c.json({ received: body });
});

export default app;

How it Works

  1. Scan - scans your src/app/api/ directory for route files
  2. Generate - creates platform-specific entry file and configuration
  3. Clean - removes leftover files from previously selected platform
  4. Push - commits and pushes everything to GitHub
  5. Deploy - hosting platform automatically deploys from GitHub

Git Behavior

  • Existing remote - uses it without modification
  • New projects - adds provided URL as origin
  • Always main - automatically handles branch naming, never pushes to master
  • Git identity - prompts for user.name/user.email once if not set, local only
  • GitHub auth - prompts for username + PAT if push rejected, saves via credential store
  • Remote-ahead recovery - fetches and merges remote history automatically with --allow-unrelated-histories -X ours

Requirements

  • Node.js >= 18
  • Vite >= 6
  • A GitHub repository (created ahead of time)
  • git available on PATH
Was this helpful?