viruagent-cli 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -18,25 +18,33 @@
18
18
  <a href="README.ko.md"><img src="https://img.shields.io/badge/한국어-red" alt="Korean"></a>
19
19
  </p>
20
20
 
21
- **AI 에이전트가 블로그를 쓰고, 태그를 만들고, 발행까지 자동으로 처리하는 CLI 도구**
21
+ **AI 에이전트가 블로그 발행부터 SNS 활동까지 자동으로 처리하는 CLI 도구**
22
22
 
23
23
  사람이 아닌 **AI 에이전트를 위해** 설계되었습니다.
24
24
 
25
+ ## 지원 플랫폼
26
+
27
+ | 플랫폼 | 로그인 | 주요 기능 | 가이드 |
28
+ |--------|--------|----------|--------|
29
+ | **Tistory** | Playwright (카카오) | 글 발행, 임시저장, 카테고리, 이미지 업로드 | [가이드](docs/guide-tistory.md) |
30
+ | **Naver Blog** | Playwright (네이버) | 글 발행, 카테고리, SE Editor, 이미지 업로드 | [가이드](docs/guide-naver.md) |
31
+ | **Instagram** | HTTP (브라우저 불필요) | 좋아요, 댓글, 팔로우, 포스팅, 프로필, 피드 | [가이드](docs/guide-instagram.md) |
32
+
25
33
  ## 동작 방식
26
34
 
27
- **CLI + 스킬 기반**으로 작동합니다. CLI 자체는 인터페이스만 담당하고, CLI 호출 흐름, 글 양식 등 스킬 파일(`viruagent.md`)이 AI 에이전트에게 지시합니다.
35
+ **CLI + 스킬 기반**으로 작동합니다. CLI 자체는 인터페이스만 담당하고, 스킬 파일(`viruagent.md`)이 AI 에이전트에게 워크플로우를 지시합니다.
28
36
 
29
37
  ```
30
38
  사용자: "블로그 써줘"
31
39
  → 스킬이 에이전트에게 워크플로우 지시
32
40
  → 에이전트가 CLI를 호출 (로그인, 카테고리 조회, 발행 등)
33
41
 
34
- 사용자: /viruagent " 써줘"
35
- 스킬 직접 호출
42
+ 사용자: "@username 게시물 전부 좋아요하고 댓글 달아줘"
43
+ 에이전트가 Instagram 프로바이더 사용 (로그인, listPosts, like, analyzePost, comment)
36
44
  ```
37
45
 
38
- - **스킬 파일**: 에이전트가 무엇을, 어떤 순서로 할지 정의 (글 구조, 태그 규칙, 이미지 설정 등)
39
- - **CLI**: 스킬의 지시를 받아 실제 작업 수행 (로그인, API 호출, 브라우저 자동화)
46
+ - **스킬 파일**: 에이전트가 무엇을, 어떤 순서로 할지 정의
47
+ - **CLI**: 스킬의 지시를 받아 실제 작업 수행
40
48
  - **에이전트**: 스킬을 읽고 CLI를 조합하여 자율적으로 실행
41
49
  - **커스텀**: 스킬 파일을 직접 수정하여 원하는 대로 동작하도록 설정 가능
42
50
 
@@ -44,7 +52,7 @@
44
52
 
