next-vibe

เฟรมเวิร์ก TypeScript แบบโอเพนซอร์ส (MIT + GPL v3) ที่นิยาม endpoint ทุกตัวเป็นทั้งเครื่องมือ MCP คำสั่ง CLI และ UI บนเว็บ เรียกใช้ vibe mcp เพื่อเปิดให้ใช้เครื่องมือของคุณ ขับเคลื่อน unbottled.ai

GitHub
4
ลองใช้ MCP นี้ผู้สนับสนุน

เอกสาร

NextVibe

Define it once. It exists everywhere.

One folder per feature. definition.ts defines the contract, route.ts wires it up, widget.tsx makes it yours. Two required, one you'll always want. 13 platforms. Not generated code that drifts - one living contract that the web UI, CLI, AI agent, MCP server, mobile app, cron system, and dataflow engine all read natively. Change the definition, every platform updates. Delete the folder, the feature ceases to exist everywhere at once.

License: GPL-3.0 License: MIT TypeScript Next.js React techfreaque/next-vibe MCP server

The spiritual successor to WordPress - for the AI era. Fork it, own it, build your platform. No vendor lock-in. No black box. You own every line.

Linux gets the most testing. macOS and Windows use the same three commands and the self-host page lists the per-OS prerequisites, but they see less testing. Issues and PRs welcome.

Interactive CLI broken since v3.2.0. vibe -i / --interactive is temporarily disabled. The trade-off was intentional: the entire codebase now runs on CLI and web through the same renderer layer. next-vibe-ui has a CLI equivalent of every component - same props, same types, shadcn-derived for web, Ink-based for terminal. Interactive mode returns once the unified renderer is fully stable.

Migrating from Next.js to TanStack Start + Vite Nitro. Dev already defaults to TanStack - fast cold start, lighter footprint, and still optimizing. Production runs Next.js - stable and proven. The tradeoff: occasional SSR hydration errors in dev that clear on refresh. Actively being resolved.


Getting Started

You need git and Bun 1.3 or newer. No Docker, no Postgres install: the default database is embedded Postgres (PGlite).

git clone https://github.com/techfreaque/next-vibe
cd next-vibe
bun i        # also puts the vibe command on your PATH
vibe dev     # database, migrations and seed data run on their own

vibe: command not found? Open a new terminal, or run bun run dev. Port 3000 in use? vibe dev --port=4000.

Everything else happens in the browser:

  1. Open localhost:3000 and click Log In.
  2. In the Dev Quick Login box, pick the ADMIN account. The setup wizard opens.
  3. Set your admin email and password. Security keys are already generated.
  4. Choose your AI: sign in with your unbottled.ai account (every model, no keys), or use Claude Code (claude login, detected on its own) or an OpenRouter key. Finish, start chatting.

Production:

vibe build && vibe start  # first time
vibe rebuild              # zero-downtime update after changes

Deploy

For one container with a managed PostgreSQL database, follow the self-hosted pod guide.

Works on any VPS. Scales to Kubernetes.

bash scripts/install-docker.sh     # Docker deployment
# or: vibe build && vibe start     # bare metal
# Point Caddy / nginx at port 3000

Kubernetes: kubectl apply -k k8s/ - templates for web, workers, Redis, ingress, namespace.

Connect your dev machine: Admin → Remote Connections → add your local URL. Thea discovers your tools, syncs memories and tasks every 60s. Your machine initiates the connection - no port forwarding needed.


The Core Idea

You build a contact form. Support wants a CLI command. The AI needs to file tickets. Mobile needs the same form. Someone asks for an MCP tool. Five implementations. Five places where bugs hide.

NextVibe: describe the feature once - inputs, outputs, validation, permissions, UI hints, error types, translations, examples - and every platform renders it natively.

#PlatformStatusWhat it does
1Web API✅ ProductionRESTful endpoint, full type safety
2React UI✅ ProductionData-driven forms and widgets from the definition
3CLI✅ ProductionEvery endpoint is a command with auto-generated flags
4CLI Package✅ ProductionShip your CLI as an installable npm package
5AI Tools✅ ProductionFunction-calling schema for any provider - auto-generated
6MCP Server✅ ProductionModel Context Protocol - plug into any AI workflow
7Remote Skills🚧 BetaAI-readable skill files for cross-agent capability discovery
8Cron / Pulse✅ ProductionScheduled execution with per-instance task routing
9WebSocket Events✅ ProductionReal-time pub/sub - in-process or Redis for scale
10React Native🚧 BetaSame contract on iOS/Android - NativeWind 5 + Expo Router
11Electron🚧 BetaDesktop app from the same build
12Vibe Frame🚧 BetaEmbed any endpoint as a widget on any website. Federation built in.
13tRPC⏸ InactiveAvailable but replaced by a custom RPC layer

