> ## Documentation Index
> Fetch the complete documentation index at: https://composio-27-feat-docs-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Composio With CrewAI

> Integrate Composio with CrewAI agents to let them seamlessly interact with external apps

## Star A Repository on GitHub

In this example, we will use CrewAI Agent to star a repository on GitHub using Composio Tools

<Steps>
  <Step title="Install Packages">
    ```bash Python
    pip install composio_crewai crewai langchain_openai
    ```
  </Step>

  <Step title="Import Libraries & Initialize ComposioToolSet & LLM">
    ```bash Python
    from composio_crewai import ComposioToolSet, App
    from crewai import Agent, Task, Crew
    from langchain_openai import ChatOpenAI

    toolset = ComposioToolSet(api_key="<your-composio-api-key>")
    llm = ChatOpenAI(api_key="<your-openai-api-key>")
    ```
  </Step>

  <Step title="Connect Your GitHub Account">
    <Info>You need to have an active GitHub Integration. Learn how to do this [here](https://youtu.be/LmyWy4LiedQ?si=u5uFArlNL0tew0Wf)</Info>

    <CodeGroup>
      ```shell CLI
      composio login 
      composio add github
      ```

      ```python Python
      request = toolset.initiate_connection(app=App.GITHUB)
      print(f"Open this URL to authenticate: {request.redirectUrl}")
      ```
    </CodeGroup>

    <Tip>
      Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environment variables.
    </Tip>
  </Step>

  <Step title="Get All GitHub Tools">
    You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)

    <CodeGroup>
      ```python Python
      tools = toolset.get_tools(apps=[App.GITHUB])
      ```
    </CodeGroup>
  </Step>

  <Step title="Define the Agent, Task & Crew">
    ```python Python
    crewai_agent = Agent(
        role="GitHub Agent",
        goal="You take action on GitHub using GitHub APIs",
        backstory="You are AI agent that is responsible for taking actions on GitHub on behalf of users using GitHub APIs",
        verbose=True,
        tools=tools,
        llm=llm,
    )

    task = Task(
        description="Star a repo composiohq/composio on GitHub",
        agent=crewai_agent,
        expected_output="Status of the operation"
    )

    crew = Crew(
        agents = [crewai_agent],
        tasks = [task]
    )
    ```
  </Step>

  <Step title="Crew Kickoff">
    ```python Python
    result = crew.kickoff()
    print(result)
    ```
  </Step>
</Steps>
