linkedin-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to Use
适用场景
Use this skill when you need to automate LinkedIn tasks such as profile fetching, connection management, or post creation via CLI, especially when integrated into automated workflows.
当你需要通过CLI自动化LinkedIn任务时使用该工具,比如获取档案、管理人脉或创建帖子,尤其适合集成到自动化工作流中。
LinkedIn Skill
LinkedIn 自动化工具
You have access to – a CLI tool for LinkedIn automation. Use it to fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and more.
linkedinEach command sends a request to Linked API, which runs a real cloud browser to perform the action on LinkedIn. Operations are not instant – expect 30 seconds to several minutes depending on complexity.
If is not available, install it:
linkedinbash
npm install -g @linkedapi/linkedin-cli你可以使用——一款用于LinkedIn自动化的CLI工具。通过它可以获取个人/公司档案、搜索人脉和企业、发送消息、管理人脉、创建帖子、点赞、评论等。
linkedin每个命令都会向Linked API发送请求,该API会运行一个真实的云端浏览器来在LinkedIn上执行操作。操作并非即时完成——根据复杂度不同,预计需要30秒到数分钟不等。
如果未安装,可执行以下命令安装:
linkedinbash
npm install -g @linkedapi/linkedin-cliAuthentication
身份验证
If a command fails with exit code 2 (authentication error), ask the user to set up their account:
- Go to app.linkedapi.io and sign up or log in
- Connect their LinkedIn account
- Copy the Linked API Token and Identification Token from the dashboard
Once the user provides the tokens, run:
bash
linkedin setup --linked-api-token=TOKEN --identification-token=TOKEN如果命令执行失败并返回退出码2(身份验证错误),请引导用户完成账户设置:
- 访问app.linkedapi.io并注册或登录
- 关联其LinkedIn账户
- 从控制台复制Linked API Token和Identification Token
用户提供令牌后,运行以下命令:
bash
linkedin setup --linked-api-token=TOKEN --identification-token=TOKENWhen to Use
适用场景
Use this skill when you need to orchestrate LinkedIn actions from scripts or an AI agent instead of clicking through the web UI:
- Building outreach, research, or recruiting workflows that rely on LinkedIn data and messaging.
- Enriching leads or accounts by fetching people and company profiles in bulk.
- Coordinating multi-step Sales Navigator or workflow runs where JSON output and exit codes are required.
Always respect LinkedIn’s terms of service, local regulations, and your organisation’s compliance policies when using automation against real accounts.
当你需要通过脚本或AI Agent来编排LinkedIn操作,而非手动操作网页UI时使用该工具:
- 构建依赖LinkedIn数据和消息功能的开发拓展、调研或招聘工作流。
- 通过批量获取个人和公司档案来丰富潜在客户或企业信息。
- 协调多步骤的Sales Navigator或工作流运行,这类场景需要JSON输出和退出码支持。
使用自动化操作真实账户时,请务必遵守LinkedIn的服务条款、当地法规以及所在组织的合规政策。
Global Flags
全局参数
Always use and for machine-readable output:
--json-qbash
linkedin <command> --json -q| Flag | Description |
|---|---|
| Structured JSON output |
| Suppress stderr progress messages |
| Select specific fields in output |
| Disable colors |
| Use a specific account for this command |
请始终使用和参数以获取机器可读的输出:
--json-qbash
linkedin <command> --json -q| 参数 | 说明 |
|---|---|
| 输出结构化JSON格式数据 |
| 抑制标准错误输出中的进度消息 |
| 选择输出中的特定字段 |
| 禁用颜色显示 |
| 为此命令使用指定的账户 |
Output Format
输出格式
Success:
json
{ "success": true, "data": { "name": "John Doe", "headline": "Engineer" } }Error:
json
{
"success": false,
"error": { "type": "personNotFound", "message": "Person not found" }
}Exit code 0 means the API call succeeded – always check the field for the action outcome. Non-zero exit codes indicate infrastructure errors:
success| Exit Code | Meaning |
|---|---|
| 0 | Success (check |
| 1 | General/unexpected error |
| 2 | Missing or invalid tokens |
| 3 | Subscription/plan required |
| 4 | LinkedIn account issue |
| 5 | Invalid arguments |
| 6 | Rate limited |
| 7 | Network error |
| 8 | Workflow timeout (workflowId returned for recovery) |
成功输出:
json
{ "success": true, "data": { "name": "John Doe", "headline": "Engineer" } }错误输出:
json
{
"success": false,
"error": { "type": "personNotFound", "message": "Person not found" }
}退出码0表示API调用成功——请始终检查字段以确认操作结果。非零退出码表示基础设施错误:
success| 退出码 | 说明 |
|---|---|
| 0 | 成功(需检查 |
| 1 | 常规/意外错误 |
| 2 | 令牌缺失或无效 |
| 3 | 需要订阅/付费计划 |
| 4 | LinkedIn账户问题 |
| 5 | 参数无效 |
| 6 | 请求受限(触发频率限制) |
| 7 | 网络错误 |
| 8 | 工作流超时(返回workflowId用于恢复) |
Commands
命令列表
Fetch a Person Profile
获取个人档案
bash
linkedin person fetch <url> [flags] --json -qOptional flags to include additional data:
- – work history
--experience - – education history
--education - – skills list
--skills - – languages
--languages - – recent posts (with
--posts,--posts-limit N)--posts-since TIMESTAMP - – recent comments (with
--comments,--comments-limit N)--comments-since TIMESTAMP - – recent reactions (with
--reactions,--reactions-limit N)--reactions-since TIMESTAMP
Only request additional data when needed – each flag increases execution time.
bash
undefinedbash
linkedin person fetch <url> [flags] --json -q可选参数以获取额外数据:
- – 工作经历
--experience - – 教育经历
--education - – 技能列表
--skills - – 掌握语言
--languages - – 近期帖子(搭配
--posts、--posts-limit N使用)--posts-since TIMESTAMP - – 近期评论(搭配
--comments、--comments-limit N使用)--comments-since TIMESTAMP - – 近期互动(搭配
--reactions、--reactions-limit N使用)--reactions-since TIMESTAMP
仅在需要时请求额外数据——每个参数都会增加执行时间。
bash
undefinedBasic profile
基础档案信息
linkedin person fetch https://www.linkedin.com/in/username --json -q
linkedin person fetch https://www.linkedin.com/in/username --json -q
With experience and education
包含工作和教育经历
linkedin person fetch https://www.linkedin.com/in/username --experience --education --json -q
linkedin person fetch https://www.linkedin.com/in/username --experience --education --json -q
With last 5 posts
包含最近5条帖子
linkedin person fetch https://www.linkedin.com/in/username --posts --posts-limit 5 --json -q
undefinedlinkedin person fetch https://www.linkedin.com/in/username --posts --posts-limit 5 --json -q
undefinedSearch People
搜索人脉
bash
linkedin person search [flags] --json -q| Flag | Description |
|---|---|
| Search keyword or phrase |
| Max results |
| Filter by first name |
| Filter by last name |
| Filter by job position |
| Comma-separated locations |
| Comma-separated industries |
| Comma-separated current company names |
| Comma-separated previous company names |
| Comma-separated school names |
bash
linkedin person search --term "product manager" --locations "San Francisco" --json -q
linkedin person search --current-companies "Google" --position "Engineer" --limit 20 --json -qbash
linkedin person search [flags] --json -q| 参数 | 说明 |
|---|---|
| 搜索关键词或短语 |
| 最大结果数量 |
| 按名字过滤 |
| 按姓氏过滤 |
| 按职位过滤 |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 逗号分隔的当前公司名称列表 |
| 逗号分隔的过往公司名称列表 |
| 逗号分隔的学校名称列表 |
bash
linkedin person search --term "product manager" --locations "San Francisco" --json -q
linkedin person search --current-companies "Google" --position "Engineer" --limit 20 --json -qFetch a Company
获取企业档案
bash
linkedin company fetch <url> [flags] --json -qOptional flags:
- – include employees
--employees - – include decision makers
--dms - – include company posts
--posts
Employee filters (require ):
--employees| Flag | Description |
|---|---|
| Max employees to retrieve |
| Filter by first name |
| Filter by last name |
| Filter by position |
| Comma-separated locations |
| Comma-separated industries |
| Comma-separated school names |
| Flag | Description |
|---|---|
| Max decision makers to retrieve (requires |
| Max posts to retrieve (requires |
| Posts since ISO timestamp (requires |
bash
undefinedbash
linkedin company fetch <url> [flags] --json -q可选参数:
- – 包含企业员工信息
--employees - – 包含企业决策者信息
--dms - – 包含企业发布的帖子
--posts
员工过滤参数(需搭配使用):
--employees| Flag | Description |
|---|---|
| 最大获取员工数量 |
| 按名字过滤 |
| 按姓氏过滤 |
| 按职位过滤 |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 逗号分隔的学校名称列表 |
| 参数 | 说明 |
|---|---|
| 最大获取决策者数量(需搭配 |
| 最大获取帖子数量(需搭配 |
| 获取指定ISO时间戳之后的帖子(需搭配 |
bash
undefinedBasic company info
基础企业信息
linkedin company fetch https://www.linkedin.com/company/name --json -q
linkedin company fetch https://www.linkedin.com/company/name --json -q
With employees filtered by position
包含指定职位的员工信息
linkedin company fetch https://www.linkedin.com/company/name --employees --employees-position "Engineer" --json -q
linkedin company fetch https://www.linkedin.com/company/name --employees --employees-position "Engineer" --json -q
With decision makers and posts
包含决策者和最近10条帖子
linkedin company fetch https://www.linkedin.com/company/name --dms --posts --posts-limit 10 --json -q
undefinedlinkedin company fetch https://www.linkedin.com/company/name --dms --posts --posts-limit 10 --json -q
undefinedSearch Companies
搜索企业
bash
linkedin company search [flags] --json -q| Flag | Description |
|---|---|
| Search keyword |
| Max results |
| Comma-separated sizes: |
| Comma-separated locations |
| Comma-separated industries |
bash
linkedin company search --term "fintech" --sizes "11-50,51-200" --json -qbash
linkedin company search [flags] --json -q| 参数 | 说明 |
|---|---|
| 搜索关键词 |
| 最大结果数量 |
| 逗号分隔的企业规模: |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
bash
linkedin company search --term "fintech" --sizes "11-50,51-200" --json -qSend a Message
发送消息
bash
linkedin message send <person-url> '<text>' --json -qText up to 1900 characters. Wrap the message in single quotes to avoid shell interpretation issues.
bash
linkedin message send https://www.linkedin.com/in/username 'Hey, loved your latest post!' --json -qbash
linkedin message send <person-url> '<text>' --json -q消息文本最多1900字符。请使用单引号包裹消息文本,避免特殊字符被Shell解析。
bash
linkedin message send https://www.linkedin.com/in/username 'Hey, loved your latest post!' --json -qGet Conversation
获取对话记录
bash
linkedin message get <person-url> [--since TIMESTAMP] --json -qThe first call for a conversation triggers a background sync and may take longer. Subsequent calls are faster.
bash
linkedin message get https://www.linkedin.com/in/username --json -q
linkedin message get https://www.linkedin.com/in/username --since 2024-01-15T10:30:00Z --json -qbash
linkedin message get <person-url> [--since TIMESTAMP] --json -q首次获取对话记录会触发后台同步,耗时可能较长。后续获取速度会更快。
bash
linkedin message get https://www.linkedin.com/in/username --json -q
linkedin message get https://www.linkedin.com/in/username --since 2024-01-15T10:30:00Z --json -qConnection Management
人脉管理
Check connection status
检查人脉状态
bash
linkedin connection status <url> --json -qbash
linkedin connection status <url> --json -qSend connection request
发送好友请求
bash
linkedin connection send <url> [--note 'text'] [--email user@example.com] --json -qbash
linkedin connection send <url> [--note 'text'] [--email user@example.com] --json -qList connections
列出人脉列表
bash
linkedin connection list [flags] --json -q| Flag | Description |
|---|---|
| Max connections to return |
| Only connections made since ISO timestamp (only works when no filter flags are used) |
| Filter by first name |
| Filter by last name |
| Filter by job position |
| Comma-separated locations |
| Comma-separated industries |
| Comma-separated current company names |
| Comma-separated previous company names |
| Comma-separated school names |
bash
linkedin connection list --limit 50 --json -q
linkedin connection list --current-companies "Google" --position "Engineer" --json -q
linkedin connection list --since 2024-01-01T00:00:00Z --json -qbash
linkedin connection list [flags] --json -q| 参数 | 说明 |
|---|---|
| 最大返回人脉数量 |
| 仅返回指定ISO时间戳之后添加的人脉(仅在未使用其他过滤参数时生效) |
| 按名字过滤 |
| 按姓氏过滤 |
| 按职位过滤 |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 逗号分隔的当前公司名称 |
| 逗号分隔的过往公司名称 |
| 逗号分隔的学校名称 |
bash
linkedin connection list --limit 50 --json -q
linkedin connection list --current-companies "Google" --position "Engineer" --json -q
linkedin connection list --since 2024-01-01T00:00:00Z --json -qList pending outgoing requests
列出待处理的好友请求
bash
linkedin connection pending --json -qbash
linkedin connection pending --json -qWithdraw a pending request
撤回待处理的好友请求
bash
linkedin connection withdraw <url> [--no-unfollow] --json -qBy default, withdrawing also unfollows the person. Use to keep following.
--no-unfollowbash
linkedin connection withdraw <url> [--no-unfollow] --json -q默认情况下,撤回请求同时会取消关注对方。使用参数可保持关注状态。
--no-unfollowRemove a connection
删除人脉
bash
linkedin connection remove <url> --json -qbash
linkedin connection remove <url> --json -qPosts
帖子管理
Fetch a post
获取单条帖子
bash
linkedin post fetch <url> [flags] --json -q| Flag | Description |
|---|---|
| Include comments |
| Include reactions |
| Max comments to retrieve (requires |
| Sort order: |
| Include replies to comments (requires |
| Max reactions to retrieve (requires |
bash
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 --json -qbash
linkedin post fetch <url> [flags] --json -q| 参数 | 说明 |
|---|---|
| 包含帖子评论 |
| 包含帖子互动 |
| 最大获取评论数量(需搭配 |
| 评论排序方式: |
| 包含评论的回复内容(需搭配 |
| 最大获取互动数量(需搭配 |
bash
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 --json -qWith comments sorted by most recent, including replies
包含按最新排序的评论及回复
linkedin post fetch https://www.linkedin.com/posts/username_activity-123
--comments --comments-sort mostRecent --comments-replies --json -q
--comments --comments-sort mostRecent --comments-replies --json -q
undefinedlinkedin post fetch https://www.linkedin.com/posts/username_activity-123
--comments --comments-sort mostRecent --comments-replies --json -q
--comments --comments-sort mostRecent --comments-replies --json -q
undefinedCreate a post
创建帖子
bash
linkedin post create '<text>' [flags] --json -q| Flag | Description |
|---|---|
| Post on behalf of a company page (requires admin access) |
| Attachment as |
Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.
bash
linkedin post create 'Excited to share our latest update!' --json -qbash
linkedin post create '<text>' [flags] --json -q| 参数 | 说明 |
|---|---|
| 代表企业账号发布帖子(需拥有企业账号管理员权限) |
| 附件格式为 |
附件限制:最多9张图片,或1个视频,或1份文档。不可混合不同类型的附件。
bash
linkedin post create 'Excited to share our latest update!' --json -qWith a document
附带文档
linkedin post create 'Our Q4 report'
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
linkedin post create 'Our Q4 report'
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
Post as a company
以企业账号发布
linkedin post create 'Company announcement'
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedlinkedin post create 'Company announcement'
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedReact to a post
互动帖子
bash
linkedin post react <url> --type <reaction> [--company-url <url>] --json -qReaction types: , , , , , .
likelovesupportcelebrateinsightfulfunnybash
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type like --json -qbash
linkedin post react <url> --type <reaction> [--company-url <url>] --json -q支持的互动类型:、、、、、。
likelovesupportcelebrateinsightfulfunnybash
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type like --json -qReact on behalf of a company
以企业账号互动
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type celebrate
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedlinkedin post react https://www.linkedin.com/posts/username_activity-123 --type celebrate
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedComment on a post
评论帖子
bash
linkedin post comment <url> '<text>' [--company-url <url>] --json -qText up to 1000 characters.
bash
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Great insights!' --json -qbash
linkedin post comment <url> '<text>' [--company-url <url>] --json -q评论文本最多1000字符。
bash
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Great insights!' --json -qComment on behalf of a company
以企业账号评论
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Well said!'
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedlinkedin post comment https://www.linkedin.com/posts/username_activity-123 'Well said!'
--company-url https://www.linkedin.com/company/name --json -q
--company-url https://www.linkedin.com/company/name --json -q
undefinedStatistics
数据统计
bash
undefinedbash
undefinedSocial Selling Index
社交销售指数(SSI)
linkedin stats ssi --json -q
linkedin stats ssi --json -q
Performance analytics (profile views, post impressions, search appearances)
账号表现分析(档案浏览量、帖子曝光量、搜索出现次数)
linkedin stats performance --json -q
linkedin stats performance --json -q
API usage for a date range
指定日期范围内的API使用统计
linkedin stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json -q
undefinedlinkedin stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json -q
undefinedSales Navigator
Sales Navigator 功能
Requires a LinkedIn Sales Navigator subscription. Uses hashed URLs for person/company lookups.
需要LinkedIn Sales Navigator订阅权限。使用哈希URL进行用户/企业查询。
Fetch person
获取Sales Navigator用户档案
bash
linkedin navigator person fetch <hashed-url> --json -qbash
linkedin navigator person fetch <hashed-url> --json -qSearch people
搜索Sales Navigator用户
bash
linkedin navigator person search [flags] --json -q| Flag | Description |
|---|---|
| Search keyword or phrase |
| Max results |
| Filter by first name |
| Filter by last name |
| Filter by job position |
| Comma-separated locations |
| Comma-separated industries |
| Comma-separated current company names |
| Comma-separated previous company names |
| Comma-separated school names |
| Comma-separated ranges: |
bash
linkedin navigator person search --term "VP Marketing" --locations "United States" --json -q
linkedin navigator person search --years-of-experience "moreThanTen" --position "CEO" --json -qbash
linkedin navigator person search [flags] --json -q| 参数 | 说明 |
|---|---|
| 搜索关键词或短语 |
| 最大结果数量 |
| 按名字过滤 |
| 按姓氏过滤 |
| 按职位过滤 |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 逗号分隔的当前公司名称 |
| 逗号分隔的过往公司名称 |
| 逗号分隔的学校名称列表 |
| 逗号分隔的经验范围: |
bash
linkedin navigator person search --term "VP Marketing" --locations "United States" --json -q
linkedin navigator person search --years-of-experience "moreThanTen" --position "CEO" --json -qFetch company
获取Sales Navigator企业档案
bash
linkedin navigator company fetch <hashed-url> [flags] --json -qOptional flags:
- – include employees
--employees - – include decision makers
--dms
Employee filters (require ):
--employees| Flag | Description |
|---|---|
| Max employees to retrieve |
| Filter by first name |
| Filter by last name |
| Comma-separated positions |
| Comma-separated locations |
| Comma-separated industries |
| Comma-separated school names |
| Comma-separated experience ranges |
| Max decision makers to retrieve (requires |
bash
linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural --employees --dms --json -q
linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural \
--employees --employees-positions "Engineer,Designer" --employees-locations "Europe" --json -qbash
linkedin navigator company fetch <hashed-url> [flags] --json -q可选参数:
- – 包含企业员工信息
--employees - – 包含企业决策者信息
--dms
员工过滤参数(需搭配使用):
--employees| 参数 | 说明 |
|---|---|
| 最大获取员工数量 |
| 按名字过滤 |
| 按姓氏过滤 |
| 逗号分隔的职位列表 |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 逗号分隔的学校名称列表 |
| 逗号分隔的经验范围 |
| 最大获取决策者数量(需搭配 |
bash
linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural --employees --dms --json -q
linkedin navigator company fetch https://www.linkedin.com/sales/company/97ural \
--employees --employees-positions "Engineer,Designer" --employees-locations "Europe" --json -qSearch companies
搜索Sales Navigator企业
bash
linkedin navigator company search [flags] --json -q| Flag | Description |
|---|---|
| Search keyword |
| Max results |
| Comma-separated sizes: |
| Comma-separated locations |
| Comma-separated industries |
| Min annual revenue in M USD: |
| Max annual revenue in M USD: |
bash
linkedin navigator company search --term "fintech" --sizes "11-50,51-200" --json -q
linkedin navigator company search --revenue-min 10 --revenue-max 100 --locations "United States" --json -qbash
linkedin navigator company search [flags] --json -q| 参数 | 说明 |
|---|---|
| 搜索关键词 |
| 最大结果数量 |
| 逗号分隔的企业规模: |
| 逗号分隔的地区列表 |
| 逗号分隔的行业列表 |
| 最小年收入(百万美元): |
| 最大年收入(百万美元): |
bash
linkedin navigator company search --term "fintech" --sizes "11-50,51-200" --json -q
linkedin navigator company search --revenue-min 10 --revenue-max 100 --locations "United States" --json -qSend InMail
发送InMail
bash
linkedin navigator message send <person-url> '<text>' --subject '<subject>' --json -qText up to 1900 characters. Subject up to 80 characters.
bash
linkedin navigator message send https://www.linkedin.com/in/username \
'Would love to chat about API integrations' --subject 'Partnership Opportunity' --json -qbash
linkedin navigator message send <person-url> '<text>' --subject '<subject>' --json -q消息文本最多1900字符。主题最多80字符。
bash
linkedin navigator message send https://www.linkedin.com/in/username \
'Would love to chat about API integrations' --subject 'Partnership Opportunity' --json -qGet Sales Navigator conversation
获取Sales Navigator对话记录
bash
linkedin navigator message get <person-url> [--since TIMESTAMP] --json -qbash
linkedin navigator message get <person-url> [--since TIMESTAMP] --json -qCustom Workflows
自定义工作流
Execute a custom workflow definition from a file, stdin, or inline:
bash
undefined从文件、标准输入或内联定义执行自定义工作流:
bash
undefinedFrom file
从文件加载工作流
linkedin workflow run --file workflow.json --json -q
linkedin workflow run --file workflow.json --json -q
From stdin
从标准输入加载工作流
cat workflow.json | linkedin workflow run --json -q
cat workflow.json | linkedin workflow run --json -q
Inline
内联工作流定义
echo '{"actions":[...]}' | linkedin workflow run --json -q
Check workflow status or wait for completion:
```bash
linkedin workflow status <id> --json -q
linkedin workflow status <id> --wait --json -qSee Building Workflows for the workflow JSON schema.
echo '{"actions":[...]}' | linkedin workflow run --json -q
查询工作流状态或等待工作流完成:
```bash
linkedin workflow status <id> --json -q
linkedin workflow status <id> --wait --json -q工作流JSON schema请参考Building Workflows。
Account Management
账号管理
bash
linkedin account list # List accounts (* = active)
linkedin account switch "Name" # Switch active account
linkedin account rename "Name" --name "New Name" # Rename account
linkedin reset # Remove active account
linkedin reset --all # Remove all accountsbash
linkedin account list # 列出所有关联账号(* = 当前活跃账号)
linkedin account switch "Name" # 切换活跃账号
linkedin account rename "Name" --name "New Name" # 重命名账号
linkedin reset # 移除当前活跃账号
linkedin reset --all # 移除所有关联账号Important Behavior
重要注意事项
- Sequential execution. All operations for an account run one at a time. Multiple requests queue up.
- Not instant. A real browser navigates LinkedIn – expect 30 seconds to several minutes per operation.
- Timestamps in UTC. All dates and times are in UTC.
- Single quotes for text arguments. Use single quotes around message text, post text, and comments to avoid shell interpretation issues with special characters.
- Action limits. Per-account limits are configurable on the platform. A error means the limit was reached.
limitExceeded - URL normalization. All LinkedIn URLs in responses are normalized to format without trailing slashes.
https://www.linkedin.com/... - Null fields. Fields that are unavailable are returned as or
null, not omitted.[]
- 顺序执行:同一账号的所有操作会按顺序执行,多个请求会进入队列等待。
- 非即时执行:通过真实浏览器访问LinkedIn——每个操作预计需要30秒到数分钟不等。
- 时间戳为UTC时区:所有日期和时间均使用UTC时区。
- 文本参数使用单引号:消息、帖子、评论等文本参数请使用单引号包裹,避免特殊字符被Shell解析。
- 操作限制:每个账号的操作限制可在平台配置。若返回错误,表示已达到限制。
limitExceeded - URL标准化:响应中所有LinkedIn URL都会被标准化为格式,且无末尾斜杠。
https://www.linkedin.com/... - 空字段处理:无法获取的字段会返回或
null,不会被省略。[]