Built by ChainGPT
AgenticOS lets you effortlessly create and deploy your own intelligent AI agent on X (formerly Twitter)—purpose-built for the Web3 ecosystem. Automate tasks like real-time market research, breaking crypto news, token analysis, and community engagement, enhancing your digital presence with 24/7 AI-driven insights.
📌 Live Demo: ChainGPT AI on X
AgenticOS is a TypeScript-based AI agent that automates tweet generation and publishing, leveraging ChainGPT's advanced Web3 LLM API and the ultra-fast Bun runtime. Built for ease of integration and secure performance.
- AI-powered Tweet Generation using ChainGPT's Web3 LLM
- Scheduled Automated Tweets via configurable Cron jobs
- Webhook Integration with ChainGPT for automatic real-time updates
- Secure Token Storage with encryption
- Automatic Twitter Token Refresh (OAuth 2.0)
- TypeScript for enhanced developer experience and type safety
- Ultra-fast Bun Runtime for optimal performance
- Bun Runtime (v1.0 or newer)
- Twitter API credentials (OAuth 2.0) - for free accounts please refer to character limit per tweet
- ChainGPT API Key (Get one here)
- ChainGPT Credits (Purchase credits)
Each generated tweet consumes 1 ChainGPT credit.
git clone https://github.com/ChainGPT-org/AgenticOS.git
cd AgenticOS
# Install Bun runtime
curl -fsSL https://bun.sh/install | bash
# Install project dependencies
bun install
# Configure your environment
cp .env.example .envUpdate .env with your details:
PORT=8000
NODE_ENV=development
TWITTER_CLIENT_ID=your_twitter_client_id # generated from Twitter developer portal
TWITTER_CLIENT_SECRET=your_twitter_client_secret # generated from Twitter developer portal
ENCRYPTION_KEY=your_32_character_encryption_key # set a value and keep it secure
ENCRYPTION_SALT=your_hex_encryption_salt # set a value and keep it secure
ENCRYPTION_IV=your_hex_initialization_vector # set a value and keep it secure
CHAINGPT_API_KEY=your_chaingpt_api_keybun build
bun startYou can generate Twitter access and refresh tokens using the OAuth 2.0 flow. For detailed instructions, please refer to Twitter Token Generation Guide.
# Add Twitter tokens to the application
POST <https://your-domain.com>/api/tokens
# Request body
{
"accessToken": "your_access_token",
"refreshToken": "your_refresh_token"
}Define your schedule in data/schedule.json:
{
"14:30": "The future of AI in Web3",
"18:00": "Crypto markets update"
}Tweets are auto-generated and posted according to this schedule (UTC).
Subscribe to Categories:
- Get available categories:
GET https://webapi.chaingpt.org/category-subscription/
Headers:
{
"api-key": "<your_chainGPT_api_key>"
}- Subscribe to categories:
POST https://webapi.chaingpt.org/category-subscription/subscribe
Headers:
{
"api-key": "<your_chainGPT_api_key>"
}
Body: { "categoryIds": [2, 3] }Register Webhook:
Register your webhook to automatically post updates:
POST https://your-domain.com}/api/webhook/register
Headers:
{
"api-key": "<your_chainGPT_api_key>"
}
Body: { "url": "{https://your-domain.com}/api/webhook/" }AgenticOS will automatically post tweets from ChainGPT news updates.
twitter-ai-agent/
├── data/
│ └── schedule.json
├── src/
│ ├── config/
│ ├── controllers/
│ ├── jobs/
│ ├── routes/
│ ├── services/
│ ├── types/
│ ├── utils/
│ └── index.ts
├── .env.example
├── package.json
└── tsconfig.json
- 🚀 Superior Performance: Faster execution & startup
- 🛠 Built-in TypeScript & ESM Support
- 🎯 Simplified Development: Integrated tools for testing & bundling
- 📦 Compatible with npm packages
- Secure encryption of Twitter tokens
- Environment variable validation
- Robust error handling
Contributions are welcome! Follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b feature/my-new-feature - Commit changes:
git commit -am 'Add feature' - Push changes:
git push origin feature/my-new-feature - Open a Pull Request.
ISC
ChainGPT
Report issues via GitHub Issues.
🚀 Happy Coding!