KosmoKrator

marketing

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.

7 functions 6 read 1 write Manual OAuth token auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token LINKEDIN_ACCESS_TOKEN Secret secret yes Access Token
base_url LINKEDIN_BASE_URL URL url no API Base URL

Call LinkedIn Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call linkedin.linkedin_list_posts '{
  "author": "example_author",
  "count": 1,
  "start": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:linkedin linkedin_list_posts '{
  "author": "example_author",
  "count": 1,
  "start": 1
}' --json

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to LinkedIn.

linkedin.linkedin_list_posts

Read read

List LinkedIn UGC posts for an author. Returns post IDs, lifecycle state, and creation timestamps. Use author, count, and start for filtering and pagination.

Parameters
author, count, start

Generic CLI call

kosmo integrations:call linkedin.linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_list_posts '{"author":"example_author","count":1,"start":1}' --json

linkedin.linkedin_get_post

Read read

Retrieve a LinkedIn UGC post by its ID. Returns the full post including content, lifecycle state, and visibility.

Parameters
post_id

Generic CLI call

kosmo integrations:call linkedin.linkedin_get_post '{"post_id":"example_post_id"}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_get_post '{"post_id":"example_post_id"}' --json

linkedin.linkedin_create_post

Write write

Create a new LinkedIn UGC post. Requires an author URN and text content. Returns the created post with its ID and lifecycle state.

Parameters
author, text, visibility

Generic CLI call

kosmo integrations:call linkedin.linkedin_create_post '{"author":"example_author","text":"example_text","visibility":"example_visibility"}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_create_post '{"author":"example_author","text":"example_text","visibility":"example_visibility"}' --json

linkedin.linkedin_list_organizations

Read read

List LinkedIn organizations (company pages) the authenticated user has access to. Returns organization IDs, names, and roles.

Parameters
count, start

Generic CLI call

kosmo integrations:call linkedin.linkedin_list_organizations '{"count":1,"start":1}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_list_organizations '{"count":1,"start":1}' --json

linkedin.linkedin_get_organization

Read read

Retrieve a LinkedIn organization (company page) by its ID. Returns the organization's name, description, website, and other profile data.

Parameters
organization_id

Generic CLI call

kosmo integrations:call linkedin.linkedin_get_organization '{"organization_id":"example_organization_id"}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_get_organization '{"organization_id":"example_organization_id"}' --json

linkedin.linkedin_list_ad_accounts

Read read

List LinkedIn ad accounts the authenticated user has access to. Returns ad account IDs, names, statuses, and currency information.

Parameters
count, start

Generic CLI call

kosmo integrations:call linkedin.linkedin_list_ad_accounts '{"count":1,"start":1}' --json

Provider shortcut

kosmo integrations:linkedin linkedin_list_ad_accounts '{"count":1,"start":1}' --json

linkedin.linkedin_get_current_user

Read read

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.

Parameters
none

Generic CLI call

kosmo integrations:call linkedin.linkedin_get_current_user '{}' --json

Provider shortcut

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

List LinkedIn UGC posts for an author. Returns post IDs, lifecycle state, and creation timestamps. Use author, count, and start for filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_list_posts --json
ParameterTypeRequiredDescription
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

Retrieve a LinkedIn UGC post by its ID. Returns the full post including content, lifecycle state, and visibility.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_get_post --json
ParameterTypeRequiredDescription
post_id string yes LinkedIn UGC post URN or ID (e.g. "urn:li:ugcPost:123456789").

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.

Operation
Write write
Schema command
kosmo integrations:schema linkedin.linkedin_create_post --json
ParameterTypeRequiredDescription
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

List LinkedIn organizations (company pages) the authenticated user has access to. Returns organization IDs, names, and roles.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_list_organizations --json
ParameterTypeRequiredDescription
count integer no Maximum number of organizations to return (default 10).
start integer no Pagination offset (0-based).

linkedin.linkedin_get_organization

Retrieve a LinkedIn organization (company page) by its ID. Returns the organization's name, description, website, and other profile data.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_get_organization --json
ParameterTypeRequiredDescription
organization_id string yes LinkedIn organization ID or URN (e.g. "12345" or "urn:li:organization:12345").

linkedin.linkedin_list_ad_accounts

List LinkedIn ad accounts the authenticated user has access to. Returns ad account IDs, names, statuses, and currency information.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_list_ad_accounts --json
ParameterTypeRequiredDescription
count integer no Maximum number of ad accounts to return (default 10).
start integer no Pagination offset (0-based).

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.

Operation
Read read
Schema command
kosmo integrations:schema linkedin.linkedin_get_current_user --json
ParameterTypeRequiredDescription
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.