A CLI coding assistant
You can install the package using below command. Make sure you have Python and pip installed on your system.
- pip install sarathi
To use certain features of this package, you need to set up your OpenAI API key. If you don't have one, you can sign up for an account on the OpenAI website. Once you have your API key, you can set it in your environment variables. Here's how you can do it:
- export OPENAI_API_KEY=YOUR_API_KEY
Sarathi provides a convenient command sarathi git autocommit
to generate commit messages for Git commits.
- Stage the files you want to commit
- Run
sarathi git autocommit
. This command will automatically analyze your staged changes (using git add .), generate a commit message, and if you confirm will commit your changes to the repository with the generate message
You can generate docstrings for your python code using commands such as below
- Run
sarathi docstrgen -f src/sarathi/code/codetasks.py
. This command analyze the methods in the file passed and generates docstrings for functions if they do not exist. - Run
sarathi docstrgen -d src/sarathi/
. This command analyzes the methods in all files presend in the directory specified and generates docstrings for functions if they do not exist.
- https://dev.to/taikedz/ive-parked-my-side-projects-3o62
- https://github.com/lightningorb/autocommit