Contributing to cocommit

March 23, 2025 ยท View on GitHub

Welcome, and thank you for your contribution! For minor changes, feel free to create a pull request. For larger updates, please open an issue or reach out to the maintainers directly.

Contribute to UX

Cocommit is a user-friendly tool designed to simplify interactions with Large Language Models (LLMs). However, configuring the right combination of command-line options for a chosen LLM can be challenging, often requiring users to reference LangChain documentation (here and here).

To make usage easier, Cocommit supports shortcuts โ€” named sets of command-line options. Instead of manually entering these options, users can invoke a shortcut, which automatically applies the required settings.

You can list all available shortcuts by running and run them:

cocommit --show-shortcuts
cocommit -s shortcut_name

If you have access to an LLM supported by LangChain and no shortcut exists yet, your contribution is highly welcomed.

How to contribute a shortcut

Follow these steps to add a new shortcut:

  1. Check if a shortcut for your LLM already exists (or if an existing one could be improved).
  2. Set up a local development environment (see instructions below).
  3. Add your shortcut and test it.
  4. Submit a pull request.

More Complex Contributions

Cocommit v2 is currently under development. See the cocommit-v2 for details. If you have ideas for new features or improvements, feel free to:

  • Open an issue on GitHub.
  • Contact the project maintainer directly.

Local Development

Cocommit is a Python project that uses Poetry for dependency management. To set up a development environment:

  1. Clone the repository:
    git clone https://github.com/andrewromanenco/cocommit.git
    cd cocommit
    
  2. Install dependencies:
    poetry install
    
  3. Run tests to ensure everything works:
    poetry run test
    
  4. Check code quality with the linter:
    poetry run ruff check .
    
  5. Execute Cocommit from your local copy:
    poetry run cocommit <options>
    

If you want to install Cocommit from the source:

poetry run test
poetry build
pip install dist/cocommit-VERSION.whl

Adding a Shortcut

To add a new shortcut:

  1. Edit the cocommit/shortcuts.py file.
  2. Run:
    poetry run cocommit -s <shortcut-name>
    

Editing the LLM Prompt

To modify the LLM prompt (you may want to add your project-specific instructions):

  1. Edit the prompt file:
    nano cocommit/llm_prompts/prompt.llm
    
  2. Run tests to verify your changes:
    poetry run test