Orbit CLI is a comprehensive AI-powered tool that combines a command-line interface (CLI) with a web-based user interface. It provides secure authentication, device management, and interactive AI chat capabilities in multiple modes.
- Authentication: Secure login/logout with device flow authentication
- AI Chat Modes:
- Simple Chat: Basic conversational AI interactions
- Tool Calling: Enhanced chat with access to tools like Google Search and code execution
- Agentic Mode: Advanced AI agent capabilities (coming soon)
- User Management: View current user information and session status
- User Authentication: Secure sign-in and sign-out functionality
- Device Management:
- Device authorization using user codes
- Device approval workflow
- User Profile: View and manage user information
- Responsive Design: Modern UI built with Next.js and shadcn/ui components
- User Management: Store user profiles, sessions, and accounts
- Conversation History: Persistent chat conversations and messages
- Device Codes: Handle device flow authentication codes
- Verification: Email and device verification support
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Node.js, Express.js, Prisma ORM
- Database: PostgreSQL
- Authentication: Better Auth with device flow
- AI Integration: Google AI SDK, Vercel AI SDK
- CLI Framework: Commander.js
- Node.js (v18 or higher)
- PostgreSQL database
- npm or yarn package manager
-
Clone the repository:
git clone <repository-url> cd "Orbit CLI"
-
Install server dependencies:
cd server npm install -
Install client dependencies:
cd ../client npm install -
Set up environment variables:
Create a
.envfile in theserverdirectory with the following variables:# AI Configuration GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_api_key ORBITAI_MODEL=gemini-1.5-pro # GitHub OAuth GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret # Database DATABASE_URL=postgresql://username:password@localhost:5432/database_name # Auth Configuration BACKEND_URL=http://localhost:3005 TRUSTED_ORIGINS=http://localhost:3000 CORS_ORIGIN=true CORS_CREDENTIALS=true DEVICE_EXPIRES_IN=30m DEVICE_INTERVAL=5s
For the client, create a
.env.localfile in theclientdirectory:NEXT_PUBLIC_API_URL="http://localhost:3005" NEXT_PUBLIC_CLIENT_URL="http://localhost:3000"
-
Set up the database:
cd server npx prisma migrate dev npx prisma generate
-
Start the server:
cd server npm run devThe server will run on
http://localhost:3005 -
Start the client (in a new terminal):
cd client npm run devThe web app will be available at
http://localhost:3000
The CLI tool is available as orbit command after installation.
-
Install the CLI globally (optional):
cd server npm link -
Authentication:
- Login:
orbit login - Logout:
orbit logout - Check current user:
orbit whoami
- Login:
-
AI Interaction:
- Start AI session:
orbit wakeup - Choose from chat modes: Simple Chat, Tool Calling, or Agentic Mode
- Start AI session:
- Sign In: Navigate to
/sign-into authenticate - Device Authorization: Use
/deviceto enter device codes - Device Approval: Approve devices at
/approve - User Profile: View profile information on the home page
The application uses Prisma ORM with the following main models:
- User: User accounts with authentication details
- Session: User sessions and tokens
- Account: OAuth and social login accounts
- Conversation: Chat conversations with different modes
- Message: Individual messages within conversations
- DeviceCode: Device flow authentication codes
- Verification: Email and device verification records
-
Build the client:
cd client npm run build npm start -
Build the server:
cd server npm run cli # For CLI usage
- Client:
npm run lintin the client directory - Server: ESLint configuration in server directory
- Connect your repository to Render
- Set build settings:
- Build Command:
npm install && npx prisma generate - Start Command:
npm run dev
- Build Command:
- Add environment variables in Render dashboard:
# AI Configuration GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_api_key ORBITAI_MODEL=gemini-1.5-pro # GitHub OAuth GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret # Database (Supabase or other PostgreSQL) DATABASE_URL=postgresql://username:password@host:5432/database?sslmode=require&pgbouncer=true&connection_limit=1 # Auth Configuration BACKEND_URL=https://your-render-app.onrender.com TRUSTED_ORIGINS=https://your-frontend-domain.com CORS_ORIGIN=true CORS_CREDENTIALS=true DEVICE_EXPIRES_IN=30m DEVICE_INTERVAL=5s # Render specific NODE_ENV=production
- Database setup:
- Use Supabase, Neon, or another PostgreSQL provider
- Ensure the database allows connections from Render's IP ranges
- Use connection pooling for better performance:
?pgbouncer=true&connection_limit=1
If you encounter database connection errors on Render:
- Check DATABASE_URL: Ensure it's correct and accessible from external connections
- SSL Mode: Use
sslmode=requirefor Supabase - Connection Pooling: Add
pgbouncer=true&connection_limit=1for serverless environments - Database Permissions: Ensure your database user has proper permissions
- Firewall: Make sure your database allows connections from Render's servers
- Database Connection Timeout: Use a database with better connection pooling
- Memory Limits: Monitor your app's memory usage
- Cold Starts: Expected for free tier, consider upgrading for better performance
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
ISC License
For issues and questions, please create an issue in the repository.