{"_id":"@connectsafely/cli","_rev":"3-a6df80b8e1b72a3bf37e0e9ac4348b4f","name":"@connectsafely/cli","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@connectsafely/cli","version":"1.0.0","keywords":["linkedin","cli","ai-agent","agent-skills","automation","connectsafely","claude-code","mcp"],"license":"MIT","_id":"@connectsafely/cli@1.0.0","maintainers":[{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},{"name":"connectsafelyai","email":"karan@connectsafely.ai"}],"homepage":"https://docs.connectsafely.ai/cli","bugs":{"url":"https://github.com/ConnectSafelyAI/connectsafely/issues"},"bin":{"csly":"dist/index.js","connectsafely":"dist/index.js"},"dist":{"shasum":"63b1b3247b876562454968fed26781dd7c9490ed","tarball":"https://registry.npmjs.org/@connectsafely/cli/-/cli-1.0.0.tgz","fileCount":10,"integrity":"sha512-N7HzOs5HVjMiXpGoJoUrr9z+k0nsuRzW+Xq8Bfmnio+WKeWbUs7+Kr+2rmF63WvJ57hSO4XYQtW//IZqJLKtRw==","signatures":[{"sig":"MEUCIHhUYIZR1K4yJg0ndBdqo/sBYRJeQdwlfxFlKbd/7M/gAiEA1RLNzNhxZWdKp6dPxFLndF1rjRDxNdKjVkiEjWxqwl8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":577223},"type":"module","engines":{"node":">=20"},"gitHead":"e6f29fea2c96dba8ab7b95388f006be5e3b3becd","scripts":{"dev":"bun run src/index.ts","test":"bun test","prepack":"bun run build:bundle","typecheck":"tsc --noEmit","build:bundle":"bun build src/index.ts --target=node --outfile dist/index.js"},"_npmUser":{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},"repository":{"url":"git+https://github.com/ConnectSafelyAI/connectsafely.git","type":"git","directory":"apps/cli"},"_npmVersion":"10.8.2","description":"ConnectSafely CLI — run your own LinkedIn account from a terminal or an AI agent, without an MCP server.","directories":{},"_nodeVersion":"20.19.4","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"5.7.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/cli_1.0.0_1788062625263_0.3002190462453651","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@connectsafely/cli","version":"1.0.1","keywords":["linkedin","cli","ai-agent","agent-skills","automation","connectsafely","claude-code","mcp"],"license":"UNLICENSED","_id":"@connectsafely/cli@1.0.1","maintainers":[{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},{"name":"connectsafelyai","email":"karan@connectsafely.ai"}],"homepage":"https://docs.connectsafely.ai/cli","bugs":{"url":"https://github.com/ConnectSafelyAI/connectsafely/issues"},"bin":{"csly":"dist/index.js","connectsafely":"dist/index.js"},"dist":{"shasum":"16fade2898a6e1910c2c54e974d72f6c01b9705e","tarball":"https://registry.npmjs.org/@connectsafely/cli/-/cli-1.0.1.tgz","fileCount":11,"integrity":"sha512-aIXZ0tCBIcMMFpm0eGdD1jQNvnpPGKb+A1oKScUTFsPRbzlolKQcqDUV/PbE5cBXXxazceJuGHhXB1YwVO7uew==","signatures":[{"sig":"MEYCIQCZCrk/6DfW0DMeI09N5jb03MPJjrqz94FiFv4oTfKdZAIhAPtOntcZuAlEH1RMdCyYo81vDdmO6ys1oH9KWvgm/tFF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":583994},"type":"module","engines":{"node":">=20"},"gitHead":"b5923dc1be71d7eb5ea099efb7558ddfd6ee70d5","scripts":{"dev":"bun run src/index.ts","test":"bun test","prepack":"bun run build:bundle","typecheck":"tsc --noEmit","build:bundle":"bun build src/index.ts --target=node --outfile dist/index.js"},"_npmUser":{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},"repository":{"url":"git+https://github.com/ConnectSafelyAI/connectsafely.git","type":"git","directory":"apps/cli"},"_npmVersion":"10.8.2","description":"ConnectSafely CLI — run your own LinkedIn account from a terminal or an AI agent, without an MCP server.","directories":{},"_nodeVersion":"20.19.4","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"5.7.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/cli_1.0.1_1788063438116_0.03904944045186465","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@connectsafely/cli","version":"1.0.3","description":"ConnectSafely CLI — run your own LinkedIn account from a terminal or an AI agent, without an MCP server.","type":"module","license":"UNLICENSED","bin":{"connectsafely":"dist/index.js","csly":"dist/index.js"},"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/ConnectSafelyAI/connectsafely.git","directory":"apps/cli"},"homepage":"https://connectsafely.ai/docs/cli","bugs":{"url":"https://github.com/ConnectSafelyAI/connectsafely/issues"},"publishConfig":{"access":"public"},"scripts":{"dev":"bun run src/index.ts","build:bundle":"bun build src/index.ts --target=node --outfile dist/index.js","test":"bun test","typecheck":"tsc --noEmit","prepack":"bun run build:bundle"},"devDependencies":{"@types/bun":"^1.2.22","@types/node":"^22.15.3","typescript":"5.7.3"},"keywords":["linkedin","cli","ai-agent","agent-skills","automation","connectsafely","claude-code","mcp"],"_id":"@connectsafely/cli@1.0.3","gitHead":"7420c884b69ebaf77312f2d5f5433ce3efafeba7","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-rktYCiq2oKerlEYHLIs6YZY3DrVivyeXSS+aYCZ30Vto2oQ6MRt9ptn1NdFaiYDAcHZbKnVnoXzjy+lVU+qZNQ==","shasum":"fd2fdaf057de23e3f6e34331c28af1edb4d5ad75","tarball":"https://registry.npmjs.org/@connectsafely/cli/-/cli-1.0.3.tgz","fileCount":11,"unpackedSize":602564,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEqg0+ajvEdV/kWPTifeQV83bEX1By1JD8hVjg2kYpPeAiEA7whG/EvhNGnzqoHexOEtr6q+TdQKtDxLRX30XbPHjak="}]},"_npmUser":{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},"directories":{},"maintainers":[{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},{"name":"connectsafelyai","email":"karan@connectsafely.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_1.0.3_1789370823545_0.5799166063925816"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-30T04:03:45.098Z","modified":"2026-09-14T07:27:03.856Z","1.0.0":"2026-08-30T04:03:45.413Z","1.0.1":"2026-08-30T04:17:18.271Z","1.0.3":"2026-09-14T07:27:03.675Z"},"bugs":{"url":"https://github.com/ConnectSafelyAI/connectsafely/issues"},"license":"UNLICENSED","homepage":"https://connectsafely.ai/docs/cli","keywords":["linkedin","cli","ai-agent","agent-skills","automation","connectsafely","claude-code","mcp"],"repository":{"type":"git","url":"git+https://github.com/ConnectSafelyAI/connectsafely.git","directory":"apps/cli"},"description":"ConnectSafely CLI — run your own LinkedIn account from a terminal or an AI agent, without an MCP server.","maintainers":[{"name":"support-connectsafelyai","email":"support@connectsafely.ai"},{"name":"connectsafelyai","email":"karan@connectsafely.ai"}],"readme":"# @connectsafely/cli\n\n**Run your own LinkedIn account from a terminal, a CI job or an AI agent.**\n87 commands, one binary, no server to host and no protocol to speak.\n\nEvery command is also the name of the matching ConnectSafely MCP tool, so a\nprompt or runbook written against the MCP server names the same actions here.\n\n```bash\nnpm install -g @connectsafely/cli\n```\n\nNode 20 or newer. The binary is `connectsafely`, with `csly` as a short alias.\nNo runtime dependencies, and the API specification is bundled inside it — so\n`commands`, `schema`, `--help` and `skill` all work offline, before any key\nexists.\n\n## Quick start\n\n```bash\n# 1. Authenticate — get a key at https://connectsafely.ai/api-key\nexport CONNECTSAFELY_API_KEY=your_key_here\n\n# 2. Pick the LinkedIn account to act as\ncsly list-linkedin-accounts\nexport CONNECTSAFELY_ACCOUNT_ID=your_account_id\n\n# 3. Read something\ncsly get-connections --limit 5\n\n# 4. Teach your AI agent to use it\ncsly skill install\n```\n\n## Finding your way around\n\nYou are not expected to memorise 87 commands, and neither is a language model.\nThree steps, cheapest first:\n\n```bash\ncsly commands                      # the catalogue, one line each\ncsly commands --search invitation  # filter it\ncsly commands --kind write         # only the ones that change something\ncsly schema send-connection-request  # exact parameters for the one you picked\n```\n\nThis is the point of a CLI over a tool server. An MCP server pushes every tool\ndefinition into the model's context before it has read your request; here the\nmodel sees names and one-line summaries first, and pays for a full parameter\nlist only for the command it actually chose.\n\n## For AI agents\n\n```bash\ncsly skill install    # writes 8 skills into .claude/skills\n```\n\nClaude Code, Cursor and friends load these automatically. The router skill\ncarries the live command catalogue generated from the installed binary, so it\ncannot drift from the version on disk.\n\nThree guarantees an agent can rely on:\n\n- **Data on stdout, everything else on stderr.** Pipe stdout straight into a\n  parser; progress and retry chatter never contaminate it.\n- **Errors are JSON on stderr in every output mode**, including `pretty`, with a\n  machine-stable `code` and a `remediation` written as an instruction. Match on\n  the code, never on the prose.\n- **Exit codes are a public contract.** Branch on the code before spending a\n  token reading stdout.\n\n| Code | Name | Meaning |\n|---:|---|---|\n| 0 | ok | The command ran and the API accepted it |\n| 1 | error | Unclassified. Retrying blind is not advised |\n| 2 | auth | Key missing, invalid, expired, or not entitled |\n| 3 | validation | Rejected before any network call. Fix the arguments |\n| 4 | confirm_required | Destructive command without `--yes` on a non-TTY |\n| 5 | rate_limit | Daily cap or pacing limit. Retry later, not now |\n| 6 | network | DNS, TLS, timeout, reset. Safe to retry a read |\n| 7 | unknown_command | Run `commands` — do not guess |\n| 8 | conflict | Already sent, already delivered (409/412) |\n\n## Keeping context small\n\nThe biggest cost lever over a tool call: prune the response in this process,\nbefore a single token is spent reading it.\n\n```bash\ncsly search-people --keywords \"VP Marketing\" \\\n  --fields \"people.firstName,people.headline\" --max-items 5\n```\n\n`--fields` keeps only what you asked for; `--max-items` caps every array and\nadds a `truncated` marker so a capped list is never mistaken for a short one.\nEnvelope keys (`success`, `error`, `message`, `nextCursor`) always survive, so a\nfailure can never be masked by a field mask.\n\n## Safety\n\nThis drives a real LinkedIn account. The defaults reflect that.\n\n```bash\ncsly send-connection-request --profile-id ada-lovelace --dry-run\n```\n\n- **`--dry-run`** resolves everything — auth, ids, the body, the URL — and stops\n  before the network. The cheapest way to check a write does what you think, and\n  it costs nothing against the account's caps.\n- **Destructive commands refuse to run unattended.** No `--yes` on a non-TTY\n  means exit 4 and nothing sent. We refuse rather than prompt: a prompt in a\n  non-interactive shell either hangs forever or is answered by whatever byte\n  happens to be on stdin.\n- **Writes are paced in `batch`** — 30–90s apart by default. LinkedIn flags\n  accounts on rhythm as much as on volume, and an agent asked to send thirty\n  requests will otherwise fire them as fast as its loop allows.\n- **Retries are asymmetric.** A read retries a 500; a write does not, because it\n  may already have landed. Pass `--idempotency-key` to make a retried write safe.\n\n## Batch\n\n```bash\ncat requests.jsonl | csly batch -\n```\n\n```jsonl\n{\"command\":\"send-connection-request\",\"args\":{\"profileId\":\"ada-lovelace\"},\"ref\":\"row-1\"}\n{\"command\":\"send-connection-request\",\"args\":{\"profileId\":\"grace-hopper\"},\"ref\":\"row-2\"}\n```\n\nReads run back to back; writes are spaced. `--pace 45` or `--pace 30-90` to\ntune, `--no-pace` to disable, `--dry-run` to rehearse the whole file for free.\n\n## Configuration\n\nResolved flag first, then environment, then stored config.\n\n| | |\n|---|---|\n| `CONNECTSAFELY_API_KEY` | Your key. Prefer this in CI and agent sandboxes |\n| `CONNECTSAFELY_ACCOUNT_ID` | Default account, so you can omit `--account` |\n| `CONNECTSAFELY_API_URL` | Defaults to `https://api.connectsafely.ai` |\n| `CONNECTSAFELY_OUTPUT` | `json` \\| `pretty` \\| `ndjson` \\| `markdown` |\n| `CONNECTSAFELY_NO_UPDATE_CHECK` | Set to silence the \"update available\" notice |\n\n`csly auth status` reports which layer each value came from — most \"it used the\nwrong account\" reports are a stale config file quietly beating the environment\nvariable someone thought was in effect.\n\nTo store the key instead of exporting it:\n\n```bash\ncsly auth login --api-key your_key_here   # written to ~/.connectsafely/config.json, mode 0600\n```\n\nThe key is sent as `Authorization: Bearer` and is never printed in full, logged,\nor included in `--dry-run` output.\n\n## Long values\n\nShell quoting is the most common way a generated command line arrives malformed.\nTwo escapes:\n\n```bash\ncsly create-post --text @post.txt          # read from a file\necho '{\"keywords\":\"CTO\"}' | csly search-people --json -   # read from stdin\n```\n\n`--json` takes the whole payload at once, which is what an agent that already\nknows the API shape should use — no translation step between what it planned and\nwhat gets sent.\n\n## Documentation\n\nFull reference at **[connectsafely.ai/docs/cli](https://connectsafely.ai/docs/cli)**.\n\n## License\n\nProprietary. © ConnectSafely.AI — all rights reserved.\n\nThis client is published so ConnectSafely customers and their AI agents can\ninstall it; publication does not grant any right to copy, modify or\nredistribute it. Use requires a ConnectSafely account and is subject to the\n[Terms of Service](https://connectsafely.ai/terms).\n","readmeFilename":"README.md"}