Thank you for your interest in contributing to the Dify Knowledge Client! This document provides guidelines for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/DifyKnowledgeClient.git - Create a new branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests (when available)
- Commit your changes:
git commit -am 'Add new feature' - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Copy
.env.exampleto.envand add your Dify API credentials -
Run the CLI:
python cli.py
- Follow PEP 8 guidelines
- Use meaningful variable and function names
- Add docstrings to all functions and classes
- Keep functions focused and small
- Add type hints where appropriate
When adding new features:
- API Methods: Add them to the appropriate manager class in
dify_client/ - CLI Commands: Update the relevant menu in
cli.py - Documentation: Update the README and add examples if needed
- Error Handling: Ensure proper error handling with meaningful messages
Currently, the project doesn't have automated tests. When adding tests:
- Use pytest for testing
- Place tests in a
tests/directory - Mock API calls to avoid requiring actual API credentials
- Test both success and error cases
- Update the README for any new features
- Add docstrings to new functions and classes
- Include usage examples for complex features
- Update the API documentation if endpoints change
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Small PRs: Keep pull requests focused on a single feature or fix
- Documentation: Update relevant documentation
- Examples: Add examples for new features
When reporting issues:
- Check if the issue already exists
- Use a clear, descriptive title
- Include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages (if any)
- Environment details (OS, Python version)
Feature requests are welcome! Please:
- Check if the feature has already been requested
- Provide a clear use case
- Explain why this feature would be valuable
- If possible, suggest an implementation approach
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Respect different viewpoints and experiences
If you have questions about contributing, feel free to:
- Open an issue with the "question" label
- Start a discussion in the GitHub Discussions tab
Thank you for contributing to make Dify Knowledge Client better!