CoCoder is a CLI tool designed to help manage changes in a project by leveraging AI to generate and apply modifications. This tool is particularly useful for developers looking to automate the process of making specific changes across their codebase.
To install CoCoder, you need to have Python 3.x installed on your system. You can install CoCoder via pip:
pip install git+https://github.com/SappieKonig/CoCoder.gitCoCoder provides a simple CLI interface to interact with your project. Here are the basic commands:
To request changes and apply them to a new branch, use the build command:
coco build --request "Your change request here" --branch new-feature-branch--requestor-r: The change you want the model to make. This option is required.--branchor-b: The branch to move the change to. If not provided, changes will be applied to the current branch, and the user will be alerted. Branch names with multiple words will be joined with underscores (e.g.,new feature branchbecomesnew_feature_branch).--root_diror-d: The directory where the.gitis located (default is the current directory).--extensionsor-e: File extensions to consider (default is.py,.md).--commitor-c: Whether to commit changes immediately (default isFalse).
To set default values for root_dir, extensions, and deepseek_api_key, use the set_config command:
coco set_config --root_dir . --extensions ".py .md" --deepseek_api_key YOUR_API_KEY--root_diror-d: The directory where the.gitis located (default is the current directory).--extensionsor-e: File extensions to consider (default is.py).--deepseek_api_key: Your DeepSeek API key for authentication.
To add new file extensions to the existing list, use the add_extensions command:
coco add_extensions --extensions ".txt .js"--extensionsor-e: File extensions to add to the list. This option is required.
coco build --request "Add a function to calculate the sum of two numbers" --branch add-sum-functionThis command will create a new branch named add-sum-function, apply the requested change, and commit the changes to the new branch if the --commit option is specified.
Here's a small example of what input CoCoder might receive after preprocessing a repository with only a main.py containing print(1+2):
.gitignore
LICENSE
package/main.py
{
"file_path": "./main.py",
"content": "print(1+2)"
}Contributions are welcome! Please read the contributing guidelines to get started.
This project is licensed under the MIT License - see the LICENSE file for details.