TUI app that enriches prompts using Groq API and project context
Project description
Magic Prompt
A TUI and CLI tool that enriches short, vague prompts into detailed, structured prompts using Groq API and your project's actual file structure and codebase.
Features
- 📁 Project-Aware: Scans your project's file structure, config files, and extracts code signatures
- 🧠 AI-Powered: Uses Groq's fast LLM API to intelligently expand prompts
- ⚡ Real-Time Streaming: Watch the enriched prompt generate in real-time
- 🖥️ Dual Mode: Interactive TUI or headless CLI for shell scripting
Installation
From PyPI
pip install ai-magic-prompt
Or with uv:
uv tool install magic-prompt
From Source
git clone https://github.com/arterialist/magic-prompt.git
cd magic-prompt
pip install -e .
Setup
Get your Groq API key from console.groq.com/keys.
Set it as an environment variable:
export GROQ_API_KEY=gsk_...
Or create a .env file in your project directory:
GROQ_API_KEY=your_api_key_here
Usage
Headless CLI Mode
Run from anywhere as a shell command:
# Basic usage - enrich a prompt
magic-prompt "add user authentication"
# Pipe prompt from stdin
echo "add logging" | magic-prompt
# Specify project directory
magic-prompt -d /path/to/project "refactor the API"
# Quiet mode - only output result (good for piping)
magic-prompt -q "add tests" > enriched.md
CLI Options
| Option | Description |
|---|---|
-d, --directory |
Project directory (default: from config or cwd) |
-t, --tui |
Launch interactive TUI mode |
-q, --quiet |
Only output result, no progress |
--debounce MS |
Set debounce time for real-time mode |
--save-dir DIR |
Save default directory for future runs |
--show-config |
Show current configuration |
Interactive TUI Mode
magic-prompt --tui
# OR just run without arguments:
magic-prompt
- Enter your project's root directory path
- Type a short prompt (e.g., "add user authentication")
- Watch the enriched, project-aware prompt stream in real-time
- Press
Ctrl+Yto copy the enriched prompt
TUI Keyboard Shortcuts
| Key | Action |
|---|---|
Enter |
Submit prompt |
Ctrl+T |
Toggle real-time |
Ctrl+Y |
Copy to clipboard |
Ctrl+L |
Clear output |
Ctrl+R |
Rescan project |
Ctrl+Q |
Quit |
How It Works
- Scans your project directory structure
- Extracts docstrings, function signatures, and imports
- Sends context + your prompt to Groq's LLM
- Streams an enriched version that references actual files and APIs
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_magic_prompt-0.1.1.tar.gz.
File metadata
- Download URL: ai_magic_prompt-0.1.1.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de4eaf24324aa652f8628a24909be243350d5027ffea8b70029484bd52c59510
|
|
| MD5 |
5589f7c300bf1046e6ec14b3e9681cff
|
|
| BLAKE2b-256 |
c8e55a7757226a63f88df6971494c4c2380ff657448532d48447fffd75cf137a
|
Provenance
The following attestation bundles were made for ai_magic_prompt-0.1.1.tar.gz:
Publisher:
pypi-deploy.yml on arterialist/magic-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_magic_prompt-0.1.1.tar.gz -
Subject digest:
de4eaf24324aa652f8628a24909be243350d5027ffea8b70029484bd52c59510 - Sigstore transparency entry: 814805761
- Sigstore integration time:
-
Permalink:
arterialist/magic-prompt@e7cb077bfb502c0066d0e47ea9dd0be6c32bd722 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arterialist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@e7cb077bfb502c0066d0e47ea9dd0be6c32bd722 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ai_magic_prompt-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ai_magic_prompt-0.1.1-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
522f2ba405db2365d31963cbe71fdb03969451ea05cd2bdef94e5dfb97fb5439
|
|
| MD5 |
d1eccd4ddae1785fd9a1d9b4917021e5
|
|
| BLAKE2b-256 |
f9d23e400d59c6d91585791dd37fbd863824845ee229c03feb2ac390a3351287
|
Provenance
The following attestation bundles were made for ai_magic_prompt-0.1.1-py3-none-any.whl:
Publisher:
pypi-deploy.yml on arterialist/magic-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_magic_prompt-0.1.1-py3-none-any.whl -
Subject digest:
522f2ba405db2365d31963cbe71fdb03969451ea05cd2bdef94e5dfb97fb5439 - Sigstore transparency entry: 814805766
- Sigstore integration time:
-
Permalink:
arterialist/magic-prompt@e7cb077bfb502c0066d0e47ea9dd0be6c32bd722 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arterialist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@e7cb077bfb502c0066d0e47ea9dd0be6c32bd722 -
Trigger Event:
workflow_dispatch
-
Statement type: