A rough AI-powered CLI that generates client-side Jaspr web apps from text prompts. Built with Python, Google Gemini, and Rich for CLI output.
Right now:
Many features are incomplete or unreliable
AI project generation isn’t consistent
The pipeline needs refactoring
Some generated code doesn’t run without manual fixes
So if you open the repo and think “why is this written like this?” …the answer is: because I was trying things 😂
- Python 3.8+
- Dart SDK (for running generated Jaspr projects)
- Google Gemini API key
-
Clone or download the repository:
git clone <repo-url> cd jaspr-cli-generator
-
Install dependencies:
pip install -r requirements.txt
Or, for global installation (recommended):
pip install . (Run as administrator )(Run as administrator on Windows for system-wide installation, making
jaspraiavailable globally) -
Set up environment:
- Create a
.envfile with your Gemini API key:GEMINI_API_KEY=your_api_key_here - Get the key from Google AI Studio
- Create a
-
Run the CLI:
jasprai
(If installed locally, use
python cli.py)
- Start with
jasprai. - Enter prompts like:
build a portfolio sitecreate an e-commerce landing page
- Use
helpfor commands,exitto quit.
project_name/
├── lib/
│ ├── main.dart # Entry point
│ ├── app.dart # Main app component
│ ├── pages/ # Page components
│ └── components/ # Reusable components
├── web/
│ ├── index.html # HTML template
│ ├── styles.css # Custom styles
│ └── tailwind.css # Tailwind CSS (if used)
└── pubspec.yaml # Dependencies and config
-
Navigate to the project:
cd project_name -
Install dependencies:
dart pub get
-
Serve the app:
dart run jaspr serve
-
Build for production:
dart run jaspr build
- ai.py: Handles AI prompts using Gemini API, parses JSON responses.
- generator.py: Writes files from AI-generated structure, skips directories.
- cli.py: Interactive shell with Rich UI for user interaction.
- prompts.py: Contains SYSTEM_PROMPT for guiding AI generation.
- previews/preview.py: Rich-formatted file previews.
- User enters prompt (e.g., "build a blog").
- AI analyzes prompt, plans structure, outputs JSON with
filesandcommands. - Generator creates files, runs commands (e.g.,
dart pub get). - Preview shows results.
- Import Errors: Clear
__pycache__and restart. - AI No Response: Check API key, internet, or prompt length.
- Generation Issues: Ensure prompts are descriptive (e.g., "build a simple website").
- Rich UI Not Working: Install
richvia pip.
Thanks for stopping by! Whether you’re fixing a bug, improving documentation, adding features, or just exploring — you’re welcome here.
Your contributions, ideas, and feedback mean a lot and help this project grow stronger.
Feel free to open an issue, start a discussion, or submit a pull request anytime.
Let’s build something awesome together! 🚀
- Fork the repo.
- Create a feature branch.
- Make changes, test with
jasprai. - Submit a PR with description.
- Keep code clean, add comments.
- Update docs for new features.
- Test AI prompts thoroughly.
MIT License. See LICENSE file for details.
NOTE: I built this README in a bit of a hurry, so if you notice anything missing or have suggestions, feel free to reach out. You can message me on Discord (ID on my profile).