There is no "API for humans" and "API for AI." There's one contract. Everything reads it.


One Folder = One Feature

Domain-driven flat structure. Each feature lives at src/<domain>/:

src/
  contact/
    definition.ts    - The contract (fields, validation, permissions, examples)
    route.ts         - Wires it to all 13 platforms
    repository.ts    - DB operations, no throw, ResponseType<T>
    i18n/            - Translations (en/, de/, pl/ - compile-time checked)
    widget.tsx       - One widget, all platforms (web · CLI · MCP · native)
    email.tsx        - Transactional email template
    db.ts            - Drizzle schema (co-located)
  user/
    definition.ts
    route.ts
    private/         - Nested sub-features, same pattern
    public/
  _pages/            - UI-only pages (no API contract needed)
    chat/
    subscription/

definition.ts and route.ts are required. widget.tsx handles all platforms in one file - web renders shadcn components, CLI/MCP renders Ink - same props, same types. Everything else is added when needed. Add a field to the definition - web form, CLI flags, AI tool schema, and mobile screen all update. Delete the folder - gone from every platform. No orphans. No cleanup.

Definition · Route · Repository · Widget · All patterns


What the Code Looks Like

definition.ts

const { POST } = createEndpoint({
  scopedTranslation,
  method: Methods.POST,
  path: ["contact"],
  allowedRoles: [UserRole.PUBLIC, UserRole.CUSTOMER, UserRole.ADMIN],

  fields: objectField(scopedTranslation, {
    type: WidgetType.CONTAINER,
    layoutType: LayoutType.GRID,
    usage: { request: "data", response: true } as const,
    children: {
      name: requestField(scopedTranslation, {
        schema: z.string().min(2),
        type: WidgetType.FORM_FIELD,
        fieldType: FieldDataType.TEXT,
        label: "form.fields.name.label",
      }),
      message: requestField(scopedTranslation, {
        schema: z.string().min(10),
        type: WidgetType.FORM_FIELD,
        fieldType: FieldDataType.TEXTAREA,
        label: "form.fields.message.label",
      }),
      success: responseField(scopedTranslation, {
        schema: z.string(),
        type: WidgetType.ALERT,
      }),
    },
  }),

  errorTypes: {/* all 9 - exhaustive, compiler enforced */},
  successTypes: { title: "success.title", description: "success.description" },
  examples: {
    requests: { default: { name: "Jane Smith", message: "Hello!" } },
    responses: { default: { success: "Thank you!" } },
  },
});

From this one file: web renders a form · CLI gets vibe contact --name="Jane" --message="..." · AI gets a function-calling schema · MCP server exposes a tool · validation and permissions identical everywhere.

route.ts

export const { POST, tools } = endpointsHandler({
  endpoint: contactEndpoints,
  [Methods.POST]: {
    email: [{ render: renderCompanyMail, ignoreErrors: false }],
    handler: ({ data, user, locale, logger, t }) =>
      ContactRepository.submitContactForm(data, user, locale, logger, t),
  },
});

Access control - one array

allowedRoles: [
  UserRole.PUBLIC, // who can call it
  UserRole.CLI_OFF, // block CLI + MCP
  UserRole.AI_TOOL_OFF, // block AI tool discovery
  UserRole.MCP_VISIBLE, // opt-in: appear in MCP tool list
  UserRole.REMOTE_SKILL, // opt-in: appear in AGENT.md skill files
  UserRole.PRODUCTION_OFF, // disable in production
];

AI Is Not a Feature. It's a Team Member.

The agent operates through the same contracts as every human user. When Thea calls your contact endpoint, she hits the same definition.ts and route.ts as the browser. Same validation. Same permissions. No special API.

Skills (skill.ts)

A skill is a saved AI configuration: persona, model selection, tool whitelist. Users or the AI create them, favorite them, and on the next turn the model already knows what sub-agents are available.

This is how delegation works. A cheap orchestrator handles the conversation. When it needs serious writing, it calls master-writer - pinned to Claude Opus. Research? researcher - Grok with search tools. The expensive model only runs when that specific capability is needed. Any skill can call any other. Users shape the team; the AI routes automatically.

