This project is a Node.js + TypeScript based automation system for managing multiple X (Twitter) accounts from a single codebase. It is designed to safely automate posting and engagement actions while respecting X API limits and account isolation.
The system was built as part of an internship task to demonstrate real-world API integration, multi-account handling, scheduling, and reliability.
- Multi-account support (Marketing, Community Manager, Founder)
- Independent API credentials per account
- X API v2 integration
- Supported actions:
- Post tweets
- Retweet / Quote tweet
- Reply to tweets
- Like tweets (with error handling for API restrictions)
- CLI-based manual execution
- Cron-based scheduling
- Config-driven behavior
- JSON-based logging
- Rate-limit awareness and guardrails
The system is designed with clear separation of concerns:
- Accounts: Each X account has its own API keys, tokens, schedules, and guardrails.
- Actions: Posting, replying, liking, and retweeting are implemented as separate executors.
- Scheduler: Cron jobs trigger actions independently for each account.
- CLI: Used for manual testing and controlled execution of actions.
- Config Layer: Accounts, schedules, and rules are defined using JSON configuration files.
- Logging: Every action is logged with timestamp, account, action type, and status.
This design ensures that failures or rate limits affecting one account do not impact others.
src/actions/– Tweet, reply, like, retweet executorssrc/services/– X API client and helperssrc/scheduler/– Cron-based scheduling logicsrc/cli.ts– CLI entry pointsrc/utils/– Logging, guardrails, helpersconfig/– Account and action configuration files.env– API keys and secrets (not committed)
All sensitive credentials are stored in a .env file:
* API Key
* API Secret
* Access Token
* Access Token Secret
Each account uses its own set of credentials to ensure proper isolation.
Accounts, schedules, actions, and guardrails are defined via JSON config files. This allows non-code changes to behavior and makes the system easy to extend.
npm install
npm run cli --
The CLI can be used to manually trigger actions and test account behavior safely.
The scheduler runs cron jobs based on the configuration and executes actions automatically for each account.
- Built-in spacing between actions
- No aggressive retries on failure
- Graceful handling of API errors
- Prevents spam-like behavior
Some actions (such as likes) may return 403 due to X API policy restrictions. These cases are handled safely and logged without breaking the system.
All actions are logged in JSON format, including:
- Timestamp
- Account name
- Role
- Action type
- Status (success/failure)
- Tweet ID or error message
This helps with debugging, auditing, and monitoring execution.
- Like actions may be restricted by X API permissions and can return
403errors. - Content generation is manual or config-driven; AI-based generation is not included.
- AI-based tweet generation
- Web dashboard
- Analytics and engagement tracking
- News or trend-based auto posting
- Multi-language support
The project meets the task requirements and is stable for multi-account automation using real X API v2 integration.