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) Generation Guide.
- 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_key
PASSWORD_AUTH=your_secure_password # API Authentication Password - Required for managing tokens and secure endpoints
Click the button above to generate secure encryption keys for your .env file
bun startTo generate your Access Token and Refresh Token, open the following URL in your browser:
# Access token Refresh Token Generator
https://your-domain.com/api/loginβ οΈ Make sure to replace your-domain.com with your actual deployed domain (to deploy you can refer to "Deployment on Render" section).
There are two methods to schedule tweets.
- Define your schedule in
data/schedule.json:
{
"05:10": {
"type": "market_insight",
"instruction": "{{persona}} and excellent at spotting key market movements. Create a tweet (less than {{maxLength}} characters) that's a meme about crypto."
},
"05:30": {
"type": "meme",
"instruction": "{{persona}} and excellent at spotting key market movements. Create a tweet (less than {{maxLength}} characters) that's a meme about crypto."
}
}Tweets are auto-generated and posted according to this schedule (UTC).
Subscribe to Categories:
There are two methods to subscribe to categories and register Webhook.
- Using following APIs:
Register Webhook:
Register your webhook to automatically receive and post updates:
POST https://{your-domain.com}/api/webhook/register
Headers:
{
"Authorization": "Bearer <your_password>"
}
Body: { "url": "https://{your-domain.com}/api/webhook/" }AgenticOS will automatically post tweets from ChainGPT news updates.
Get available categories:
GET https://webapi.chaingpt.org/category-subscription/
Headers:
{
"api-key": "<your_chainGPT_api_key>"
}Subscribe to categories: You can subscribe to desired categories using their ids
POST https://webapi.chaingpt.org/category-subscription/subscribe
Headers:
{
"api-key": "<your_chainGPT_api_key>"
}
Body: { "categoryIds": [2, 3] }- Using Dashboard: Goto following page: https://<your_domain>/live-news
Register Webhook:
Subscribe to categories:
To deploy this application:
- First, fork this repository using the "Fork" button
- Copy your repository URL from the browser's address bar
- Open a new tab and paste this URL:
Replace
https://render.com/deploy?repo=YOUR_REPO_URLYOUR_REPO_URLwith your repository URL
For example, if your repository URL is https://github.com/john-doe/AgenticOS, you would paste:
https://render.com/deploy?repo=https://github.com/john-doe/AgenticOS
- Configure environment variables as described in the Configure env section above
- Wait for the deployment to complete. This may take a few minutes.
- Once deployed, visit your domain and click on the "Refresh Token" tab in the sidebar to get twitter access and refresh token.
- You can schedule tweets in the "Scheduler" tab and add webhooks in the "Live News" page.
AgenticOS/
βββ data/
βββ public/
β βββ images/
βββ src/
β βββ config/
β βββ controllers/
β βββ jobs/
β βββ middleware/
β βββ routes/
β βββ services/
β βββ types/
β βββ utils/
β βββ index.ts
βββ views/
βββ .env.example
βββ .npmrc
βββ bun.lock
βββ package.json
βββ postcss.config.js
βββ render.yaml
βββ tailwind.config.js
βββ 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!


