An AI-powered Terminal UI (TUI) client and robust backend for next-generation developer tooling.
Nightcode is a modern, full-stack application built for the terminal. It provides a rich React-based CLI interface to interact with various AI models (OpenAI, Anthropic, Google) powered by a fast Hono backend running on Bun.
- Rich Terminal UI: Built with React, React Router, and
@opentui/corefor an interactive command-line experience. - Multi-Model AI: Seamless integration with the Vercel AI SDK to support Claude, Gemini, and ChatGPT.
- High-Performance Backend: A blazing fast REST API powered by Hono and Bun.
- Authentication & Billing: Integrated with Clerk for secure auth and Polar.sh for billing.
- Type-Safe Database: PostgreSQL persistence using Prisma ORM.
- Monorepo Architecture: Clean separation of concerns with
@nightcode/cli,@nightcode/server,@nightcode/database, and@nightcode/shared.
- Bun (v1.0 or later)
- PostgreSQL database
- API Keys for Clerk, Polar.sh, and your preferred AI providers (e.g., OpenAI, Anthropic, Google)
Note
Nightcode relies on several environment variables. Make sure to copy .env.example to .env and fill in your configuration before starting.
-
Install dependencies
bun install
-
Generate Database Client
cd packages/database && bun run db:generate
-
Start the Development Servers
You can run the CLI and the Server in separate terminals using the root scripts:
Start the server:
bun run dev:server
Start the CLI client:
bun run dev:cli
Nightcode is structured as a Bun workspace with the following packages:
packages/cli: The interactive Terminal UI (React + OpenTUI).packages/server: The Hono API backend handling chat streams, auth, billing, and session management.packages/database: Prisma schema and database client exports.packages/shared: Shared Zod schemas and TypeScript types.