Skip to main content

Star A Repository on GitHub

In this guide, we’ll:
  1. πŸ” Connect your GitHub account with Composio
  2. πŸ›  Fetch GitHub actions
  3. 🧠 Pass these actions to an LLM
  4. ⭐ Instruct to star the composiohq/composio repository
  5. βœ… Execute the action
Tools represent a group of actions specific to an app. Actions are operations you can perform - like starring a repo on GitHub or creating an issue in Linear.
1

Install Libraries

pip install composio_core composio_openai
2

Connect Your GitHub Account

We’ll use default as the user id, also known as entity id.
You need to have an active GitHub Integration. Learn how to do this here
composio login 
composio add github -e "default"
Don’t forget to set your COMPOSIO_API_KEY and OPENAI_API_KEY in your environment variables.
3

Initialise Composio Toolset and OpenAI

from composio_openai import ComposioToolSet, App
from openai import OpenAI

openai_client = OpenAI()
composio_toolset = ComposioToolSet(entity_id="default")
4

Fetch Github Actions, and pass them to LLM

tools = composio_toolset.get_tools(apps=[App.GITHUB])

task = "Star the repo composiohq/composio on GitHub"

response = openai_client.chat.completions.create(
    model="gpt-4o",
    tools=tools,
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": task},
    ],
)
Composio also supports action executions without LLMs or agents. Learn more.
5

Execute Tool Calls

result = composio_toolset.handle_tool_calls(response)
print(result)

Next Steps

Now that you’ve seen how to use tools, you can explore the following resources:

Tools

Checkout our toolset of 250+ LLM ready tools to build powerful AI applications

Connections

Learn how to create and manage connections for your users

Compatible Agentic Frameworks

Integrate with popular agentic frameworks

Kits

Composio SWE Kit (#4 on SWE bench) - Your ultimate coding companion

Triggers

Subscribe to triggers to execute actions automatically

Other Concepts

Learn about workspace environments, using CLI & other concepts