@usesocial/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,185 @@
1
+ # @usesocial/cli
2
+
3
+ **Give your agent access to social networks.** One install, one login, and your
4
+ agent can read, search, and graph LinkedIn and X — and post through your own
5
+ account when you let it — from any shell, any runtime.
6
+
7
+ `social` is built for people who live in a terminal with an agent open and are on
8
+ the hook for their own distribution. The work you keep meaning to do — see who
9
+ engaged, find the people worth reaching out to, learn from those who post better,
10
+ keep the funnel warm — becomes something you can hand to the agent you already
11
+ trust with your code.
12
+
13
+ Published as `@usesocial/cli` on npm; the binary is `social`.
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ brew install usesocial/tap/social
19
+ # or
20
+ bun install -g @usesocial/cli@latest
21
+ # or
22
+ npm install -g @usesocial/cli
23
+ ```
24
+
25
+ ## Quickstart
26
+
27
+ ```sh
28
+ social login # device sign-in, choose scope, set up billing
29
+ social linkedin connect # connect a LinkedIn account
30
+ social linkedin users me --pretty
31
+ social x connect # connect an X account
32
+ social x users me --pretty
33
+ ```
34
+
35
+ ## What you can hand your agent
36
+
37
+ Ask in plain language; the agent runs the calls and you stay the decision-maker.
38
+ A few of the things the command surface supports:
39
+
40
+ | You ask | The agent reaches for |
41
+ |---|---|
42
+ | "Surface the ten connections worth reaching out to this week." | `linkedin users connections`, `x users tweets` |
43
+ | "Pull everyone who reacted to my last LinkedIn post and flag the warm leads." | `linkedin posts reactions`, `linkedin users get` |
44
+ | "Read this creator's recent posts and break down what makes them land." | `linkedin users posts`, `x users tweets` |
45
+ | "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts`, `x search recent` |
46
+ | "Draft a reply to this thread and post it once I approve." | `linkedin posts comment`, `x tweets post` |
47
+
48
+ ## Commands
49
+
50
+ Every command supports `--json` and `--pretty` for machine- vs. human-readable
51
+ output. Most accept filters like `--limit`, `--cursor`, `--from`, and `--to`. Pass
52
+ `--help` on any subcommand for the full flag list, or run `social schema` for a
53
+ structured dump of every command — handy as an agent manifest.
54
+
55
+ Commands marked **✎ write** mutate your account and require an explicit write
56
+ scope (see [Account safety](#account-safety)).
57
+
58
+ ### Top level
59
+
60
+ | Command | Description |
61
+ |---|---|
62
+ | `social login` | Device sign-in, scope selection, billing, optional agent-skill install. |
63
+ | `social logout` | Revoke the session and clear the saved token. |
64
+ | `social schema` | Print the full command tree as JSON — a manifest for agents. |
65
+ | `social usage` | Recent calls or an aggregate billing/usage summary. |
66
+ | `social linkedin <…>` | LinkedIn operations (below). |
67
+ | `social x <…>` | X operations (below). |
68
+
69
+ ### `social linkedin`
70
+
71
+ | Command | Description | |
72
+ |---|---|---|
73
+ | `companies get` | Fetch a company profile. | |
74
+ | `companies employees` | List employees at a company. | |
75
+ | `companies jobs` | List a company's job postings. | |
76
+ | `posts get` | Fetch a post. | |
77
+ | `posts comments` | List a post's comments. | |
78
+ | `posts reactions` | List a post's reactions. | |
79
+ | `posts post` | Create a post. | ✎ write |
80
+ | `posts comment` | Comment on a post. | ✎ write |
81
+ | `posts react` | React to a post or comment. | ✎ write |
82
+ | `search people` | Search for people. | |
83
+ | `search posts` | Search for posts. | |
84
+ | `users get` | Fetch a profile. | |
85
+ | `users connections` | List a user's connections. | |
86
+ | `users posts` | List a user's or company's posts. | |
87
+ | `users me` | Show the connected LinkedIn profile. | |
88
+ | `users invite` | Send a connection invite. | ✎ write |
89
+ | `connect` · `reconnect` · `disconnect` · `list` | Account lifecycle and listing. | |
90
+
91
+ ### `social x`
92
+
93
+ | Command | Description | |
94
+ |---|---|---|
95
+ | `search recent` | Search posts from the last 7 days. | |
96
+ | `timelines home` | Read the home timeline. | |
97
+ | `tweets list` | Fetch up to 100 posts by ID. | |
98
+ | `tweets get` | Fetch a single post by ID. | |
99
+ | `tweets post` | Create a post. | ✎ write |
100
+ | `tweets like` · `unlike` | Like or unlike a post. | ✎ write |
101
+ | `tweets repost` · `unrepost` | Repost or undo a repost. | ✎ write |
102
+ | `tweets delete` | Delete a post. | ✎ write |
103
+ | `users tweets` | List a user's recent posts. | |
104
+ | `users me` | Show the authenticated X profile. | |
105
+ | `users follow` · `unfollow` | Follow or unfollow a user. | ✎ write |
106
+ | `bookmarks list` | List your saved bookmarks. | |
107
+ | `bookmarks add` · `remove` | Add or remove a bookmark. | ✎ write |
108
+ | `connect` · `reconnect` · `disconnect` · `list` | Account lifecycle and listing. | |
109
+
110
+ ## Built for agents
111
+
112
+ - **Everything speaks JSON.** Pass `--json` and pipe through `jq`, `fzf`, or your
113
+ agent's planner — anything that reads stdin. Structured errors and predictable
114
+ exit codes mean an agent can branch on what happened.
115
+ - **The same flags across networks.** `--limit`, `--cursor`, `--json`,
116
+ `--pretty`. Learn the surface once; reuse it on LinkedIn and X.
117
+ - **A skill you drop straight in.** Install the public skill repo with
118
+ `npx skills add usesocial/skill`; Claude, Codex, or any other supported agent
119
+ then knows the commands. `social login` can install it for you.
120
+
121
+ ```sh
122
+ # Find hiring posts, fan out to reaction graphs, rank warm contacts — one pipe.
123
+ social linkedin search posts "AI infra hiring" --limit 10 --json \
124
+ | jq -r '.posts[].urn' \
125
+ | xargs -I{} social linkedin posts reactions {} --json \
126
+ | jq -s '[.[].reactions[] | {actor, type}]
127
+ | group_by(.actor.id)
128
+ | map({actor: .[0].actor, signals: length})
129
+ | sort_by(-.signals) | .[0:15]'
130
+ ```
131
+
132
+ ## Auth
133
+
134
+ `social login` runs a device-authorization flow:
135
+
136
+ 1. Shows you a verification code and opens the approval page in your browser
137
+ (or prints the URL if there's no TTY, or you pass `--no-open`).
138
+ 2. Waits until you approve the session in the browser.
139
+ 3. Stores the returned token in your OS keyring, falling back to
140
+ `~/.social/credentials.json` (mode `0600`) when no keyring is available.
141
+
142
+ `social logout` revokes the session and removes the stored token from both places.
143
+
144
+ For non-interactive use (CI, agents), pass the details up front:
145
+
146
+ ```sh
147
+ social login --email you@example.com --scope read,write --accept-pricing --json
148
+ ```
149
+
150
+ ## Account safety
151
+
152
+ Built so your accounts outlive your prototype.
153
+
154
+ - **Read scope by default.** Writes need an explicit upgrade you can revoke. A
155
+ read-only session can't post, react, or invite.
156
+ - **A write never fires twice.** Rate-limit and server errors surface verbatim and
157
+ writes are never retried — so a post or invite can't double-send.
158
+ - **A residential IP per account.** Each connected account runs over a dedicated
159
+ residential proxy with smart rate-limiting, so the network sees a normal session.
160
+
161
+ ## Examples
162
+
163
+ ```sh
164
+ # LinkedIn
165
+ social linkedin search people "founder ai" --limit 10 --pretty
166
+ social linkedin users me --json
167
+
168
+ # X
169
+ social x search recent "from:elonmusk" --pretty
170
+ social x bookmarks list --limit 50 --json
171
+
172
+ # Usage / billing
173
+ social usage --summary --platform linkedin --pretty
174
+ social usage --limit 20 --from 2026-05-01T00:00:00Z
175
+
176
+ # Agent manifest
177
+ social schema --pretty
178
+ ```
179
+
180
+ ## Links
181
+
182
+ - Pricing and limits: <https://socialcli.dev/pricing>
183
+ - Terms: <https://socialcli.dev/terms> · Privacy: <https://socialcli.dev/privacy>
184
+
185
+ Built by founders with the same distribution problem.
package/bin/social.mjs ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
+
5
+ const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
6
+ const entryURL = pathToFileURL(join(packageRoot, "dist", "index.mjs")).href;
7
+
8
+ import(entryURL).catch((error) => {
9
+ console.error(error);
10
+ process.exit(1);
11
+ });
@@ -0,0 +1 @@
1
+ export { };