Overview
Replace local AI integration with hosted PromptCode API for better performance and centralized prompt logic.
API Integration
- Endpoint:
https://vibesdiy.work/api/prompts/code
- Method: POST (streaming response)
- Auth: None required for CLI usage
Request Format
{
"userPrompt": "react dashboard with charts",
"stream": true,
"temperature": 0.7
}
Implementation Tasks
Benefits
- Eliminates code duplication with vibes.diy
- Uses proven prompt composition system
- Reduces CLI bundle size
- Gets Memphis Group styling and library selection
Technical Details
The endpoint uses the same sophisticated prompt composition logic as vibes.diy:
- Dynamic LLM module selection based on user prompt
- Memphis Group 1980s design aesthetic
- Fireproof database integration
- callAI structured outputs
- Tailwind CSS styling
Response is a streaming React component that can be parsed to extract:
- Import statements for package.json dependencies
- Component code for App.jsx
- Styling patterns for project structure
CLI Usage Pattern
// create-vibe will call:
const response = await fetch("https://vibesdiy.work/api/prompts/code", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
userPrompt: "react dashboard with charts",
stream: true
})
});
Example Flow
- User runs:
npm create vibe "todo app with drag and drop"
- CLI calls PromptCode API with user's prompt
- API responds with streaming React component using react-beautiful-dnd
- CLI extracts dependencies from import statements
- CLI scaffolds project with proper package.json and component files
- User gets fully configured project ready for development
This approach leverages the same AI system that powers vibes.diy while providing a traditional CLI scaffolding experience.
Overview
Replace local AI integration with hosted PromptCode API for better performance and centralized prompt logic.
API Integration
https://vibesdiy.work/api/prompts/codeRequest Format
{ "userPrompt": "react dashboard with charts", "stream": true, "temperature": 0.7 }Implementation Tasks
src/ai/api-client.ts)Benefits
Technical Details
The endpoint uses the same sophisticated prompt composition logic as vibes.diy:
Response is a streaming React component that can be parsed to extract:
CLI Usage Pattern
Example Flow
npm create vibe "todo app with drag and drop"This approach leverages the same AI system that powers vibes.diy while providing a traditional CLI scaffolding experience.