This is a simple calculator app running in CLI. It supports basic arithmetic operations like addition, subtraction, multiplication, and division. It works by parsing user input and performing the requested operation.
- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division
Each operation is now its own command. Run the application as follows:
python calculator.py add 5 3
# Result: 8
python calculator.py subtract 10 4
# Result: 6
python calculator.py multiply 2 3
# Result: 6
python calculator.py divide 8 2
# Result: 4.0python -m unittest test_calculator.py- Python 3.x
- Typer for CLI
- Unit tests to verify
- Easy to use CLI interface
I want to update our calculator.py so that the divide function handles division by zero gracefully (by returning None instead of raising an exception). Also, update the corresponding unit test in test_calculator.py to check this new behavior.
Run a linter and formatter across all Python files. Automatically fix issues, commit the changes, and provide a summary of what was fixed.
This really shows the power of agent mode, as it can directly interact with VS Code and the codebase to make changes, run tests, and commit updates.
Check the codebase for any todos and get them done.
I want to create a Makefile for this project that includes targets for running the application, running tests, and cleaning up temporary files.
I want to add a new operation to our calculator.py that calculates the modulus of two numbers. Update the CLI to support this operation and add a corresponding unit test in test_calculator.py. Update docs
I want the program to handle input values such as 1/3.
Setup a github action workflow that runs the tests and linters on every pr. Enable Dependabot for python and github actions. Update the README to reflect these changes.
I also want developers to easily set up the project for local development in Windows, not only Linux. Use GitHub's MarkDown syntax to make it look pretty.
- Clone the repository:
git clone https://github.com/BobcatProgrammer/agent-mode-demo
cd agent-mode-demo- Create a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the application:
python calculator.py calculate add 5 3- Run tests:
python -m unittest test_calculator.pyThis project is licensed under the MIT License - see the LICENSE file for details.