45
53
  ![viru_install](https://github.com/user-attachments/assets/35efb57f-fada-44c0-8dd4-6d586ef33a7c)
46
54
 
47
- 아래 내용을 AI 에이전트에게 그대로 복사해서 보여주세요. (AI 에이전트 대상이므로 영어로 작성되어 있습니다)
55
+ 아래 내용을 AI 에이전트에게 그대로 복사해서 보여주세요.
48
56
 
49
57
  ```
50
58
  You are installing viruagent-cli, a blog publishing CLI tool. Follow these steps in order.
@@ -67,42 +75,44 @@ Tell the user that viruagent-cli installation is complete.
67
75
  ### Tistory
68
76
 
69
77
  ```bash
70
- # Chrome 세션 임포트 (ID/PW 불필요, macOS & Windows)
71
- npx viruagent-cli login --from-chrome
72
-
73
- # 특정 Chrome 프로필 사용
74
- npx viruagent-cli login --from-chrome --profile "Profile 2"
75
-
76
- # 기존 카카오 로그인 (ID/PW 필요)
77
- npx viruagent-cli login --username <id> --password <pw> --headless
78
+ npx viruagent-cli login --provider tistory --username <카카오 ID> --password <비밀번호> --headless
78
79
  ```
80
+ > "티스토리 로그인해줘" — 에이전트가 알아서 처리
79
81
 
80
82
  ### Naver Blog
81
83
 
82
84
  ```bash
83
- # Chrome 세션 임포트 (권장)
84
- npx viruagent-cli login --provider naver --from-chrome
85
+ npx viruagent-cli login --provider naver --username <네이버 ID> --password <비밀번호>
86
+ ```
87
+ > "네이버 블로그 로그인해줘" — 에이전트가 알아서 처리
85
88
 
86
- # 수동 로그인 (브라우저에서 직접 로그인)
87
- npx viruagent-cli login --provider naver --manual
89
+ ### Instagram
88
90
 
89
- # 자동 로그인 (ID/PW)
90
- npx viruagent-cli login --provider naver --username <id> --password <pw>
91
+ ```bash
92
+ npx viruagent-cli login --provider insta --username <인스타 ID> --password <비밀번호>
91
93
  ```
92
-
93
- > [!TIP]
94
- > `--from-chrome`은 Chrome에서 직접 쿠키를 추출합니다 macOS Keychain 또는 Windows DPAPI사용하며, CDP 폴백도 지원합니다. 브라우저 실행 없이, 2FA 없이, 1초 내 완료됩니다.
94
+ > "인스타 로그인해줘" — 에이전트가 알아서 처리
95
+ >
96
+ > 전체 API 레퍼런스와 rate limit 규칙은 [Instagram 가이드](docs/guide-instagram.md)참고하세요.
95
97
 
96
98
  ## 사용법
97
99
 
98
100
  | 이렇게 말하면 | 에이전트가 알아서 |
99
101
  |---|---|
100
- | "블로그 써줘" | 로그인 → 카테고리 → 글 작성 → 태그 → 발행 |
102
+ | "티스토리에 블로그 써줘" | 로그인 → 카테고리 → 글 작성 → 태그 → 발행 |
103
+ | "네이버에 글 올려줘" | 네이버 로그인 → 카테고리 → 발행 |
101
104
  | "임시저장해줘" | 같은 흐름, 발행 대신 임시저장 |
102
105
  | "최근 글 보여줘" | 최근 발행 글 목록 조회 |
103
- | "카테고리 있어?" | 카테고리 목록 조회 |
106
+ | "@user 게시물 전부 좋아요해줘" | 로그인 listPosts → like (rate limit 자동 적용) |
107
+ | "이 사람 피드 분석해서 댓글 달아줘" | analyzePost → AI 댓글 생성 → comment |
108
+ | "@user 팔로우해줘" | 로그인 → follow (딜레이 자동 적용) |
109
+ | "인스타 rate limit 확인해줘" | rate-limit-status → 카운터 표시 |
110
+
111
+ ## 플랫폼별 가이드
104
112
 
105
- 자세한 사용법이나 커스터마이징은 에이전트에게 물어보면 안내해줍니다.
113
+ - **[Tistory 가이드](docs/guide-tistory.md)** 블로그 발행, 이미지 업로드, 카테고리
114
+ - **[Naver Blog 가이드](docs/guide-naver.md)** — SE Editor, 블로그 발행, 이미지 업로드
115
+ - **[Instagram 가이드](docs/guide-instagram.md)** — 18개 API 메서드, rate limit 규칙, AI 댓글
106
116
 
107
117
  ## 지원 환경
108
118
 
@@ -112,21 +122,15 @@ npx viruagent-cli login --provider naver --username <id> --password <pw>
112
122
  | bash 실행 가능한 모든 AI 에이전트 | 지원 |
113
123
  | Node.js | >= 18 |
114
124
 
115
- ## 지원 플랫폼
116
-
117
- | 플랫폼 | 상태 |
118
- | --- | --- |
119
- | Tistory | 지원 |
120
- | Naver Blog | 지원 |
121
-
122
125
  ## 기술 스택
123
126
 
124
127
  | 영역 | 기술 |
125
128
  | --- | --- |
126
129
  | CLI 프레임워크 | Commander.js |
127
- | 브라우저 자동화 | Playwright (Chromium) |
128
- | 쿠키 복호화 | macOS Keychain + AES-128-CBC / Windows DPAPI + AES-256-GCM / CDP 폴백 |
130
+ | 브라우저 자동화 | Playwright (Tistory, Naver만 사용) |
131
+ | Instagram API | 순수 HTTP fetch (브라우저 불필요) |
129
132
  | 세션 관리 | JSON 파일 (`~/.viruagent-cli/`) |
133
+ | Rate Limiting | 유저별 영속 카운터 + 랜덤 딜레이 |
130
134
  | 이미지 검색 | DuckDuckGo, Wikimedia Commons |
131
135
  | 네이버 에디터 | SE Editor 컴포넌트 모델 + RabbitWrite API |
132
136
  | 출력 형식 | JSON envelope (`{ ok, data }` / `{ ok, error, hint }`) |
package/README.md CHANGED
@@ -18,10 +18,18 @@
18
18
  <a href="README.ko.md"><img src="https://img.shields.io/badge/한국어-red" alt="Korean"></a>
19
19
  </p>
20
20
 
21
- **A CLI tool where AI agents write, tag, and publish blog posts automatically.**
21
+ **A CLI tool where AI agents write, publish, and engage across blog & social platforms automatically.**
22
22
 
23
23
  Designed not for humans, but for **AI agents**.
24
24
 
25
+ ## Supported Platforms
26
+
27
+ | Platform | Login | Features | Guide |
28
+ |----------|-------|----------|-------|
29
+ | **Tistory** | Playwright (Kakao) | Publish, Draft, Categories, Image Upload | [Guide](docs/guide-tistory.md) |
30
+ | **Naver Blog** | Playwright (Naver) | Publish, Categories, SE Editor, Image Upload | [Guide](docs/guide-naver.md) |
31
+ | **Instagram** | HTTP (No Browser) | Like, Comment, Follow, Post, Profile, Feed, Rate Limit | [Guide](docs/guide-instagram.md) |
32
+
25
33
  ## How It Works
26
34
 
27
35
  Operates via **CLI + skill files**. The CLI handles the interface; the skill file (`viruagent.md`) instructs the AI agent on workflow, formatting, and rules.
@@ -31,13 +39,13 @@ User: "Write a blog post"
31
39
  → Skill instructs the agent on workflow
32
40
  → Agent calls CLI (login, list categories, publish, etc.)
33
41
 
34
- User: /viruagent "Write a post"
35
- Direct skill invocation
42
+ User: "Like and comment on all posts from @username"
43
+ Agent uses Instagram provider (login, listPosts, like, analyzePost, comment)
36
44
  ```
37
45
 
38
- - **Skill file**: Defines what to do and in what order (post structure, tag rules, image settings)
39
- - **CLI**: Executes tasks per skill instructions (login, API calls, browser automation)
40
- - **Agent**: Reads the skill and orchestrates CLI commands autonomously
46
+ - **Skill file**: Defines what to do and in what order
47
+ - **CLI**: Executes tasks per skill instructions
48
+ - **Agent**: Reads the skill and orchestrates commands autonomously
41
49
  - **Custom**: Edit the skill file to customize behavior
42
50
 
43
51
  ## Quick Start
@@ -67,42 +75,44 @@ Tell the user that viruagent-cli installation is complete.
67
75
  ### Tistory
68
76
 
69
77
  ```bash
70
- # Import session from Chrome (no ID/PW needed, macOS & Windows)
71
- npx viruagent-cli login --from-chrome
72
-
73
- # Use a specific Chrome profile
74
- npx viruagent-cli login --from-chrome --profile "Profile 2"
75
-
76
- # Traditional Kakao login (ID/PW required)
77
- npx viruagent-cli login --username <id> --password <pw> --headless
78
+ npx viruagent-cli login --provider tistory --username <kakao_id> --password <pw> --headless
78
79
  ```
80
+ > "Login to Tistory" — Agent handles it automatically
79
81
 
80
82
  ### Naver Blog
81
83
 
82
84
  ```bash
83
- # Import session from Chrome (recommended)
84
- npx viruagent-cli login --provider naver --from-chrome
85
-
86
- # Manual login via browser
87
- npx viruagent-cli login --provider naver --manual
88
-
89
- # Auto login with credentials
90
85
  npx viruagent-cli login --provider naver --username <id> --password <pw>
91
86
  ```
87
+ > "Login to Naver Blog" — Agent handles it automatically
92
88
 
93
- > [!TIP]
94
- > `--from-chrome` extracts cookies from Chrome directly — via macOS Keychain or Windows DPAPI, with CDP fallback. No browser launch, no 2FA — completes in under 1 second.
89
+ ### Instagram
90
+
91
+ ```bash
92
+ npx viruagent-cli login --provider insta --username <id> --password <pw>
93
+ ```
94
+ > "Login to Instagram" — Agent handles it automatically
95
+ >
96
+ > See the [Instagram Guide](docs/guide-instagram.md) for full API reference and rate limit rules.
95
97
 
96
98
  ## Usage
97
99
 
98
100
  | Say this | Agent handles |
99
101
  |---|---|
100
- | "Write a blog post" | Login → Categories → Draft → Tags → Publish |
102
+ | "Write a blog post on Tistory" | Login → Categories → Draft → Tags → Publish |
103
+ | "Post to Naver Blog" | Naver login → Categories → Publish |
101
104
  | "Save as draft" | Same flow, saves as draft instead |
102
105
  | "Show recent posts" | Lists recent published posts |
103
- | "What categories?" | Lists available categories |
106
+ | "Like all posts from @user" | Login listPosts → like (with rate limit) |
107
+ | "Analyze and comment on @user's feed" | analyzePost → AI generates comment → comment |
108
+ | "Follow @user" | Login → follow (with delay) |
109
+ | "Check Instagram rate limit" | rate-limit-status → show counters |
104
110
 
105
- Ask the agent for detailed usage or customization help.
111
+ ## Platform Guides
112
+
113
+ - **[Tistory Guide](docs/guide-tistory.en.md)** — Blog publishing, image upload, categories
114
+ - **[Naver Blog Guide](docs/guide-naver.en.md)** — SE Editor, blog publishing, image upload
115
+ - **[Instagram Guide](docs/guide-instagram.en.md)** — 18 API methods, rate limits, AI commenting
106
116
 
107
117
  ## Supported Environments
108
118
 
@@ -112,21 +122,15 @@ Ask the agent for detailed usage or customization help.
112
122
  | Any AI agent with bash access | Supported |
113
123
  | Node.js | >= 18 |
114
124
 
115
- ## Supported Platforms
116
-
117
- | Platform | Status |
118
- | --- | --- |
119
- | Tistory | Supported |
120
- | Naver Blog | Supported |
121
-
122
125
  ## Tech Stack
123
126
 
124
127
  | Area | Tech |
125
128
  | --- | --- |
126
129
  | CLI Framework | Commander.js |
127
- | Browser Automation | Playwright (Chromium) |
128
- | Cookie Decryption | macOS Keychain + AES-128-CBC / Windows DPAPI + AES-256-GCM / CDP fallback |
130
+ | Browser Automation | Playwright (Tistory, Naver only) |
131
+ | Instagram API | Pure HTTP fetch (no browser) |
129
132
  | Session Management | JSON file (`~/.viruagent-cli/`) |
133
+ | Rate Limiting | Per-user persistent counters with random delays |
130
134
  | Image Search | DuckDuckGo, Wikimedia Commons |
131
135
  | Naver Editor | SE Editor component model + RabbitWrite API |
132
136
  | Output Format | JSON envelope (`{ ok, data }` / `{ ok, error, hint }`) |
package/bin/index.js CHANGED
@@ -18,7 +18,7 @@ program
18
18
 
19
19
  // Global options
20
20
  const addProviderOption = (cmd) =>
21
- cmd.option('--provider <name>', 'Provider name (tistory or naver)', 'tistory');
21
+ cmd.option('--provider <name>', 'Provider name (tistory, naver, insta)', 'tistory');
22
22
 
23
23
  const addDryRunOption = (cmd) =>
24
24
  cmd.option('--dry-run', 'Validate params without executing', false);
@@ -49,8 +49,6 @@ loginCmd
49
49
  .option('--headless', 'Run browser in headless mode', false)
50
50
  .option('--manual', 'Use manual login mode', false)
51
51
  .option('--two-factor-code <code>', '2FA verification code')
52
- .option('--from-chrome', 'Import session from Chrome browser', false)
53
- .option('--profile <name>', 'Chrome profile name (default: Default)')
54
52
  .action((opts) => execute('login', opts));
55
53
 
56
54
  const publishCmd = program
@@ -104,6 +102,7 @@ const listPostsCmd = program
104
102
  .description('List recent posts');
105
103
  addProviderOption(listPostsCmd);
106
104
  listPostsCmd
105
+ .option('--username <username>', 'Target username (required for insta)')
107
106
  .option('--limit <n>', 'Number of posts to retrieve', '20')
108
107
  .action((opts) => execute('list-posts', opts));
109
108
 
@@ -132,6 +131,95 @@ const listProvidersCmd = program
132
131
  .description('List supported providers');
133
132
  listProvidersCmd.action((opts) => execute('list-providers', opts));
134
133
 
134
+ // --- Instagram / SNS commands ---
135
+
136
+ const getProfileCmd = program
137
+ .command('get-profile')
138
+ .description('Get user profile info');
139
+ addProviderOption(getProfileCmd);
140
+ getProfileCmd
141
+ .option('--username <username>', 'Target username')
142
+ .action((opts) => execute('get-profile', opts));
143
+
144
+ const getFeedCmd = program
145
+ .command('get-feed')
146
+ .description('Get feed timeline');
147
+ addProviderOption(getFeedCmd);
148
+ getFeedCmd.action((opts) => execute('get-feed', opts));
149
+
150
+ const likeCmd = program
151
+ .command('like')
152
+ .description('Like a post');
153
+ addProviderOption(likeCmd);
154
+ likeCmd
155
+ .option('--post-id <shortcode>', 'Post shortcode')
156
+ .action((opts) => execute('like', opts));
157
+
158
+ const unlikeCmd = program
159
+ .command('unlike')
160
+ .description('Unlike a post');
161
+ addProviderOption(unlikeCmd);
162
+ unlikeCmd
163
+ .option('--post-id <shortcode>', 'Post shortcode')
164
+ .action((opts) => execute('unlike', opts));
165
+
166
+ const commentCmd = program
167
+ .command('comment')
168
+ .description('Comment on a post');
169
+ addProviderOption(commentCmd);
170
+ commentCmd
171
+ .option('--post-id <shortcode>', 'Post shortcode')
172
+ .option('--text <text>', 'Comment text')
173
+ .action((opts) => execute('comment', opts));
174
+
175
+ const followCmd = program
176
+ .command('follow')
177
+ .description('Follow a user');
178
+ addProviderOption(followCmd);
179
+ followCmd
180
+ .option('--username <username>', 'Target username')
181
+ .action((opts) => execute('follow', opts));
182
+
183
+ const unfollowCmd = program
184
+ .command('unfollow')
185
+ .description('Unfollow a user');
186
+ addProviderOption(unfollowCmd);
187
+ unfollowCmd
188
+ .option('--username <username>', 'Target username')
189
+ .action((opts) => execute('unfollow', opts));
190
+
191
+ const likeCommentCmd = program
192
+ .command('like-comment')
193
+ .description('Like a comment');
194
+ addProviderOption(likeCommentCmd);
195
+ likeCommentCmd
196
+ .option('--comment-id <id>', 'Comment ID')
197
+ .action((opts) => execute('like-comment', opts));
198
+
199
+ const unlikeCommentCmd = program
200
+ .command('unlike-comment')
201
+ .description('Unlike a comment');
202
+ addProviderOption(unlikeCommentCmd);
203
+ unlikeCommentCmd
204
+ .option('--comment-id <id>', 'Comment ID')
205
+ .action((opts) => execute('unlike-comment', opts));
206
+
207
+ const analyzePostCmd = program
208
+ .command('analyze-post')
209
+ .description('Analyze a post (thumbnail + caption + profile)');
210
+ addProviderOption(analyzePostCmd);
211
+ analyzePostCmd
212
+ .option('--post-id <shortcode>', 'Post shortcode')
213
+ .action((opts) => execute('analyze-post', opts));
214
+
215
+ const rateLimitCmd = program
216
+ .command('rate-limit-status')
217
+ .description('Show current rate limit usage');
218
+ addProviderOption(rateLimitCmd);
219
+ rateLimitCmd.action((opts) => execute('rate-limit-status', opts));
220
+
221
+ // --- Utility commands ---
222
+
135
223
  const installSkillCmd = program
136
224
  .command('install-skill')
137
225
  .description('Install viruagent skill for Claude Code / Codex')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viruagent-cli",
3
- "version": "0.3.6",
4
- "description": "AI-agent-optimized CLI for blog publishing (Tistory, Naver)",
3
+ "version": "0.4.0",
4
+ "description": "AI-agent-optimized CLI for blog publishing (Tistory, Naver) and Instagram automation",
5
5
  "private": false,
6
6
  "type": "commonjs",
7
7
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "blog",
12
12
  "tistory",
13
13
  "naver",
14
+ "instagram",
14
15
  "publishing",
15
16
  "automation",
16
17
  "llm",
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: viruagent-insta
3
+ description: Instagram automation via viruagent-cli — like, comment, follow, post, analyze feed. Handles rate limits and bot detection avoidance.
4
+ triggers:
5
+ - 인스타
6
+ - 인스타그램
7
+ - instagram
8
+ - insta
9
+ - 좋아요
10
+ - 댓글 달아
11
+ - 팔로우
12
+ - 언팔로우
13
+ - 피드
14
+ - like
15
+ - comment
16
+ - follow
17
+ - unfollow
18
+ - feed
19
+ ---
20
+
21
+ # viruagent-insta — Instagram Automation Skill
22
+
23
+ You are an Instagram automation agent using `viruagent-cli`. Always use `npx viruagent-cli` with `--provider insta`.
24
+
25
+ ## Step 1: Check authentication
26
+
27
+ ```bash
28
+ npx viruagent-cli status --provider insta
29
+ ```
30
+
31
+ If not logged in:
32
+
33
+ ```bash
34
+ npx viruagent-cli login --provider insta --username <user> --password <pass>
35
+ ```
36
+
37
+ Environment variables `INSTA_USERNAME` / `INSTA_PASSWORD` also work.
38
+
39
+ ## Step 2: Available commands
40
+
41
+ ### Profile & Feed
42
+
43
+ ```bash
44
+ # Get user profile
45
+ npx viruagent-cli get-profile --provider insta --username <username>
46
+
47
+ # Get your feed timeline
48
+ npx viruagent-cli get-feed --provider insta
49
+
50
+ # List user's posts (with pagination)
51
+ npx viruagent-cli list-posts --provider insta --username <username> --limit 20
52
+ ```
53
+
54
+ ### Engagement (auto rate-limit delays applied)
55
+
56
+ ```bash
57
+ # Like a post
58
+ npx viruagent-cli like --provider insta --post-id <shortcode>
59
+
60
+ # Comment on a post
61
+ npx viruagent-cli comment --provider insta --post-id <shortcode> --text "comment text"
62
+
63
+ # Follow / Unfollow
64
+ npx viruagent-cli follow --provider insta --username <username>
65
+ npx viruagent-cli unfollow --provider insta --username <username>
66
+
67
+ # Like / Unlike a comment
68
+ npx viruagent-cli like-comment --provider insta --comment-id <id>
69
+ npx viruagent-cli unlike-comment --provider insta --comment-id <id>
70
+ ```
71
+
72
+ ### Analyze & Smart Comment
73
+
74
+ ```bash
75
+ # Analyze post (returns caption + thumbnail base64 + profile)
76
+ npx viruagent-cli analyze-post --provider insta --post-id <shortcode>
77
+ ```
78
+
79
+ Use `analyze-post` to get the thumbnail image, then visually analyze it to write contextual comments.
80
+
81
+ ### Publish
82
+
83
+ ```bash
84
+ # Publish an image post (provide imageUrl or imagePath in code)
85
+ # CLI does not have a direct publish command — use the Node.js API:
86
+ ```
87
+
88
+ ```javascript
89
+ const insta = require('viruagent-cli/src/services/providerManager').createProviderManager().getProvider('insta');
90
+ await insta.publish({ imageUrl: 'https://...', caption: 'My post' });
91
+ ```
92
+
93
+ ### Rate Limit
94
+
95
+ ```bash
96
+ npx viruagent-cli rate-limit-status --provider insta
97
+ ```
98
+
99
+ ## Workflows
100
+
101
+ ### "Like all posts from @user"
102
+
103
+ 1. `list-posts --username <user> --limit 20`
104
+ 2. For each post: `like --post-id <shortcode>`
105
+ 3. Rate limit delays are automatic (20~40s between likes)
106
+
107
+ ### "Comment on all @user's posts"
108
+
109
+ 1. `list-posts --username <user> --limit 20`
110
+ 2. For each post:
111
+ a. Check if already commented (use `analyze-post` to see existing comments)
112
+ b. `analyze-post --post-id <shortcode>` — read thumbnail + caption
113
+ c. Visually analyze the thumbnail to understand the content
114
+ d. Write a contextual, natural comment (1~2 sentences, 1~2 emoji max)
115
+ e. `comment --post-id <shortcode> --text "..."`
116
+ 3. Rate limit delays are automatic (5~7min between comments)
117
+
118
+ ### "Follow @user and engage with their feed"
119
+
120
+ 1. `follow --username <user>`
121
+ 2. `list-posts --username <user> --limit 20`
122
+ 3. Like + comment each post (as above)
123
+
124
+ ### Comment Writing Rules
125
+
126
+ - Write in the same language as the post caption
127
+ - Be specific to the content — reference what's in the image/caption
128
+ - 1~2 sentences max, 1~2 emoji
129
+ - No hashtags in comments
130
+ - No generic phrases like "Nice post!" or "Great content!"
131
+ - Vary tone and style across comments — don't repeat patterns
132
+ - If the post is a video (릴스), analyze the thumbnail + caption to understand context
133
+
134
+ ## Rate Limit Safety (New Account)
135
+
136
+ | Action | Delay | Hourly | Daily |
137
+ |--------|-------|--------|-------|
138
+ | Like | 20~40s | 15 | 500 |
139
+ | Comment | 5~7min | 5 | 100 |
140
+ | Follow | 1~2min | 15 | 250 |
141
+ | Unfollow | 1~2min | 10 | 200 |
142
+ | DM | 2~5min | 5 | 30 |
143
+ | Post | 1~2min | 3 | 25 |
144
+
145
+ All delays are randomized and applied automatically. Counters persist across sessions per userId.
146
+
147
+ ## Error Recovery
148
+
149
+ | Error | Action |
150
+ |---|---|
151
+ | `hourly_limit` | Wait for the specified time, then retry |
152
+ | `daily_limit` | Wait until tomorrow |
153
+ | `rate_limit` (spam detected) | Wait 24~48 hours |
154
+ | `challenge` (302 redirect to /challenge/) | User must verify identity in browser |
155
+ | `SESSION_EXPIRED` | Run `login` again |
156
+
157
+ ## Important Notes
158
+
159
+ - Always check `rate-limit-status` before bulk operations
160
+ - New accounts (< 20 days) have stricter limits
161
+ - Uniform action intervals trigger bot detection — delays are randomized
162
+ - challenge requires manual browser verification
163
+ - Session + counters stored locally at `~/.viruagent-cli/sessions/insta-session.json`