productivity
LinkedIn CLI for AI Agents
Use the LinkedIn CLI from KosmoKrator to call LinkedIn tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.LinkedIn CLI Setup
LinkedIn can be configured headlessly with `kosmokrator integrations:configure linkedin`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure linkedin --set access_token="$LINKEDIN_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor linkedin --json
kosmokrator integrations:status --json Credentials
Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | LINKEDIN_ACCESS_TOKEN | Secret secret | yes | Access Token |
base_url | LINKEDIN_BASE_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call linkedin.linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json kosmo integrations:linkedin linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs linkedin --json
kosmo integrations:docs linkedin.linkedin_list_posts --json
kosmo integrations:schema linkedin.linkedin_list_posts --json
kosmo integrations:search "LinkedIn" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
linkedin.linkedin_list_posts
List LinkedIn UGC posts for an author. Returns post IDs, lifecycle state, and creation timestamps. Use author, count, and start for filtering and pagination.
read - Parameters
- author, count, start
kosmo integrations:call linkedin.linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json kosmo integrations:linkedin linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json linkedin.linkedin_get_post
Retrieve a LinkedIn UGC post by its ID. Returns the full post including content, lifecycle state, and visibility.
read - Parameters
- post_id
kosmo integrations:call linkedin.linkedin_get_post '{"post_id":"example_post_id"}' --json kosmo integrations:linkedin linkedin_get_post '{"post_id":"example_post_id"}' --json linkedin.linkedin_create_post
Create a new LinkedIn UGC post. Requires an author URN and text content. Returns the created post with its ID and lifecycle state.
write - Parameters
- author, text, visibility
kosmo integrations:call linkedin.linkedin_create_post '{"author":"example_author","text":"example_text","visibility":"example_visibility"}' --json kosmo integrations:linkedin linkedin_create_post '{"author":"example_author","text":"example_text","visibility":"example_visibility"}' --json linkedin.linkedin_list_organizations
List LinkedIn organizations (company pages) the authenticated user has access to. Returns organization IDs, names, and roles.
read - Parameters
- count, start
kosmo integrations:call linkedin.linkedin_list_organizations '{"count":1,"start":1}' --json kosmo integrations:linkedin linkedin_list_organizations '{"count":1,"start":1}' --json linkedin.linkedin_get_organization
Retrieve a LinkedIn organization (company page) by its ID. Returns the organization's name, description, website, and other profile data.
read - Parameters
- organization_id
kosmo integrations:call linkedin.linkedin_get_organization '{"organization_id":"example_organization_id"}' --json kosmo integrations:linkedin linkedin_get_organization '{"organization_id":"example_organization_id"}' --json linkedin.linkedin_list_ad_accounts
List LinkedIn ad accounts the authenticated user has access to. Returns ad account IDs, names, statuses, and currency information.
read - Parameters
- count, start
kosmo integrations:call linkedin.linkedin_list_ad_accounts '{"count":1,"start":1}' --json kosmo integrations:linkedin linkedin_list_ad_accounts '{"count":1,"start":1}' --json linkedin.linkedin_get_current_user
Retrieve the currently authenticated LinkedIn user profile. Returns the user's ID, localized name, and profile metadata. Useful for identifying which account or token is in use.
read - Parameters
- none
kosmo integrations:call linkedin.linkedin_get_current_user '{}' --json kosmo integrations:linkedin linkedin_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
linkedin.linkedin_list_posts 3 parameters
kosmo integrations:schema linkedin.linkedin_list_posts --json | Parameter | Type | Required | Description |
|---|---|---|---|
author | string | yes | Author URN (e.g. "urn:li:person:ABC123" or "urn:li:organization:12345"). |
count | integer | no | Maximum number of posts to return (default 10, max 100). |
start | integer | no | Pagination offset (0-based). |
linkedin.linkedin_get_post 1 parameters
kosmo integrations:schema linkedin.linkedin_get_post --json | Parameter | Type | Required | Description |
|---|---|---|---|
post_id | string | yes | LinkedIn UGC post URN or ID (e.g. "urn:li:ugcPost:123456789"). |
linkedin.linkedin_create_post 3 parameters
kosmo integrations:schema linkedin.linkedin_create_post --json | Parameter | Type | Required | Description |
|---|---|---|---|
author | string | yes | Author URN (e.g. "urn:li:person:ABC123" or "urn:li:organization:12345"). |
text | string | yes | Text content for the post. |
visibility | string | no | Visibility: "PUBLIC" (default) or "CONNECTIONS". |
linkedin.linkedin_list_organizations 2 parameters
kosmo integrations:schema linkedin.linkedin_list_organizations --json | Parameter | Type | Required | Description |
|---|---|---|---|
count | integer | no | Maximum number of organizations to return (default 10). |
start | integer | no | Pagination offset (0-based). |
linkedin.linkedin_get_organization 1 parameters
kosmo integrations:schema linkedin.linkedin_get_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
organization_id | string | yes | LinkedIn organization ID or URN (e.g. "12345" or "urn:li:organization:12345"). |
linkedin.linkedin_list_ad_accounts 2 parameters
kosmo integrations:schema linkedin.linkedin_list_ad_accounts --json | Parameter | Type | Required | Description |
|---|---|---|---|
count | integer | no | Maximum number of ad accounts to return (default 10). |
start | integer | no | Pagination offset (0-based). |
linkedin.linkedin_get_current_user 0 parameters
kosmo integrations:schema linkedin.linkedin_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.