RefactorCode
A console application to reduce bugs, improve performance and improve readability of your code.
RefactorCode.mov
Features
- Checks for any bugs and corrects them (out of bounds, performance issues, logical bugs).
- Removes commented out and unreachable code.
- Adds comments to explain existing code.
- Splits very large functions into smaller functions for better modularity.
Usage
refactorcode ./yourfile
By the refactored code is displayed in the console. To specify an output file, use -o
. See Options
Setup Instructions
Clone the repo:
git clone https://github.com/brokoli777/RefactorCode.git
Install node libraries
pnpm install
OR
npm install
Get an API Key from here: https://ai.google.dev/aistudio
Create a .env file and add the API key like this:
API_KEY=YOURAPIKEYHERE
Link the application
npm link
Run the application
refactorcode examples/test.py
Options
-m or --model: Allows to specify the model
Choices:
-
1.5f (gemini-1.5-flash) (default)
-
1.5p (gemini-1.5-pro)
refactorcode examples/test.py -m 1.5p
-o or --output- Allows to set the…