This repo demonstrates how to use ai6z/agent-twitter-client in various agentic frameworks
The idea is to demonstrate how ai6z/agent-twitter-client, an unofficial Twitter client, can be used in different agentic frameworks (Composio, CrewAI, etc.)
- Tweet search
- User lookup
- Unfollower tracking + Telegram bot notifs
- More in ai6z/agent-twitter-client
We need to setup ai6z/agent-twitter-client first
-
Make sure the current working directory is on
/twitter-clients/unfollower-client
-
Install dependencies
npm i
Setup (skip this if you accomplished agent-twitter-client setup already)
-
Make sure the current working directory is on
/twitter-clients/unfollower-client
-
Install dependencies
npm i
- Make sure
/twitter-clients/unfollower-client/.env
is populated
# /twitter-clients/unfollower-client/.env
TWITTER_USERNAME= # Account username
TWITTER_PASSWORD="" # Account password
TWITTER_EMAIL= # Account email
PROXY_URL= # HTTP(s) proxy for requests (necessary for browsers)
# Twitter API v2 credentials for tweet and poll functionality
TWITTER_API_KEY= # Twitter API Key
TWITTER_API_SECRET_KEY= # Twitter API Secret Key
TWITTER_ACCESS_TOKEN= # Access Token for Twitter API v2
TWITTER_ACCESS_TOKEN_SECRET= # Access Token Secret for Twitter API v2
TELEGRAM_BOT_NEWTWITTERFOLLOWERSBOT_TOKEN=
TELEGRAM_BOT_NEWTWITTERFOLLOWERSBOT_CHATID=
TELEGRAM_BOT_AUTOREPLIERTWITTERBOT_TOKEN=
BASE_PATH=../twitter-clients/unfollower-client/ # Base directory for storing data files
node run-standalone.js
Using ai6z/agent-twitter-client in Composio
- Make sure the current working directory is on
/composio
by running
cd composio
- Install dependencies
npm i
- Make sure
/composio/.env
is populated
# /composio/.env
COMPOSIO_API_KEY=XXX # required
GOOGLE_GENERATIVE_AI_API_KEY=XXX # populate when using Google Gemini via Vercel AI Toolset
OPENAI_API_KEY=sk-proj-XXX # populate applies when using OpenAI via Open AI Toolset / Langchain Toolset
TWITTER_ACCOUNT_TO_TRACK_UNFOLLOWERS=pseudokid # or your Twitter username
- Agent demo using OpenAI (Open AI chat client and Open AI Toolset) - based on https://docs.composio.dev/patterns/tools/build-tools/custom-action-without-auth
node agent-openai.js
- Agent demo using Google Gemini and Vercel AI SDK (Google Gemini and Vercel AI Toolset)
node agent-gemini-vercel.js
Using ai6z/agent-twitter-client in CrewAI
- Make sure the current working directory is on
/crewai_agent
by running
cd crewai_agent
- Make sure
/crewai_agent/.env
is populated
# /crewai_agent/.env
MODEL=gemini/gemini-1.5-pro
GEMINI_API_KEY=XXX
- Follow CrewAI installation guide
Skip setting up a new crew because we already have a crew in place for this project
crewai run
or follow CrewAI's guide to running your crew