LINKEDIN CLI

Run LinkedIn from your terminal

86 commands for your own LinkedIn account, as one npm install. No server to host and no protocol to speak — it runs in a terminal, a cron job, a CI pipeline or an AI agent sandbox. Included in the API plan, alongside the REST API and the MCP server.

86 commands, one npm install
Runs anywhere a shell runs
Discovery works offline
Same names as the MCP tools

Five lines to your first result

Node 20 or newer. No runtime dependencies, no server to host, no protocol to speak.

your terminal
$ npm install -g @connectsafely/cli$ export CONNECTSAFELY_API_KEY=your_key_here$ connectsafely list-linkedin-accounts$ connectsafely get-connections --limit 5$ connectsafely skill install

The binary is connectsafely, with csly as a short alias. Get your key on the API key page, or read the package on npm (@connectsafely/cli).

Roughly 8× cheaper per agent session

An MCP client loads every tool definition into the model’s context before it reads your request — all of them, every session, whether or not that session touches LinkedIn at all. The CLI defers it. Measured against the CLI’s own schema output for the full command set:

What you loadSizeRoughly
Every tool definition, loaded upfront (MCP)184 KB~47,000 tokens
The `commands` catalogue — one line each13.4 KB~3,400 tokens
One command's full schema, on demand10.7 KB~2,700 tokens

An agent that browses the catalogue and then reads one schema spends about 6,200 tokens. Loading everything upfront spends 47,000 before the user’s first sentence is processed. On the way back, --fields and --max-items prune the response before any of it enters context.

It teaches your agent how to use it

One command writes 8 skills into .claude/skills/. Claude Code, Cursor and anything else following that convention pick them up automatically. A small always-loaded router carries the live command catalogue and points at exactly one specialist per job.

your terminal
$ connectsafely skill install
connectsafely

The contract every other skill assumes, plus the live catalogue

connectsafely-prospecting

People, company, job, group and school search; building a lead file

connectsafely-outreach

Connection requests, follows, first-touch messages, invitations

connectsafely-inbox

Conversations, threads, replies, stars, attachments, InMail credits

connectsafely-content

Publishing, media upload, reactions, comments, replies, the feed

connectsafely-analytics

SSI, followers, visitors, network summary, own activity

connectsafely-account

Keys, account selection, quota, auth troubleshooting

connectsafely-sales-navigator

Sales Navigator threads and messaging

Built for unattended runs

Rehearse any write

--dry-run shows exactly what a command would send without sending it. There is no equivalent on a tool server.

Pacing is built in, not prompted

Batches leave a randomised 30–90 second gap between writes. Evenly timed bursts are the signal that gets accounts flagged, so the gap is jittered rather than fixed.

Failures you can branch on

Every command returns a real exit code plus a JSON error envelope — so a cron job or CI pipeline can react to a failure instead of parsing prose.

Server-side limits still apply

The same rate limits and daily caps as the rest of ConnectSafely, enforced on our side. A script cannot talk its way past them.

Or skip the commands entirely

55 jobs written as a sentence you say to your assistant — job-change sweeps, post-engagement capture, pre-call briefs, CRM enrichment. Your agent picks the commands; you never type one.

Browse all 55 use cases

One plan, three surfaces

The CLI, the MCP server and the REST API are generated from the same OpenAPI specification and hit the same account, so an endpoint cannot exist in one and be missing from another. They are all in the same plan, from $10/month per LinkedIn account. Pick whichever fits where the work runs — or use all three.

LinkedIn CLI — frequently asked questions

Install, cost, safety, and how the CLI compares to the MCP server.

Yes. The ConnectSafely CLI is a command-line interface for your own LinkedIn account: npm install -g @connectsafely/cli. It ships 86 commands as a single binary with no runtime dependencies, and the binary is connectsafely with csly as a short alias. It runs anywhere a shell runs — a terminal, a cron job, a CI pipeline, a Docker container or an AI agent sandbox. It is included in the API plan from $10/month per LinkedIn account, at no extra cost.
Use the MCP server when a person is chatting in Claude Desktop, ChatGPT or Cursor and wants LinkedIn available in that conversation — pasting a URL into a settings panel beats asking someone to install a binary. Use the CLI everywhere else: cron jobs, CI pipelines, containers, scripts, agent sandboxes and any coding agent that already has a shell. Both hit the same API on the same account, and every CLI command has the same name as the matching MCP tool, so a prompt written for one works with the other unchanged. Plenty of teams run both, and both are in the same plan.
Install the CLI, then run connectsafely skill install. That writes eight agent skills into .claude/skills/, which Claude Code, Cursor and any runtime following that convention load automatically. A small always-loaded router skill carries the live command catalogue and points at exactly one specialist skill per job — prospecting, outreach, inbox, content, analytics, account or Sales Navigator. You then ask in plain English and the agent runs the commands.
An MCP client loads every tool definition into the model’s context before it reads your request. For these 86 commands that is about 47,000 tokens, every session, most of it describing commands the session will never touch. The CLI defers it: connectsafely commands lists names and one-line summaries for about 3,400 tokens, and connectsafely schema <command> fetches the full parameter list for the one command actually chosen, about 2,700 tokens. Browse plus one schema is roughly 6,200 tokens against 47,000 — about eight times less. On the way back, --fields and --max-items prune the response before it ever enters context.
You need one to touch LinkedIn, and you can generate it from your dashboard. Set it as CONNECTSAFELY_API_KEY, which is what works unchanged in CI, in a container and inside an agent sandbox where an interactive login cannot happen. Discovery does not need a key at all: commands, schema, --help and skill read the API specification bundled inside the binary, so they work offline and before any key exists.
It runs on your own account through the same rate limits and daily caps as the rest of ConnectSafely, enforced server-side, so a script cannot exceed them. Batch operations pace themselves with a randomised 30–90 second gap rather than firing back to back, because evenly timed bursts are what gets accounts flagged. Any write can be rehearsed first with --dry-run, and every command returns a real exit code plus a JSON error envelope, so a failure in a cron job or CI pipeline is something you can branch on instead of text you have to interpret.
The 86 commands cover ten groups: account and quota, search and sourcing, profiles and companies, relationship actions, inbox and messaging, posts and engagement, analytics, groups, events and Sales Navigator. In practice that is finding prospects, sending connection requests and follow-ups, working an inbox, publishing and commenting, pulling profile and company data, and reporting on your own activity. There are 55 worked use cases if you would rather see the jobs than the commands.

npm install, and you are done

86 commands against your own LinkedIn account. Seven days free, then $10/month per account — API, MCP and CLI included.