A basic CLI application for having conversations with AI using the Vercel AI SDK v5.
-
Install dependencies:
npm install
-
Configure API Key:
Copy
.env.exampleto.envand add your OpenAI API key:cp .env.example .env
Then edit
.envand replaceyour_api_key_herewith your actual OpenAI API key.Get your API key from: https://platform.openai.com/api-keys
Start the chat:
npm startCommands:
- Type your message and press Enter to chat
- Type
exitorquitto end the conversation
- Interactive CLI conversation
- Maintains conversation history throughout the session
- Uses OpenAI's GPT-4o-mini model via Vercel AI SDK v5
- MCP Integration: Connects to Civic MCP server (nexus.civic.com) via StreamableHTTP
- Automatically loads and uses tools from the MCP server
- API key configurable via .env file or prompted at runtime
Run in watch mode:
npm run devBuild TypeScript:
npm run build