The generated .md skill file is machine-readable - Claude Code, Cursor, or any MCP client can discover and call skills directly. Skills are context-efficient by design: skill-create pins only help-tool and execute-tool. One call to help-tool returns the full schema for any tool on demand.

Thea + Hermes

              +------------------+
              |   Central Thea   |  (Production - always on)
              |   AI team lead   |
              +--------+---------+
                       |  remote connection (sync every 60s)
           +-----------+-----------+
           |                       |
    +------+-------+       +------+-------+
    |   Hermes     |       |   Hermes     |   (Developer machines)
    | Dev Instance |       | Dev Instance |
    +--------------+       +--------------+

Thea runs 24/7 on production. Talks to users, manages tasks, coordinates work. Not an assistant - the AI team lead.

Hermes is the local worker. vibe remote-connect links your machine. The pulse syncs memories, capabilities, and tasks every 60 seconds. Thea discovers local tools via help(instanceId="hermes"), executes remotely, routes coding tasks to the right machine.

Capabilities: 125+ AI chat models · skill delegation · persistent memories · tool calling (any endpoint) · task scheduling · MCP · any-to-any modality (text · image · audio · video · music)


Vibe Sense

A dataflow engine built on the same endpoint pattern. Every node is an endpoint.

DataSource → Indicator → Transformer → Evaluator → Action

An EMA node is vibe analytics/indicators/ema --period=14 --source=leads-created. A threshold evaluator is vibe analytics/evaluators/threshold --value=... --threshold=100. Chain them into a graph. Same contracts. Same type safety.

Graph builder canvas is live in admin. Backtest replays any strategy over history - evaluator calls are intercepted so nothing fires. Mix timeframes freely.

Ships with seeds: lead funnel monitoring, credit economy health, user growth tracking.

Use cases: business metrics · trading strategies · IoT anomaly detection · email deliverability · any pipeline that's data → conditions → actions.

Vibe Sense docs


Type Safety

  • Translations are compile-time checked. t("contact.form.fields.name.label") compiles. t("typo.here") is a compiler error. Three languages.
  • Error types are exhaustive. Every endpoint declares its possible errors. Miss one, compiler fails.
  • Schemas flow end-to-end. One Zod schema validates the API, types the hooks, generates CLI flags, constrains the AI tool schema. Zero drift.
  • vibe check runs everything. Oxlint + ESLint + TypeScript in parallel. One command. No shortcuts.

616+ endpoints. 557+ definitions. Zero any. Zero unknown casts. Zero runtime type errors.

@next-vibe/checker ships as a standalone npm package for any TypeScript project.


Unbottled.ai - The Flagship

NextVibe is the engine. Unbottled.ai is the product. Like WordPress.org vs WordPress.com - fork and deploy your own, or use ours.

Free speech AI. 125+ chat models. Users choose their own content filtering level.

  • AI Chat - Multi-model, branching message trees, skills, memories, favorites
  • Payments - Stripe + NowPayments (crypto), credits, referral program
  • Communication - React Email, SMTP/IMAP client, automated campaigns
  • Lead System - Journey workflows, CSV import, engagement analytics
  • Admin - Auto-generated panels, database studio, health monitoring, cron dashboard
MetricValue
TypeScript files8,300+
Lines of code2,100,000+
Endpoint definitions616+
Platforms per endpointUp to 13
Database tables28+
Languages (compile-time checked)3 (en, de, pl)
Runtime type errors0

Tech Stack

LayerTechnology
RuntimeBun
LanguageTypeScript 7 / TSGO (strict mode)
WebTanStack Start + Vite Nitro (dev) · Next.js 16 (prod) · React 19 · Tailwind CSS 4 · shadcn-derived UI
MobileReact Native, NativeWind 5, Expo Router
DesktopElectron 40
DatabasePostgreSQL + Drizzle ORM
ValidationZod - one schema, all platforms
AIClaude Code, OpenRouter
MCPModel Context Protocol server
QualityVibe checker (Oxlint + ESLint + TypeScript)
EmailReact Email + SMTP/IMAP
PaymentsStripe, NowPayments

CLI

# Dev & production
vibe dev                    # dev server + embedded DB (add -r to reset, --port=N)
vibe build                  # build for production
vibe start                  # start production + cron tasks
vibe rebuild                # check + rebuild + hot-restart (zero downtime)

