This project integrates GitHub and other developer-focused services using the Composio Toolset. It provides essential actions for automating tasks related to repository management, collaboration, and more. (Uses OpenAI API and Composio API)
- Open AI API Registration: Sign up for a OpenAI account if you haven’t already.
- Composio Registration: Sign up for a Composio account if you haven’t already.
- Tool Registration: Register and integrate the tools you need, such as GitHub.
To install the necessary Python packages, run:
pip install -r requirements.txt
To add GitHub integration to your Composio setup, run:
composio add github
This command will open an interactive session in your browser to authenticate and configure the GitHub integration with Composio.
COMPOSIO Actions: https://raw.githubusercontent.com/ComposioHQ/composio/master/python/composio/client/enums/_action.py
These GitHub actions are commonly used by developers and IT professionals for managing repositories, issues, and pull requests. For a complete list of available actions, you can refer to the Composio Action Enum Source.
'GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER'
: Star a repository.'GITHUB_CREATE_AN_ISSUE'
: Create an issue in a repository.'GITHUB_CREATE_A_PULL_REQUEST'
: Create a pull request in a repository.'GITHUB_SEARCH_CODE'
: Search for code within repositories.'GITHUB_SEARCH_REPOSITORIES'
: Search for repositories.'GITHUB_GET_A_REPOSITORY'
: Get details about a repository.
'GITHUB_ADD_ASSIGNEES_TO_AN_ISSUE'
: Assign users to an issue.'GITHUB_LIST_ISSUES_ASSIGNED_TO_THE_AUTHENTICATED_USER'
: List issues assigned to the authenticated user.'GITHUB_CREATE_A_REPOSITORY_WEBHOOK'
: Create a webhook for repository events.
'GITHUB_GET_REPOSITORY_LANGUAGES'
: Get the languages used in a repository.'GITHUB_GET_COMMUNITY_PROFILE_METRICS'
: Retrieve community profile metrics for a repository.'GITHUB_GET_REPOSITORY_SECURITY_ADVISORIES'
: Get security advisories for a repository.
Automate tasks using Google services such as Google Drive and Gmail.
-
Google Drive
'GOOGLEDRIVE_FIND_FILE'
: Search for a file in Google Drive.'GOOGLEDRIVE_CREATE_FILE_FROM_TEXT'
: Create a new file in Google Drive from text content.
-
Gmail
'GMAIL_SEND_EMAIL'
: Send an email via Gmail.'GMAIL_CREATE_EMAIL_DRAFT'
: Create a draft email in Gmail.
Manage CI/CD pipelines and Git repositories with GitLab.
'GITLAB_CREATE_PROJECT_REPOSITORY_BRANCH'
: Create a new branch in a GitLab project repository.'GITLAB_DELETE_PROJECT_REPOSITORY_BRANCH'
: Delete a branch in a GitLab project repository.
This example stars a GitHub repository and creates an issue in it.
python script_name.py --openai_api_key 'your_openai_api_key' --composio_api_key 'your_composio_api_key' --task 'Star a repo and create a new issue' --actions 'GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER' 'GITHUB_CREATE_AN_ISSUE'
This example searches for specific code and repositories on GitHub.
python script_name.py --openai_api_key 'your_openai_api_key' --composio_api_key 'your_composio_api_key' --task 'Search for a specific code snippet in repositories' --actions 'GITHUB_SEARCH_CODE' 'GITHUB_SEARCH_REPOSITORIES'
This example finds a file in Google Drive and then sends an email via Gmail.
python script_name.py --openai_api_key 'your_openai_api_key' --composio_api_key 'your_composio_api_key' --task 'Find a file in Google Drive and send an email' --actions 'GOOGLEDRIVE_FIND_FILE' 'GMAIL_SEND_EMAIL'
This example stars a GitHub repository and creates an issue, saving the response to a file.
python script_name.py --openai_api_key 'your_openai_api_key' --composio_api_key 'your_composio_api_key' --task 'Star a repo and create a new issue' --actions 'GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER' 'GITHUB_CREATE_AN_ISSUE' --output_file 'output.txt'
The script logs actions and errors during execution, making it easier to debug and track issues. If an error occurs, it will be logged and raised appropriately. Additionally, if specified, the script can save the chat completion response to a file.
For further customization and advanced use cases, refer to the Composio Documentation for more detailed instructions and examples.