Thank you for considering contributing to gptme-contrib! This guide will help you get started.
There are two ways to contribute tools:
Script tools are standalone scripts that can be run via the shell tool. This is the recommended approach as it:
- Keeps dependencies isolated
- Makes testing easier
- Allows independent use
- Simplifies maintenance
Example script tool in Python, using uv
script dependencies:
#!/usr/bin/env -S uv run
# dependencies = [
# "requests>=2.31.0",
# "rich>=13.7.0",
# ]
import sys
from rich import print
def main():
print("[bold green]Hello from a script tool![/bold green]")
if __name__ == "__main__":
main()
Requirements:
- Place in the
scripts/
directory - Use shebang:
#!/usr/bin/env -S uv run
- Declare dependencies in comments
- Include basic documentation
- Handle errors gracefully
For cases where you need deeper gptme integration (e.g., for attaching files/images), you can create a custom tool in src/gptme_contrib/tools/
.
See the custom tools documentation for details.
Testing is encouraged but not required. If you want to add tests:
- Create a test file in the
tests/
directory - Use pytest for testing Python tools
- Fork the repository
- Create a feature branch
- Add your tool and documentation
- Submit a pull request
We aim to review PRs within a few days.
- Follow PEP 8
- Use type hints where helpful
- Keep it simple
- Handle errors gracefully
- Document assumptions
Feel free to:
- Open an issue for questions
- Join our Discord
- Ask in the Discussions