# Quality
vibe check                  # lint + typecheck in one command
vibe check src/path file.ts # check specific files

# Database
vibe migrate                # run pending migrations
vibe migrate --generate     # generate from schema changes
vibe seed / vibe reset      # seed / drop + migrate + seed
vibe studio                 # Drizzle Studio (browser DB GUI)
vibe sql "SELECT ..."       # raw SQL

# Any endpoint = a command
vibe web-search "quantum computing"
vibe analytics/indicators/ema --period=14 --source=leads-created

# MCP + remote
vibe mcp                    # start MCP server
vibe remote-connect --help
vibe help                   # list everything

Docs


Roadmap

New Platforms

Every new platform is a renderer + one permission marker. The definition already has everything it needs.

#PlatformWhat it unlocks
1Trading EndpointsExchange connectivity as first-class endpoints. Feeds Vibe Sense natively - price, P&L, positions as data sources.
2Browser ExtensionEndpoints as browser actions. Right-click → "Add to leads" → fires. Definition drives the popup UI.
3Voice / TelephonyEndpoints callable via phone. Field labels become IVR prompts, Zod validates STT output. TTS + STT already in platform.
4Actionable EmailEndpoints callable from email via signed tokens. Approve, confirm, trigger - no browser required.
5Spreadsheet / GridCollection endpoints as live editable grids. Columns from response fields, validation from Zod.
6Webhook ReceiverInbound webhooks. Definition declares payload schema, validates, feeds Vibe Sense.
7GraphQLGenerated live from the registry. No .graphql files. Subscriptions map to WebSocket events.
8OpenAPI / SwaggerOpenAPI 3.1 spec generated live. Always current because it IS the definition.
9Automation PlatformsEndpoints as Zapier/Make/n8n triggers and actions. Your platform appears as a native app.
10Slash CommandsEndpoints as slash commands in Notion, Linear, Slack.
11QR / NFCEndpoints reachable via scan or tap with pre-filled params and signed tokens.
12PDF / DocumentsResponse fields renderable as invoices, contracts, reports. Schema defines structure.
13IoT / MQTTEndpoints as MQTT topics. Sensor → validate → Vibe Sense → anomaly → action.
14AR / SpatialResponse fields as spatial UI. Vision Pro, Quest, WebXR.
15Print / LabelStructured output as shipping labels, receipts. ZPL for thermal, PDF for standard.
16WearableSingle-action endpoints as watch complications. Vibe Sense signals as glanceable indicators.
17Game EngineUnity/Unreal/Godot SDK calls. Leaderboards, matchmaking, analytics - typed endpoints.
18BlockchainSchemas mapped to smart contract ABI. Zod validates on-chain data.
19A2A (Agent-to-Agent)Google/LF Agent-to-Agent protocol. The definition already contains everything an Agent Card needs.
20Remote Tool RenderingVibeFrame renders remote endpoints without a local server. The definition travels with the widget.

Framework & Ecosystem

#FeatureWhat it does
1Module StoreRegistry of plug-and-play feature repos. Clone into your instance with one command.
2Import-Aware Setup WizardFirst install scans imports, removes unselected modules. No dead code.
3Module Dependency GraphStatic analysis knows which files depend on which features. Safe removals, safe upgrades.
4Vibe Sense PolishInline param editing, live chart preview, backtest UI, mobile-responsive canvas.
5Multi-TenantIsolated data, custom branding, per-tenant feature flags and Vibe Sense graphs.
6Plugin APIExtend without forking. Plugins register endpoints, tables, seeds, i18n, nav items.
7Visual Admin BuilderDrag endpoint widgets onto a canvas. Output is config, not generated code.
8Native ParityProduction-ready React Native components. Same types, same props - looks native, not "runs on native."
9FederationVibeFrame renders remote endpoints from connected instances inside your admin panel.
10Marketplace & Revenue ShareModule authors publish, set prices, earn on installs. The ecosystem funds itself.

License

GPL-3.0 + MIT - Framework core is GPL-3.0 (share improvements back). Everything else is MIT.

LICENSE · CONTRIBUTING.md

vibe check must pass with zero errors. Zero any, unknown, object, @ts-expect-error, as, eslint-disable. Then PR.


Creator: Marcus Brandstatter (max@a42.ch) · AI Contributors: Claude Code, Augment, Cursor

Issues · Discussions