@linkedapi/linkedin-cli 1.0.1 → 1.0.3

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