GitHub - greekr4/viruagent-cli: AI agent-powered CLI for blog publishing, Naver Cafe, Instagram, X (Twitter) & Reddit automation
Key Points
- 1`viruagent-cli` is a command-line interface tool designed for AI agents to automate publishing and engagement across various blog and social media platforms.
- 2It enables agents to write, publish, interact (like, comment, follow), and manage content on platforms including Tistory, Naver, Instagram, X (Twitter), Reddit, and Threads.
- 3The system operates via skill files that define workflows for AI agents, which then execute tasks through CLI commands, incorporating features like session management and rate limiting.
The viruagent-cli is a command-line interface (CLI) tool meticulously engineered for autonomous operation by AI agents, enabling them to write, publish, and engage across various blog and social media platforms. Unlike traditional tools designed for direct human interaction, its architecture is optimized for machine-to-machine communication, specifically for AI agents with bash access.
Core Methodology and Architecture:
The system operates on a tripartite model: the CLI itself, platform-specific skill files, and the orchestrating AI agent.
- CLI (
viruagent-cli): Built on the Commander.js framework, the CLI serves as the execution layer. It provides a standardized interface for interacting with diverse web platforms, abstracting away the complexities of web scraping, API calls, and session management. Commands are executed vianpx viruagent-cli [command] [args], with an output format encapsulated in a JSON envelope ({ ok: true, data: ... }for success or{ ok: false, error: ..., hint: ... }for failure). - Skill File (
viruagent.md): This is a Markdown file, typically copied to~/.claude/commands/viruagent.md, that defines the high-level workflow, formatting rules, and operational logic for the AI agent. It acts as a script or a declarative program for the AI, outlining sequences of operations required for complex tasks (e.g., "Write a blog post" translates to a sequence of login, list categories, draft, tags, and publish actions). The AI agent interprets these instructions to formulate specific CLI commands. - AI Agent: The AI agent (e.g., Claude, Codex) is the intelligent orchestrator. It receives a natural language instruction from a user (e.g., "Write a blog post on Tistory"). It then consults the
viruagent.mdskill file to understand the required workflow and parameters. Based on this understanding, the AI agent autonomously generates and executes a series ofviruagent-clicommands, passing the necessary arguments extracted from the skill file and user request. This makes the AI responsible for translating high-level intent into granular CLI interactions.
Supported Platforms and Capabilities:
The tool supports a range of platforms, each with specialized capabilities:
- Tistory/Naver Blog: Supports publishing, drafting, categorizing posts, and image uploads. Naver Blog specifically integrates with the SE Editor and its component model, leveraging the RabbitWrite API.
- Naver Cafe: Facilitates cafe joining (with a notable captcha-free mechanism for up to 5 joins), post writing, board listing, and image uploads (slide/collage).
- Instagram: Provides extensive API methods including liking, commenting, following, posting, profile access, feed retrieval, and rate limit checks. Interaction is via pure HTTP fetch.
- X (Twitter): Enables tweeting, liking, retweeting, following, searching, timeline retrieval, and media uploads. It utilizes X's internal GraphQL API with dynamic
queryIdextraction to maintain compatibility. - Threads: Allows posting, replying, liking, following, image uploads, searching, and feed access, leveraging the Barcelona (Instagram Private API) and IGT:2 token authentication.
- Reddit: Supports posting, commenting, upvoting, searching, and subscribing to subreddits.
Technical Stack and Specifics:
- Browser Automation: For platforms like Tistory and Naver that may lack comprehensive public APIs or require intricate UI interactions, Playwright is employed for headless browser automation.
- API Interaction: Direct HTTP fetch is used for Instagram, while more complex reverse-engineered APIs are utilized for X (dynamic GraphQL
queryIdsynchronization) and Threads (Barcelona/IGT:2 token). Naver Cafe interactions are also pure HTTP, with manual captcha handling sometimes necessary. - Session Management: User sessions, including authentication tokens and cookies, are persistently stored in JSON files within
~/.viruagent-cli/. - Rate Limiting: To ensure compliance with platform policies and prevent account suspensions, the CLI implements per-user persistent rate counters with randomized delays between actions.
- Authentication: Varies by platform: Tistory/Naver/Instagram use username/password, while X requires
auth_tokenandct0cookies (cookie-based authentication). Threads reuses Instagram credentials. - Image Search: Integrates with DuckDuckGo and Wikimedia Commons for image search capabilities.
The viruagent-cli thus provides a robust, extensible framework for AI agents to programmatically interact with and manage content across diverse web platforms, abstracting the underlying technical complexities through a standardized CLI and guided by AI-interpretable skill files.