A simple command-line task manager built specifically to teach Cursor IDE features and AI-powered development.
This project demonstrates key Cursor features:
- Smart autocomplete for Python functions and classes
- Context-aware suggestions based on your code
- Import statement auto-completion
- Ask questions about the code
- Get explanations for complex functions
- Request code improvements and optimizations
- Generate new functions with natural language
- Create test cases automatically
- Add documentation and comments
- AI understands relationships between files
- Smart refactoring across multiple files
- Consistent coding patterns
- ✅ Add new tasks with descriptions
- 📋 List all tasks or filter by status
- ✓ Mark tasks as complete
- 🗑️ Delete tasks with confirmation
- 💾 Persistent storage (JSON file)
- 🎨 Colorful CLI interface
- 🧪 Unit tests included
pip install -r requirements.txtpython main.pypython test_task_manager.pyTry these exercises to learn Cursor features:
- Open any Python file
- Press
Cmd+K(Mac) orCtrl+K(Windows/Linux) - Ask: "Explain what this function does"
- Ask: "How can I improve this code?"
- Place cursor in a class or function
- Press
Cmd+I(Mac) orCtrl+I(Windows/Linux) - Type: "Add a method to search tasks by keyword"
- Watch Cursor generate the code!
- Select a block of code
- Press
Cmd+Kand ask: "Refactor this to be more efficient" - Compare the suggestions with your original code
- Open
task_manager.py - Select a method you want to test
- Press
Cmd+Iand type: "Generate unit tests for this method" - Add the tests to
test_task_manager.py
- Select a function without docstrings
- Press
Cmd+Iand type: "Add comprehensive docstring" - Watch Cursor add proper Python documentation
- Start typing function names - watch intelligent suggestions
- Import modules - Cursor knows what you need
- Variable names - consistent naming suggestions
- Cursor highlights potential issues
- Suggests fixes for common problems
- Helps with type hints and annotations
- Hover over complex code for explanations
- Ask Cursor to explain algorithms or logic
- Get suggestions for code improvements
cursor-tutorial/
├── main.py # Main CLI application
├── task_manager.py # Core task management logic
├── test_task_manager.py # Unit tests
├── requirements.txt # Python dependencies
├── README.md # This file
├── .gitignore # Git ignore patterns
└── tasks.json # Data file (created when you add tasks)
# Adding a task
manager = TaskManager()
task = manager.add_task("Learn Cursor IDE", "Practice AI-powered coding")
# Listing tasks
all_tasks = manager.list_tasks()
pending_tasks = manager.list_tasks(show_completed=False)
# Completing a task
manager.complete_task(task.id)
# Deleting a task
manager.delete_task(task.id)Run the comprehensive test suite:
python -m unittest test_task_manager.py -vTests cover:
- Task creation and completion
- Task manager operations
- Data persistence
- Error handling
- Explore the AI Chat: Ask questions about any part of the code
- Try Code Generation: Add new features using natural language
- Experiment with Refactoring: Ask Cursor to improve your code
- Learn from Suggestions: Pay attention to Cursor's recommendations
- Build Your Own Features: Use Cursor to add new functionality
- Be Specific: When asking for code generation, be detailed about what you want
- Use Context: Cursor understands your entire project, not just one file
- Iterate: Use the AI suggestions as starting points and refine them
- Learn Shortcuts: Master
Cmd+Kfor chat andCmd+Ifor inline generation - Explore Settings: Customize Cursor to match your workflow
- Multi-file editing: Make changes across multiple files simultaneously
- Git integration: AI-powered commit messages and code reviews
- Terminal integration: Get help with command-line tasks
- Code explanations: Understand complex algorithms and patterns
- Performance optimization: Get suggestions for improving code efficiency
Happy coding with Cursor! 🎉