[Unmaintained] CoreGRAi study-assistant CLI -- use the web app at https://coregrai.com
Project description
GRAi CLI
DEPRECATED -- this package is no longer maintained. Some commands no longer work against the current CoreGRAi service. Use the web app instead: https://coregrai.com
AI-powered study assistant for the ACR Core Exam and diagnostic radiology
Overview
GRAi CLI brings the power of AI-assisted radiology education to your terminal. Study for the ACR Core Exam with interactive chat, practice quizzes, and comprehensive lessons - all from the command line.
Features
- Interactive Chat: Ask questions about any radiology topic and get AI-powered explanations
- Practice Quizzes: Board-style questions with adaptive difficulty
- Comprehensive Lessons: 572+ pre-generated lessons covering all ACR topics
- Progress Tracking: Monitor your study statistics and performance
- Offline Export: Save lessons to markdown files for offline study
- Beautiful Terminal UI: Rich, colorful interface with syntax highlighting
Installation
From PyPI (Recommended)
pip install grai-cli
From Source
git clone https://github.com/yourusername/grai-cli.git
cd grai-cli
pip install -e .
Requirements
- Python 3.8 or higher
- Active internet connection (for API access)
- GRAi account (free registration at https://coregrai.com)
Quick Start
1. Login
grai login
You'll be prompted for your email and password. Don't have an account? Register at https://coregrai.com
2. Ask Questions
# Single question
grai chat "What are the CT findings in pulmonary embolism?"
# Interactive chat session
grai chat -i
3. Take a Quiz
# Random quiz (5 questions)
grai quiz
# Topic-specific quiz
grai quiz --topic chest-ct --count 10
# Adaptive difficulty based on your performance
grai quiz --adaptive
4. Study Lessons
# List all available lessons
grai lesson --list
# Search for lessons
grai lesson --search "cardiac"
# Read a specific lesson
grai lesson chest-radiography-basics
5. Check Your Progress
grai stats
Usage Guide
Chat Commands
Single Query:
grai chat "Explain MRI sequences"
Interactive Mode:
grai chat -i
With Sources:
grai chat --sources "What is the ACR TI-RADS classification?"
Specify Model:
grai chat --model gemini "Describe CT protocols"
Quiz Commands
Basic Quiz:
grai quiz
Topic-Specific:
# Available topics: chest-xray, chest-ct, neuro-ct, neuro-mri,
# abdominal-ct, abdominal-mri, msk, nuclear-medicine, ultrasound, etc.
grai quiz --topic neuro-mri
Set Difficulty:
grai quiz --difficulty hard --count 10
Adaptive Mode:
# Questions adjust based on your performance
grai quiz --adaptive
Lesson Commands
List Lessons:
grai lesson --list
Search Lessons:
grai lesson --search "mri"
grai lesson --search "cardiac" --category cardiothoracic
Read a Lesson:
grai lesson chest-radiography-basics
Export Lesson:
grai export chest-radiography-basics --output ~/study/chest.md
Configuration
Show Current Config:
grai config --show
Change Server URL:
grai config --server https://your-server.com
View Statistics:
grai stats
Logout:
grai logout
Advanced Usage
Custom Server
If you're running your own GRAi instance:
grai config --server http://localhost:5000
grai login
Batch Operations
Study multiple topics in sequence:
# Create a study script
#!/bin/bash
grai quiz --topic chest-ct --count 5
grai quiz --topic chest-xray --count 5
grai quiz --topic neuro-ct --count 5
grai stats
Export Study Materials
Export all cardiothoracic lessons:
#!/bin/bash
for lesson in $(grai lesson --list --category cardiothoracic | grep -oP '^\S+'); do
grai export "$lesson" --output "study/${lesson}.md"
done
Configuration File
GRAi CLI stores configuration in ~/.grai/config.json:
{
"server_url": "https://coregrai.com",
"default_model": "deepseek",
"show_sources": false,
"color_output": true,
"auth_token": "<your-token>",
"user_email": "your@email.com"
}
Features in Detail
Interactive Chat
The interactive chat mode provides a conversational interface:
> You: What causes pneumothorax on chest x-ray?
GRAi: Pneumothorax appears on chest radiographs as...
[detailed explanation with key findings]
Sources:
1. Chest Radiography Fundamentals
2. Emergency Radiology - Pneumothorax
3. ACR Appropriateness Criteria
> You: How do you measure it?
...
Practice Quizzes
Board-style questions with immediate feedback:
Question 1/10:
A 45-year-old male presents with chest pain...
Which finding is most concerning?
1. Cardiomegaly
2. Pleural effusion
3. Pneumomediastinum
4. Atelectasis
Your answer: 3
Correct! Pneumomediastinum in the setting of chest pain
may indicate esophageal perforation, which requires urgent
evaluation.
Progress Tracking
Monitor your improvement:
Your Study Statistics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Questions Answered 847
Lessons Completed 42
Study Streak 14 days
Average Score 84.5%
Total Study Time 23h 15m
Areas to Focus On:
- Nuclear Medicine Physics
- Interventional Radiology
- Ultrasound Artifacts
Troubleshooting
Connection Issues
# Check server connectivity
curl https://coregrai.com/api/health
# Try alternative server
grai config --server https://backup.coregrai.com
Authentication Problems
# Re-login
grai logout
grai login
Clear Configuration
# Remove config file
rm ~/.grai/config.json
# Login again
grai login
Development
Setup Development Environment
git clone https://github.com/yourusername/grai-cli.git
cd grai-cli
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements-dev.txt
pip install -e .
Run Tests
pytest
pytest --cov=grai_cli
Code Formatting
black grai_cli/
flake8 grai_cli/
Build Package
python -m build
twine check dist/*
Publish to PyPI
# Test PyPI
twine upload --repository testpypi dist/*
# Production PyPI
twine upload dist/*
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Documentation: https://docs.coregrai.com
- Issues: https://github.com/yourusername/grai-cli/issues
- Email: support@coregrai.com
Changelog
See CHANGELOG.md for a list of changes.
Acknowledgments
- Built with Click
- Beautiful terminal output powered by Rich
- ACR content based on official ACR guidelines and appropriateness criteria
Made with ❤️ for radiology residents everywhere
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 coregrai-2.1.2.tar.gz.
File metadata
- Download URL: coregrai-2.1.2.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b86ebba352b13dc867c57ab305c5dc03abcf7a2406fee2f077f2a62ef50af503
|
|
| MD5 |
97f6b3471c60d7886db037fc8df52b31
|
|
| BLAKE2b-256 |
88cb0ec4de93b8b5ad9d8a60fd3514924b400f76e9c8d3438be0274d6a43e1f7
|
File details
Details for the file coregrai-2.1.2-py3-none-any.whl.
File metadata
- Download URL: coregrai-2.1.2-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
700eb15e53a4d4688132c41ef134f47a7929f2acb7d6eb4d1080a287ac06cad8
|
|
| MD5 |
81b4c3f0abe909129deb46bc38019ea2
|
|
| BLAKE2b-256 |
1335ffbfa0f1e11233e671910f564b5c8b9ed78dae5620c7057e91ab38bf78f9
|