@linkedapi/linkedin-cli 1.0.1 → 1.0.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Linked API
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,21 +1,35 @@
1
- # linkedin-cli
1
+ AI-agent-friendly CLI for LinkedIn automation via [Linked API](https://linkedapi.io).
2
2
 
3
- CLI for AI agents to automate LinkedIn via [Linked API](https://linkedapi.io).
3
+ Give your AI agent full LinkedIn capabilities: send messages, fetch profiles, search people and companies, manage connections, create posts, react, comment – all through simple CLI commands with structured JSON output. Built for OpenClaw, Claude Code, Cursor, Codex, and any AI agent that can execute shell commands.
4
4
 
5
- Give your AI agent full LinkedIn capabilities: send messages, fetch profiles, search people and companies, manage connections, create posts, react, comment – all through simple CLI commands with structured JSON output. Built for Claude Code, Cursor, Codex, and any AI agent that can execute shell commands.
5
+ Under the hood, [Linked API](https://linkedapi.io) runs a dedicated cloud browser instance for each connected LinkedIn account. When your agent runs a command, the CLI sends the request to Linked API's infrastructure, where an isolated browser with a residential IP performs the action on LinkedIn – simulating human-like mouse movements, keyboard input, and natural browsing patterns. No local browsers, no proxies, no Selenium, no infrastructure to manage. [Learn more about safety](https://linkedapi.io/safety).
6
6
 
7
- Under the hood, [Linked API](https://linkedapi.io) runs a dedicated cloud browser instance for each connected LinkedIn account. When your agent runs a command, the CLI sends the request to Linked API's infrastructure, where an isolated browser with a residential IP performs the action on LinkedIn – simulating human-like mouse movements, keyboard input, and natural browsing patterns. No local browsers, no proxies, no Selenium, no infrastructure to manage.
7
+ ## Install
8
8
 
9
- Your LinkedIn credentials are used only once during the initial account connection on the [platform](https://app.linkedapi.io) and are never stored. All subsequent interaction happens exclusively through private API tokens. Each account is fully isolated, and configurable action limits prevent LinkedIn policy violations. [Learn more about safety](https://linkedapi.io/safety).
9
+ ```bash
10
+ npm install -g @linkedapi/linkedin-cli
11
+ ```
10
12
 
11
- ## Install
13
+ ## Quick Start
12
14
 
13
15
  ```bash
14
- npm install -g linkedin-cli
16
+ # 1. Save your tokens (get them at app.linkedapi.io)
17
+ linkedin setup
18
+
19
+ # 2. Fetch a profile
20
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff --json
21
+
22
+ # 3. Search for people
23
+ linkedin person search --term "revops engineer" --current-companies "Linked API" --json
24
+
25
+ # 4. Send a message
26
+ linkedin message send https://www.linkedin.com/in/vprudnikoff "Hey, loved your latest post!"
15
27
  ```
16
28
 
17
29
  ## Authentication
18
30
 
31
+ ### Initial setup
32
+
19
33
  ```bash
20
34
  linkedin setup
21
35
  ```
@@ -28,6 +42,11 @@ For non-interactive environments (CI, scripts):
28
42
  linkedin setup --linked-api-token=xxx --identification-token=yyy
29
43
  ```
30
44
 
45
+ | Flag | Description |
46
+ |------|-------------|
47
+ | `--linked-api-token` | Linked API Token (skips prompt) |
48
+ | `--identification-token` | Identification Token (skips prompt) |
49
+
31
50
  ### Multiple accounts
32
51
 
33
52
  Run `linkedin setup` again with different tokens to add more accounts. The last added account becomes active.
@@ -37,10 +56,13 @@ Run `linkedin setup` again with different tokens to add more accounts. The last
37
56
  linkedin account list
38
57
 
39
58
  # Switch active account
40
- linkedin account switch "John Doe"
59
+ linkedin account switch "Vlad"
60
+
61
+ # Rename a saved account
62
+ linkedin account rename "Vlad" --name "My Work Account"
41
63
 
42
64
  # Use a specific account for one command
43
- linkedin person fetch https://www.linkedin.com/in/... --account "John Doe"
65
+ linkedin person fetch https://www.linkedin.com/in/... --account "Vlad"
44
66
 
45
67
  # Remove active account (auto-switches to next)
46
68
  linkedin reset
@@ -49,144 +71,769 @@ linkedin reset
49
71
  linkedin reset --all
50
72
  ```
51
73
 
52
- ## Usage
74
+ ## Global Flags
75
+
76
+ Every command supports these flags:
77
+
78
+ | Flag | Description |
79
+ |------|-------------|
80
+ | `--json` | Structured JSON output to stdout |
81
+ | `--fields name,url,...` | Select specific fields in output |
82
+ | `--quiet` / `-q` | Suppress stderr progress |
83
+ | `--no-color` | Disable colors |
84
+ | `--account "Name"` | Use a specific account for this command |
85
+
86
+ ---
87
+
88
+ ## Command Reference
53
89
 
54
90
  ### People
55
91
 
92
+ #### `person fetch`
93
+
94
+ Fetch a LinkedIn person profile with optional additional data sections.
95
+
96
+ ```bash
97
+ linkedin person fetch <url> [flags]
98
+ ```
99
+
100
+ | Arg | Required | Description |
101
+ |-----|----------|-------------|
102
+ | `url` | yes | LinkedIn profile URL |
103
+
104
+ | Flag | Type | Description |
105
+ |------|------|-------------|
106
+ | `--experience` | boolean | Include work experience |
107
+ | `--education` | boolean | Include education history |
108
+ | `--skills` | boolean | Include skills |
109
+ | `--languages` | boolean | Include languages |
110
+ | `--posts` | boolean | Include recent posts |
111
+ | `--comments` | boolean | Include recent comments |
112
+ | `--reactions` | boolean | Include recent reactions |
113
+ | `--posts-limit` | integer | Max posts to retrieve (requires `--posts`) |
114
+ | `--posts-since` | string | Posts since ISO timestamp (requires `--posts`) |
115
+ | `--comments-limit` | integer | Max comments to retrieve (requires `--comments`) |
116
+ | `--comments-since` | string | Comments since ISO timestamp (requires `--comments`) |
117
+ | `--reactions-limit` | integer | Max reactions to retrieve (requires `--reactions`) |
118
+ | `--reactions-since` | string | Reactions since ISO timestamp (requires `--reactions`) |
119
+
120
+ ```bash
121
+ # Basic profile info
122
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff
123
+
124
+ # Full profile with experience and education
125
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff --experience --education --json
126
+
127
+ # Profile with recent posts (last 5)
128
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff --posts --posts-limit 5
129
+
130
+ # Everything
131
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff \
132
+ --experience --education --skills --languages \
133
+ --posts --comments --reactions --json
134
+ ```
135
+
136
+ #### `person search`
137
+
138
+ Search for people on LinkedIn with filters.
139
+
56
140
  ```bash
57
- # Fetch a person profile
58
- linkedin person fetch https://www.linkedin.com/in/john-doe
141
+ linkedin person search [flags]
142
+ ```
59
143
 
60
- # Fetch with experience and posts
61
- linkedin person fetch https://www.linkedin.com/in/john-doe --experience --posts --json
144
+ | Flag | Type | Description |
145
+ |------|------|-------------|
146
+ | `--term` | string | Search keyword or phrase |
147
+ | `--limit` | integer | Max results to return |
148
+ | `--first-name` | string | Filter by first name |
149
+ | `--last-name` | string | Filter by last name |
150
+ | `--position` | string | Filter by job position |
151
+ | `--locations` | string | Comma-separated locations |
152
+ | `--industries` | string | Comma-separated industries |
153
+ | `--current-companies` | string | Comma-separated current company names |
154
+ | `--previous-companies` | string | Comma-separated previous company names |
155
+ | `--schools` | string | Comma-separated school names |
62
156
 
63
- # Search for people
64
- linkedin person search --term "software engineer" --locations "San Francisco" --json
157
+ ```bash
158
+ linkedin person search --term "revops engineer" --locations "San Francisco"
159
+ linkedin person search --current-companies "Linked API" --position "Engineer" --json
160
+ linkedin person search --schools "MIT" --industries "Software Development" --limit 20 --json
65
161
  ```
66
162
 
163
+ ---
164
+
67
165
  ### Companies
68
166
 
167
+ #### `company fetch`
168
+
169
+ Fetch a LinkedIn company profile with optional employees, decision makers, and posts.
170
+
69
171
  ```bash
70
- # Fetch a company
71
- linkedin company fetch https://www.linkedin.com/company/microsoft --json
172
+ linkedin company fetch <url> [flags]
173
+ ```
174
+
175
+ | Arg | Required | Description |
176
+ |-----|----------|-------------|
177
+ | `url` | yes | LinkedIn company URL |
178
+
179
+ | Flag | Type | Description |
180
+ |------|------|-------------|
181
+ | `--employees` | boolean | Include employee data |
182
+ | `--dms` | boolean | Include decision makers |
183
+ | `--posts` | boolean | Include company posts |
184
+ | `--employees-limit` | integer | Max employees to retrieve (requires `--employees`) |
185
+ | `--employees-first-name` | string | Filter employees by first name (requires `--employees`) |
186
+ | `--employees-last-name` | string | Filter employees by last name (requires `--employees`) |
187
+ | `--employees-position` | string | Filter employees by position (requires `--employees`) |
188
+ | `--employees-locations` | string | Filter employees by locations, comma-separated (requires `--employees`) |
189
+ | `--employees-industries` | string | Filter employees by industries, comma-separated (requires `--employees`) |
190
+ | `--employees-schools` | string | Filter employees by schools, comma-separated (requires `--employees`) |
191
+ | `--dms-limit` | integer | Max decision makers to retrieve (requires `--dms`) |
192
+ | `--posts-limit` | integer | Max posts to retrieve (requires `--posts`) |
193
+ | `--posts-since` | string | Posts since ISO timestamp (requires `--posts`) |
194
+
195
+ ```bash
196
+ # Basic company info
197
+ linkedin company fetch https://www.linkedin.com/company/flutterwtf
198
+
199
+ # Company with employees and decision makers
200
+ linkedin company fetch https://www.linkedin.com/company/flutterwtf --employees --dms --json
72
201
 
73
- # Fetch with employees and decision makers
74
- linkedin company fetch https://www.linkedin.com/company/google --employees --dms
202
+ # Filter employees by position and location
203
+ linkedin company fetch https://www.linkedin.com/company/flutterwtf \
204
+ --employees --employees-position "Engineer" --employees-locations "United States"
75
205
 
76
- # Search companies
206
+ # Company posts from last month
207
+ linkedin company fetch https://www.linkedin.com/company/flutterwtf \
208
+ --posts --posts-since 2024-12-01T00:00:00Z --json
209
+ ```
210
+
211
+ #### `company search`
212
+
213
+ Search for companies on LinkedIn with filters.
214
+
215
+ ```bash
216
+ linkedin company search [flags]
217
+ ```
218
+
219
+ | Flag | Type | Description |
220
+ |------|------|-------------|
221
+ | `--term` | string | Search keyword or phrase |
222
+ | `--limit` | integer | Max results to return |
223
+ | `--sizes` | string | Company sizes, comma-separated (`1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`) |
224
+ | `--locations` | string | Comma-separated locations |
225
+ | `--industries` | string | Comma-separated industries |
226
+
227
+ ```bash
77
228
  linkedin company search --term "fintech" --sizes "11-50,51-200" --json
229
+ linkedin company search --industries "Software Development" --locations "Berlin" --json
78
230
  ```
79
231
 
232
+ ---
233
+
80
234
  ### Messages
81
235
 
236
+ #### `message send`
237
+
238
+ Send a message to a LinkedIn connection.
239
+
82
240
  ```bash
83
- # Send a message
84
- linkedin message send https://www.linkedin.com/in/john-doe "Hello John!"
241
+ linkedin message send <person-url> <text>
242
+ ```
243
+
244
+ | Arg | Required | Description |
245
+ |-----|----------|-------------|
246
+ | `person-url` | yes | LinkedIn profile URL of the recipient |
247
+ | `text` | yes | Message text (up to 1900 characters) |
85
248
 
86
- # Get conversation
87
- linkedin message get https://www.linkedin.com/in/john-doe --json
88
- linkedin message get https://www.linkedin.com/in/john-doe --since 2024-01-15T10:30:00Z
249
+ ```bash
250
+ linkedin message send https://www.linkedin.com/in/vprudnikoff "Hey, loved your latest post!"
89
251
  ```
90
252
 
253
+ #### `message get`
254
+
255
+ Get conversation messages with a LinkedIn person.
256
+
257
+ ```bash
258
+ linkedin message get <person-url> [flags]
259
+ ```
260
+
261
+ | Arg | Required | Description |
262
+ |-----|----------|-------------|
263
+ | `person-url` | yes | LinkedIn profile URL |
264
+
265
+ | Flag | Type | Description |
266
+ |------|------|-------------|
267
+ | `--since` | string | Only retrieve messages since this ISO timestamp |
268
+
269
+ ```bash
270
+ linkedin message get https://www.linkedin.com/in/vprudnikoff --json
271
+ linkedin message get https://www.linkedin.com/in/vprudnikoff --since 2024-01-15T10:30:00Z
272
+ ```
273
+
274
+ > **Note:** The first call for a conversation triggers a background sync, which may take longer. Subsequent calls use cached data and are faster.
275
+
276
+ ---
277
+
91
278
  ### Connections
92
279
 
280
+ #### `connection status`
281
+
282
+ Check connection status with a LinkedIn person.
283
+
284
+ ```bash
285
+ linkedin connection status <url>
286
+ ```
287
+
288
+ | Arg | Required | Description |
289
+ |-----|----------|-------------|
290
+ | `url` | yes | LinkedIn profile URL |
291
+
292
+ ```bash
293
+ linkedin connection status https://www.linkedin.com/in/vprudnikoff
294
+ ```
295
+
296
+ #### `connection send`
297
+
298
+ Send a connection request.
299
+
300
+ ```bash
301
+ linkedin connection send <url> [flags]
302
+ ```
303
+
304
+ | Arg | Required | Description |
305
+ |-----|----------|-------------|
306
+ | `url` | yes | LinkedIn profile URL |
307
+
308
+ | Flag | Type | Description |
309
+ |------|------|-------------|
310
+ | `--note` | string | Personalized note to include with the request |
311
+ | `--email` | string | Email address (required by some profiles to connect) |
312
+
313
+ ```bash
314
+ linkedin connection send https://www.linkedin.com/in/vprudnikoff
315
+ linkedin connection send https://www.linkedin.com/in/vprudnikoff --note "Love to connect!"
316
+ linkedin connection send https://www.linkedin.com/in/vprudnikoff --email vlad@example.com
317
+ ```
318
+
319
+ #### `connection list`
320
+
321
+ List your LinkedIn connections with optional filters.
322
+
93
323
  ```bash
94
- # Check connection status
95
- linkedin connection status https://www.linkedin.com/in/john-doe
324
+ linkedin connection list [flags]
325
+ ```
96
326
 
97
- # Send connection request
98
- linkedin connection send https://www.linkedin.com/in/john-doe --note "Love to connect!"
327
+ | Flag | Type | Description |
328
+ |------|------|-------------|
329
+ | `--limit` | integer | Max connections to return |
330
+ | `--since` | string | Only connections made since this ISO timestamp |
331
+ | `--first-name` | string | Filter by first name |
332
+ | `--last-name` | string | Filter by last name |
333
+ | `--position` | string | Filter by job position |
334
+ | `--locations` | string | Comma-separated locations |
335
+ | `--industries` | string | Comma-separated industries |
336
+ | `--current-companies` | string | Comma-separated current company names |
337
+ | `--previous-companies` | string | Comma-separated previous company names |
338
+ | `--schools` | string | Comma-separated school names |
339
+
340
+ > **Note:** `--since` only works when no filter flags are used.
99
341
 
100
- # List connections
342
+ ```bash
101
343
  linkedin connection list --limit 50 --json
344
+ linkedin connection list --current-companies "Linked API" --position "Engineer" --json
345
+ linkedin connection list --since 2024-01-01T00:00:00Z --json
346
+ ```
347
+
348
+ #### `connection pending`
102
349
 
103
- # Pending requests
350
+ List pending outgoing connection requests.
351
+
352
+ ```bash
353
+ linkedin connection pending
354
+ ```
355
+
356
+ ```bash
104
357
  linkedin connection pending --json
358
+ ```
359
+
360
+ #### `connection withdraw`
361
+
362
+ Withdraw a pending connection request.
363
+
364
+ ```bash
365
+ linkedin connection withdraw <url> [flags]
366
+ ```
367
+
368
+ | Arg | Required | Description |
369
+ |-----|----------|-------------|
370
+ | `url` | yes | LinkedIn profile URL |
371
+
372
+ | Flag | Type | Default | Description |
373
+ |------|------|---------|-------------|
374
+ | `--unfollow` / `--no-unfollow` | boolean | `true` | Also unfollow the person |
375
+
376
+ ```bash
377
+ linkedin connection withdraw https://www.linkedin.com/in/vprudnikoff
378
+ linkedin connection withdraw https://www.linkedin.com/in/vprudnikoff --no-unfollow
379
+ ```
380
+
381
+ #### `connection remove`
382
+
383
+ Remove an existing connection.
384
+
385
+ ```bash
386
+ linkedin connection remove <url>
387
+ ```
105
388
 
106
- # Withdraw request
107
- linkedin connection withdraw https://www.linkedin.com/in/john-doe
389
+ | Arg | Required | Description |
390
+ |-----|----------|-------------|
391
+ | `url` | yes | LinkedIn profile URL |
108
392
 
109
- # Remove connection
110
- linkedin connection remove https://www.linkedin.com/in/john-doe
393
+ ```bash
394
+ linkedin connection remove https://www.linkedin.com/in/vprudnikoff
111
395
  ```
112
396
 
397
+ ---
398
+
113
399
  ### Posts
114
400
 
401
+ #### `post fetch`
402
+
403
+ Fetch a LinkedIn post with optional comments and reactions.
404
+
405
+ ```bash
406
+ linkedin post fetch <url> [flags]
407
+ ```
408
+
409
+ | Arg | Required | Description |
410
+ |-----|----------|-------------|
411
+ | `url` | yes | LinkedIn post URL |
412
+
413
+ | Flag | Type | Description |
414
+ |------|------|-------------|
415
+ | `--comments` | boolean | Include comments |
416
+ | `--reactions` | boolean | Include reactions |
417
+ | `--comments-limit` | integer | Max comments to retrieve (requires `--comments`) |
418
+ | `--comments-sort` | string | Sort order: `mostRelevant` or `mostRecent` (requires `--comments`) |
419
+ | `--comments-replies` | boolean | Include replies to comments (requires `--comments`) |
420
+ | `--reactions-limit` | integer | Max reactions to retrieve (requires `--reactions`) |
421
+
422
+ ```bash
423
+ linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123
424
+
425
+ # With comments sorted by most recent, including replies
426
+ linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123 \
427
+ --comments --comments-sort mostRecent --comments-replies --json
428
+
429
+ # With reactions
430
+ linkedin post fetch https://www.linkedin.com/posts/vprudnikoff_activity-123 \
431
+ --comments --reactions --json
432
+ ```
433
+
434
+ #### `post create`
435
+
436
+ Create a LinkedIn post with optional media attachments.
437
+
115
438
  ```bash
116
- # Fetch a post
117
- linkedin post fetch https://www.linkedin.com/posts/john-doe_activity-123 --comments --reactions
439
+ linkedin post create <text> [flags]
440
+ ```
118
441
 
119
- # Create a post
442
+ | Arg | Required | Description |
443
+ |-----|----------|-------------|
444
+ | `text` | yes | Post text (up to 3000 characters) |
445
+
446
+ | Flag | Type | Description |
447
+ |------|------|-------------|
448
+ | `--company-url` | string | Post on behalf of a company page (requires admin access) |
449
+ | `--attachments` | string | Attachments as `url:type` or `url:type:name`. Types: `image`, `video`, `document`. Can be specified multiple times. |
450
+
451
+ > Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.
452
+
453
+ ```bash
120
454
  linkedin post create "Excited to share our latest update!"
121
455
 
122
- # React to a post
123
- linkedin post react https://www.linkedin.com/posts/john-doe_activity-123 --type like
456
+ # With an image
457
+ linkedin post create "Check this out" \
458
+ --attachments "https://example.com/photo.jpg:image"
459
+
460
+ # With a document
461
+ linkedin post create "Our Q4 report" \
462
+ --attachments "https://example.com/report.pdf:document:Q4 Report"
124
463
 
125
- # Comment on a post
126
- linkedin post comment https://www.linkedin.com/posts/john-doe_activity-123 "Great insights!"
464
+ # Post as a company
465
+ linkedin post create "Company announcement" \
466
+ --company-url https://www.linkedin.com/company/flutterwtf
127
467
  ```
128
468
 
469
+ #### `post react`
470
+
471
+ React to a LinkedIn post.
472
+
473
+ ```bash
474
+ linkedin post react <url> --type <reaction> [flags]
475
+ ```
476
+
477
+ | Arg | Required | Description |
478
+ |-----|----------|-------------|
479
+ | `url` | yes | LinkedIn post URL |
480
+
481
+ | Flag | Type | Required | Description |
482
+ |------|------|----------|-------------|
483
+ | `--type` | string | yes | Reaction type: `like`, `love`, `support`, `celebrate`, `insightful`, `funny` |
484
+ | `--company-url` | string | no | React on behalf of a company page |
485
+
486
+ ```bash
487
+ linkedin post react https://www.linkedin.com/posts/vprudnikoff_activity-123 --type like
488
+ linkedin post react https://www.linkedin.com/posts/vprudnikoff_activity-123 --type celebrate \
489
+ --company-url https://www.linkedin.com/company/flutterwtf
490
+ ```
491
+
492
+ #### `post comment`
493
+
494
+ Comment on a LinkedIn post.
495
+
496
+ ```bash
497
+ linkedin post comment <url> <text> [flags]
498
+ ```
499
+
500
+ | Arg | Required | Description |
501
+ |-----|----------|-------------|
502
+ | `url` | yes | LinkedIn post URL |
503
+ | `text` | yes | Comment text (up to 1000 characters) |
504
+
505
+ | Flag | Type | Description |
506
+ |------|------|-------------|
507
+ | `--company-url` | string | Comment on behalf of a company page |
508
+
509
+ ```bash
510
+ linkedin post comment https://www.linkedin.com/posts/vprudnikoff_activity-123 "Great insights!"
511
+ linkedin post comment https://www.linkedin.com/posts/vprudnikoff_activity-123 "Well said!" \
512
+ --company-url https://www.linkedin.com/company/flutterwtf
513
+ ```
514
+
515
+ ---
516
+
129
517
  ### Statistics
130
518
 
519
+ #### `stats ssi`
520
+
521
+ Retrieve your LinkedIn Social Selling Index.
522
+
523
+ ```bash
524
+ linkedin stats ssi [flags]
525
+ ```
526
+
131
527
  ```bash
132
- # Social Selling Index
133
528
  linkedin stats ssi --json
529
+ ```
530
+
531
+ #### `stats performance`
134
532
 
135
- # Performance analytics
533
+ Retrieve your LinkedIn performance analytics (profile views, post impressions, search appearances).
534
+
535
+ ```bash
536
+ linkedin stats performance [flags]
537
+ ```
538
+
539
+ ```bash
136
540
  linkedin stats performance --json
541
+ ```
542
+
543
+ #### `stats usage`
544
+
545
+ Retrieve Linked API usage statistics for a date range.
137
546
 
138
- # API usage
547
+ ```bash
548
+ linkedin stats usage --start <timestamp> --end <timestamp> [flags]
549
+ ```
550
+
551
+ | Flag | Type | Required | Description |
552
+ |------|------|----------|-------------|
553
+ | `--start` | string | yes | Start date in ISO timestamp |
554
+ | `--end` | string | yes | End date in ISO timestamp |
555
+
556
+ ```bash
139
557
  linkedin stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json
140
558
  ```
141
559
 
560
+ ---
561
+
142
562
  ### Sales Navigator
143
563
 
564
+ Requires a LinkedIn Sales Navigator subscription.
565
+
566
+ #### `navigator person fetch`
567
+
568
+ Fetch a person profile via Sales Navigator.
569
+
570
+ ```bash
571
+ linkedin navigator person fetch <hashed-url>
572
+ ```
573
+
574
+ | Arg | Required | Description |
575
+ |-----|----------|-------------|
576
+ | `hashed-url` | yes | Hashed LinkedIn profile URL |
577
+
144
578
  ```bash
145
- # Person
146
579
  linkedin navigator person fetch https://www.linkedin.com/in/ACwAAA...
580
+ ```
581
+
582
+ #### `navigator person search`
583
+
584
+ Search for people via Sales Navigator with advanced filters.
585
+
586
+ ```bash
587
+ linkedin navigator person search [flags]
588
+ ```
589
+
590
+ | Flag | Type | Description |
591
+ |------|------|-------------|
592
+ | `--term` | string | Search keyword or phrase |
593
+ | `--limit` | integer | Max results to return |
594
+ | `--first-name` | string | Filter by first name |
595
+ | `--last-name` | string | Filter by last name |
596
+ | `--position` | string | Filter by job position |
597
+ | `--locations` | string | Comma-separated locations |
598
+ | `--industries` | string | Comma-separated industries |
599
+ | `--current-companies` | string | Comma-separated current company names |
600
+ | `--previous-companies` | string | Comma-separated previous company names |
601
+ | `--schools` | string | Comma-separated school names |
602
+ | `--years-of-experience` | string | Comma-separated experience ranges: `lessThanOne`, `oneToTwo`, `threeToFive`, `sixToTen`, `moreThanTen` |
603
+
604
+ ```bash
147
605
  linkedin navigator person search --term "VP Marketing" --locations "United States"
606
+ linkedin navigator person search --years-of-experience "moreThanTen" --position "CEO" --json
607
+ ```
608
+
609
+ #### `navigator company fetch`
610
+
611
+ Fetch a company profile via Sales Navigator with optional employees and decision makers.
612
+
613
+ ```bash
614
+ linkedin navigator company fetch <hashed-url> [flags]
615
+ ```
616
+
617
+ | Arg | Required | Description |
618
+ |-----|----------|-------------|
619
+ | `hashed-url` | yes | Hashed LinkedIn company URL |
620
+
621
+ | Flag | Type | Description |
622
+ |------|------|-------------|
623
+ | `--employees` | boolean | Include employee data |
624
+ | `--dms` | boolean | Include decision makers |
625
+ | `--employees-limit` | integer | Max employees to retrieve (requires `--employees`) |
626
+ | `--employees-first-name` | string | Filter employees by first name (requires `--employees`) |
627
+ | `--employees-last-name` | string | Filter employees by last name (requires `--employees`) |
628
+ | `--employees-positions` | string | Filter employees by positions, comma-separated (requires `--employees`) |
629
+ | `--employees-locations` | string | Filter employees by locations, comma-separated (requires `--employees`) |
630
+ | `--employees-industries` | string | Filter employees by industries, comma-separated (requires `--employees`) |
631
+ | `--employees-schools` | string | Filter employees by schools, comma-separated (requires `--employees`) |
632
+ | `--employees-years-of-experience` | string | Filter employees by experience ranges, comma-separated (requires `--employees`) |
633
+ | `--dms-limit` | integer | Max decision makers to retrieve (requires `--dms`) |
634
+
635
+ ```bash
636
+ linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural --employees --dms
637
+ linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural \
638
+ --employees --employees-positions "Engineer,Designer" --employees-locations "Europe"
639
+ ```
640
+
641
+ #### `navigator company search`
642
+
643
+ Search for companies via Sales Navigator with advanced filters including revenue.
644
+
645
+ ```bash
646
+ linkedin navigator company search [flags]
647
+ ```
148
648
 
149
- # Company
150
- linkedin navigator company fetch https://www.linkedin.com/sales/company/1035 --employees
151
- linkedin navigator company search --term "fintech" --revenue-min 1 --revenue-max 50
649
+ | Flag | Type | Description |
650
+ |------|------|-------------|
651
+ | `--term` | string | Search keyword or phrase |
652
+ | `--limit` | integer | Max results to return |
653
+ | `--sizes` | string | Company sizes, comma-separated (`1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`) |
654
+ | `--locations` | string | Comma-separated locations |
655
+ | `--industries` | string | Comma-separated industries |
656
+ | `--revenue-min` | string | Min annual revenue in M USD: `0`, `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000` |
657
+ | `--revenue-max` | string | Max annual revenue in M USD: `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000`, `1000+` |
152
658
 
153
- # Messages
154
- linkedin navigator message send https://www.linkedin.com/in/john-doe "Hello!" --subject "Partnership"
155
- linkedin navigator message get https://www.linkedin.com/in/john-doe
659
+ ```bash
660
+ linkedin navigator company search --term "fintech" --sizes "11-50,51-200"
661
+ linkedin navigator company search --revenue-min 10 --revenue-max 100 --locations "United States" --json
156
662
  ```
157
663
 
664
+ #### `navigator message send`
665
+
666
+ Send a message via Sales Navigator (InMail).
667
+
668
+ ```bash
669
+ linkedin navigator message send <person-url> <text> --subject <subject>
670
+ ```
671
+
672
+ | Arg | Required | Description |
673
+ |-----|----------|-------------|
674
+ | `person-url` | yes | LinkedIn profile URL of the recipient |
675
+ | `text` | yes | Message text (up to 1900 characters) |
676
+
677
+ | Flag | Type | Required | Description |
678
+ |------|------|----------|-------------|
679
+ | `--subject` | string | yes | Message subject line (up to 80 characters) |
680
+
681
+ ```bash
682
+ linkedin navigator message send https://www.linkedin.com/in/vprudnikoff "Would love to chat about API integrations" --subject "Partnership Opportunity"
683
+ ```
684
+
685
+ #### `navigator message get`
686
+
687
+ Get Sales Navigator conversation messages.
688
+
689
+ ```bash
690
+ linkedin navigator message get <person-url> [flags]
691
+ ```
692
+
693
+ | Arg | Required | Description |
694
+ |-----|----------|-------------|
695
+ | `person-url` | yes | LinkedIn profile URL |
696
+
697
+ | Flag | Type | Description |
698
+ |------|------|-------------|
699
+ | `--since` | string | Only retrieve messages since this ISO timestamp |
700
+
701
+ ```bash
702
+ linkedin navigator message get https://www.linkedin.com/in/vprudnikoff
703
+ linkedin navigator message get https://www.linkedin.com/in/vprudnikoff --since 2024-01-15T10:30:00Z
704
+ ```
705
+
706
+ ---
707
+
158
708
  ### Custom Workflows
159
709
 
710
+ #### `workflow run`
711
+
712
+ Execute a custom workflow definition. Accepts JSON from a file or stdin.
713
+
160
714
  ```bash
161
- # Run from file
715
+ linkedin workflow run [flags]
716
+ ```
717
+
718
+ | Flag | Type | Description |
719
+ |------|------|-------------|
720
+ | `-f` / `--file` | string | Path to workflow JSON file |
721
+
722
+ ```bash
723
+ # From file
162
724
  linkedin workflow run --file workflow.json
163
725
 
164
- # Pipe from stdin
726
+ # From stdin
165
727
  cat workflow.json | linkedin workflow run
166
728
 
167
- # Check status / wait for completion
729
+ # Inline
730
+ echo '{"actions":[...]}' | linkedin workflow run
731
+ ```
732
+
733
+ See [Custom Workflows](https://linkedapi.io/docs/custom-workflows) for the workflow JSON schema.
734
+
735
+ #### `workflow status`
736
+
737
+ Check status of a running workflow or wait for its completion.
738
+
739
+ ```bash
740
+ linkedin workflow status <id> [flags]
741
+ ```
742
+
743
+ | Arg | Required | Description |
744
+ |-----|----------|-------------|
745
+ | `id` | yes | Workflow ID |
746
+
747
+ | Flag | Type | Description |
748
+ |------|------|-------------|
749
+ | `--wait` | boolean | Block until the workflow completes |
750
+
751
+ ```bash
752
+ # Check current status
168
753
  linkedin workflow status abc123
754
+
755
+ # Wait for completion
169
756
  linkedin workflow status abc123 --wait --json
170
757
  ```
171
758
 
172
- ## Global Flags
759
+ ---
173
760
 
174
- Every command supports:
761
+ ### Account Management
175
762
 
176
- | Flag | Description |
177
- |------|-------------|
178
- | `--json` | Structured JSON output to stdout |
179
- | `--fields name,url,...` | Select specific fields in output |
180
- | `--quiet` / `-q` | Suppress stderr progress |
181
- | `--no-color` | Disable colors |
182
- | `--account "Name"` | Use a specific account (when multiple are configured) |
763
+ #### `account list`
764
+
765
+ List all configured LinkedIn accounts.
766
+
767
+ ```bash
768
+ linkedin account list
769
+ ```
770
+
771
+ The active account is marked with `*`.
772
+
773
+ #### `account switch`
774
+
775
+ Switch the active LinkedIn account.
776
+
777
+ ```bash
778
+ linkedin account switch <name>
779
+ ```
780
+
781
+ | Arg | Required | Description |
782
+ |-----|----------|-------------|
783
+ | `name` | yes | Account name (case-insensitive substring match) |
784
+
785
+ ```bash
786
+ linkedin account switch "Vlad"
787
+ ```
788
+
789
+ #### `account rename`
790
+
791
+ Rename a saved LinkedIn account.
792
+
793
+ ```bash
794
+ linkedin account rename <name> --name <new-name>
795
+ ```
796
+
797
+ | Arg | Required | Description |
798
+ |-----|----------|-------------|
799
+ | `name` | yes | Current account name (case-insensitive substring match) |
800
+
801
+ | Flag | Type | Required | Description |
802
+ |------|------|----------|-------------|
803
+ | `--name` | string | yes | New name for the account |
804
+
805
+ ```bash
806
+ linkedin account rename "Vlad" --name "My Work Account"
807
+ ```
808
+
809
+ #### `reset`
810
+
811
+ Remove stored accounts and tokens.
812
+
813
+ ```bash
814
+ linkedin reset [flags]
815
+ ```
816
+
817
+ | Flag | Type | Description |
818
+ |------|------|-------------|
819
+ | `--all` | boolean | Remove all accounts (default: removes only active account) |
820
+
821
+ ```bash
822
+ # Remove active account (auto-switches to next)
823
+ linkedin reset
824
+
825
+ # Remove all accounts
826
+ linkedin reset --all
827
+ ```
828
+
829
+ ---
183
830
 
184
831
  ## Output Format
185
832
 
186
833
  ### JSON mode (`--json` or non-TTY stdout)
187
834
 
188
835
  ```json
189
- {"success": true, "data": {"name": "John Doe", "headline": "Engineer"}}
836
+ {"success": true, "data": {"name": "Vlad Prudnikov", "headline": "CEO at Linked API"}}
190
837
  ```
191
838
 
192
839
  ```json
@@ -240,19 +887,19 @@ Example agent usage:
240
887
  linkedin setup --linked-api-token=xxx --identification-token=yyy
241
888
 
242
889
  # Fetch just name and headline
243
- linkedin person fetch https://www.linkedin.com/in/john-doe --json --fields name,headline -q
890
+ linkedin person fetch https://www.linkedin.com/in/vprudnikoff --json --fields name,headline -q
244
891
 
245
892
  # Pipe to jq
246
- linkedin person search --term "engineer" --json -q | jq '.data[].name'
893
+ linkedin person search --term "revops engineer" --json -q | jq '.data[].name'
247
894
  ```
248
895
 
249
896
  ## Links
250
897
 
251
898
  - [Linked API Documentation](https://linkedapi.io/docs)
252
- - [Getting Started](https://linkedapi.io/docs/getting-started)
253
899
  - [Safety & Security](https://linkedapi.io/safety)
254
- - [Node.js SDK](https://www.npmjs.com/package/linkedapi-node)
900
+ - [Node.js SDK](https://www.npmjs.com/package/@linkedapi/node)
901
+ - [MCP Server](https://www.npmjs.com/package/@linkedapi/mcp)
255
902
 
256
903
  ## License
257
904
 
258
- MIT
905
+ This project is licensed under the MIT – see the [LICENSE](https://github.com/Linked-API/linkedin-cli/blob/main/LICENSE) file for details.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "commands": {},
3
- "version": "1.0.1"
3
+ "version": "1.0.2"
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linkedapi/linkedin-cli",
3
- "version": "1.0.1",
4
- "description": "AI-agent-friendly CLI for LinkedIn automation via Linked API",
3
+ "version": "1.0.2",
4
+ "description": "AI-agent-friendly CLI for controlling LinkedIn accounts and retrieving real-time data.",
5
5
  "author": "Linked API",
6
6
  "license": "MIT",
7
7
  "homepage": "https://linkedapi.io",