@usesocial/cli 0.1.2 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @usesocial/cli
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`26ca563`](https://github.com/usesocial/monorepo/commit/26ca5635ef5947a08f79d1ffc71fa926571ab0e0) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Add hidden `social <x|linkedin> sync <collection>` and `social <x|linkedin> sql` commands for a per-account local SQLite mirror. `sync` page-walks one collection (cost-estimated, gated by `--billing-limit`, default $10; `--since` windows incremental collections), `sql` runs read-only SQL or prints the schema. The commands remain invokable directly, but stay out of provider help while the cache surface settles. Live reads are unchanged.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Price every proxy call from the scraped X price list (mirrored for LinkedIn) against a single `usage_credits` balance, fixing a 10–40× write overcharge that mapped non-DM writes to the most expensive category. `account usage` and `account logs` now report cost in credits, and repeated X reads served from cache no longer recharge.
12
+
13
+ - [`df52bf7`](https://github.com/usesocial/monorepo/commit/df52bf795e39c333d25b0618cedc047ad6f14b24) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Limit `--no-cache` to generated commands backed by cacheable proxy reads so non-cacheable DM, message, timeline, bookmark, and write commands no longer send misleading cache-control headers.
14
+
15
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Reshape the root command surface to `account · schema · x · linkedin` and fold the old `auth` and `accounts` groups into one `account` command: bare `social account` prints the auth state plus connected accounts, with `login`, `logout`, `connect`, `reconnect`, `disconnect`, `usage`, `logs`, and `config` (including `config cache mode|ttl`) as subcommands. `account usage` shows the billing overview and `account logs` lists recent proxy calls. Own-account commands now infer the X account ID instead of requiring it, and account selectors carry reconnect hints.
16
+
17
+ - [`1a6461e`](https://github.com/usesocial/monorepo/commit/1a6461e39dc02640948de49b26b13e3ba3c1bc4b) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Rewrite generated provider help and schema descriptions to show summary, capability, and runnable usage instead of internal HTTP routes.
18
+
19
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Unify identifier positionals across X and LinkedIn into one explicit `target` grammar: every command accepts an `@handle`, a profile/post/status URL, a typed `kind:id` reference (e.g. `chat_id:…`, `request_id:…`), or `me`. Pure-parse targets resolve for free; `@handle` lookups are cached and reported under `meta.resolved` with a `source`. Writes return openable URLs and audit-friendly IDs, and read envelopes carry richer default payloads.
20
+
21
+ - [`a93af9c`](https://github.com/usesocial/monorepo/commit/a93af9cdbde74f6552cba9e465425526d4f5ddcc) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Limit account connect and reconnect JSON output to the connected account details.
22
+
23
+ - [`26ca563`](https://github.com/usesocial/monorepo/commit/26ca5635ef5947a08f79d1ffc71fa926571ab0e0) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Hide the LinkedIn `search` group from `social linkedin --help` (still invokable).
24
+
25
+ - [`1893cc5`](https://github.com/usesocial/monorepo/commit/1893cc5d715ffde41b83f7f9822f7b3aca0a305a) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Send LinkedIn inbox mark-read and mark-unread writes with Unipile's current `read_status` body, and keep legacy installed CLIs working through a proxy-side body transform.
26
+
27
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Add edit and delete write verbs to the LinkedIn inbox — `linkedin message <chat> edit message_id:<id> <text>` and `linkedin message <chat> delete message_id:<id>` — alongside `linkedin messages <chat> mark <status>` for read-status. Delete requires confirmation and now correctly meters its `204 No Content` response as one billed write instead of advertising a cost it never charged.
28
+
29
+ - [`5278a68`](https://github.com/usesocial/monorepo/commit/5278a68e436523d2f910b1e9e065efc3f20fbfc3) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Cap `linkedin messages --limit` at 20 for inbox conversation lists so the CLI fails locally instead of sending provider-rejected LinkedIn inbox requests.
30
+
31
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Add the full LinkedIn relation-request lifecycle under a `requests` group: `requests send <target> [message]` (renamed from the old root `connect`), `requests sent`, `requests received`, `requests accept request_id:<id>`, and `requests cancel request_id:<id>`.
32
+
33
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Refresh the LinkedIn surface with richer profiles: `linkedin profile` defaults to `about,experience,education`, reads embed inline author cards, `linkedin connections` routes through the supported connections endpoint, and cache-control flags are honored on cacheable reads.
34
+
35
+ - [`2483598`](https://github.com/usesocial/monorepo/commit/2483598ba0e471a1a0bb7c8819dae158005d0b28) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Replace cacheable-read `--no-cache` with repeatable `--header`/`-H` request headers, including `Cache-Control` overrides for proxy cache freshness.
36
+
37
+ - [`83650e6`](https://github.com/usesocial/monorepo/commit/83650e6f77b94d5cd4a3a5ec673164ff103d6573) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Expand the X read surface with six new commands — `x likers`, `x quotes`, `x reposters`, `x liked`, `x mentions`, and `x profile` (fetch any profile by target, not just your own) — and unify direct messages into `x messages` (list or read a thread) plus a single `x message <target> <text>` send verb. Read payloads now inline data already paid for, including DM sender identity, via default field presets.
38
+
3
39
  ## 0.1.2
4
40
 
5
41
  ### Patch Changes
package/README.md CHANGED
@@ -23,18 +23,16 @@ Published as `@usesocial/cli` on npm; the binary is `social`.
23
23
 
24
24
  ```sh
25
25
  curl -fsSL https://usesocial.dev/install.sh | bash
26
- # or install only the CLI with Homebrew
27
- brew install usesocial/tap/cli
28
26
  ```
29
27
 
30
28
  ## Quickstart
31
29
 
32
30
  ```sh
33
- social auth login # device sign-in, choose scope, set up billing
34
- social accounts connect linkedin # connect a LinkedIn account
35
- social linkedin whoami
36
- social accounts connect x # connect an X account
37
- social x whoami
31
+ social account login # device sign-in, choose scope, set up billing
32
+ social account connect linkedin # connect a LinkedIn account
33
+ social linkedin profile
34
+ social account connect x # connect an X account
35
+ social x profile
38
36
  ```
39
37
 
40
38
  ## What you can hand your agent
@@ -44,121 +42,131 @@ A few of the things the command surface supports:
44
42
 
45
43
  | You ask | The agent reaches for |
46
44
  |---|---|
47
- | "Surface the ten connections worth reaching out to this week." | `linkedin users connections`, `x users tweets` |
48
- | "Pull everyone who reacted to my last LinkedIn post and flag the warm leads." | `linkedin posts reactions`, `linkedin users get` |
49
- | "Read this creator's recent posts and break down what makes them land." | `linkedin users posts`, `x users tweets` |
50
- | "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts`, `x search recent` |
51
- | "Draft a reply to this thread and post it once I approve." | `linkedin posts comment`, `x tweets post` |
45
+ | "Surface the ten connections worth reaching out to this week." | `linkedin connections`, `x tweets` |
46
+ | "Pull everyone who reacted to my last LinkedIn post and flag the warm leads." | `linkedin reactions`, `linkedin profile` |
47
+ | "Read this creator's recent posts and break down what makes them land." | `linkedin posts`, `x tweets` |
48
+ | "Find what people are saying about AI agents this week and summarize the themes." | `linkedin search posts`, `x timeline` |
49
+ | "Draft a reply to this thread and post it once I approve." | `linkedin comment`, `x post` |
52
50
 
53
51
  ## Commands
54
52
 
55
- The main command surfaces print compact JSON by default. Most accept filters like
56
- `--limit`, `--cursor`, `--from`, and `--to`. Pass `--help` on any subcommand for
57
- the full flag list, or run `social schema` for a structured dump of every command
58
- handy as an agent manifest.
53
+ The main command surfaces print compact JSON by default. List commands commonly
54
+ accept `--limit` and `--cursor`; time windows are command-specific. Pass `--help`
55
+ on any subcommand for the full flag list, or run `social schema "<command path>"`
56
+ for the machine-readable contract for a runnable command. Agents planning across
57
+ many calls can run `social schema --leaves` for a manifest of runnable commands
58
+ keyed by command path.
59
59
 
60
60
  Commands marked **✎ write** mutate your account and require an explicit write
61
61
  scope (see [Account safety](#account-safety)).
62
62
 
63
+ ### Targets
64
+
65
+ Commands with `[target]` or `<target>` accept `@handle` or `@public-identifier`,
66
+ a full X/LinkedIn URL, a LinkedIn URN, or a typed ID such as `profile_id:<id>`,
67
+ `post_id:<id>`, `list_id:<id>`, `chat_id:<id>`, `company_id:<id>`, or `request_id:<id>`. Bare IDs are not
68
+ accepted. When an optional target is omitted, the command acts on your own
69
+ connected account.
70
+
63
71
  ### Top level
64
72
 
65
73
  | Command | Description |
66
74
  |---|---|
67
- | `social config` | Read or configure local CLI settings. |
68
- | `social auth login` | Device sign-in, scope selection, and billing. |
69
- | `social auth logout` | Revoke the session and clear the saved token. |
70
- | `social accounts <…>` | Connect, reconnect, disconnect, and list accounts. |
71
- | `social schema` | Print the full command tree as JSON — a manifest for agents. |
72
- | `social usage` | Recent calls or an aggregate billing/usage summary. |
73
- | `social linkedin <…>` | LinkedIn operations (below). |
75
+ | `social account` | Show auth state and connected accounts; login, logout, connect accounts, inspect usage/logs, and configure local CLI settings. |
76
+ | `social schema` | Print the compact command tree, inspect one command with `social schema "<command path>"`, or emit agent command contracts with `social schema --leaves`. |
74
77
  | `social x <…>` | X operations (below). |
78
+ | `social linkedin <…>` | LinkedIn operations (below). |
75
79
 
76
- ### `social accounts`
80
+ ### `social account`
77
81
 
78
82
  | Command | Description | |
79
83
  |---|---|---|
80
- | `connect linkedin` | Connect a LinkedIn account through hosted auth. | ✎ write |
84
+ | `(bare)` | Show who is signed in and list connected accounts. | |
85
+ | `login` | Device sign-in, scope selection, and billing. | |
86
+ | `logout` | Revoke the session and clear the saved token. | |
87
+ | `connect linkedin` | Connect a LinkedIn account through the browser. | ✎ write |
81
88
  | `connect x` | Connect an X account through OAuth. | ✎ write |
82
89
  | `reconnect linkedin <account>` | Re-auth an existing LinkedIn account. | ✎ write |
83
90
  | `reconnect x <account>` | Re-auth an existing X account. | ✎ write |
84
91
  | `disconnect linkedin <account>` | Disconnect a LinkedIn account. | ✎ write |
85
92
  | `disconnect x <account>` | Disconnect an X account. | ✎ write |
86
- | `list [linkedin\|x\|all]` | List accounts. Defaults to all platforms. | |
93
+ | `usage` | Aggregate proxy usage and billing stats. | |
94
+ | `logs` | Recent proxy calls. | |
95
+ | `config cache mode` | Read or set the cache mode preset. | |
96
+ | `config cache ttl` | Set a custom cache TTL in seconds. | |
87
97
 
88
- `accounts list` returns `{ accounts: [...] }` as compact JSON.
98
+ `social account` returns compact JSON with the signed-in user and connected accounts.
89
99
 
90
100
  ### `social linkedin`
91
101
 
92
102
  | Command | Description | |
93
103
  |---|---|---|
94
- | `companies get` | Fetch a company profile. | |
95
- | `companies employees` | List employees at a company. | |
96
- | `companies jobs` | List a company's job postings. | |
97
- | `posts get` | Fetch a post. | |
98
- | `posts comments` | List a post's comments. | |
99
- | `posts reactions` | List a post's reactions. | |
100
- | `posts post` | Create a post. | ✎ write |
101
- | `posts comment` | Comment on a post. | ✎ write |
102
- | `posts react` | React to a post or comment. | write |
103
- | `search people` | Search for people. | |
104
- | `search posts` | Search for posts. | |
105
- | `inbox list` | List LinkedIn inbox conversations. | |
106
- | `inbox get` | Fetch an inbox conversation. | |
107
- | `inbox messages` | List messages in a chat. | |
108
- | `inbox send` | Send a message in a chat. | ✎ write |
109
- | `users get` | Fetch a profile. | |
110
- | `users connections` | List a user's connections. | |
111
- | `users posts` | List a user's or company's posts. | |
112
- | `whoami` | Show the connected LinkedIn profile. | |
113
- | `users me` | Same profile read as `whoami`. | |
114
- | `users invite` | Send a connection invite. | write |
104
+ | `post <text>` | Create a post. | ✎ write |
105
+ | `comment <target> <text>` | Comment on a post. | ✎ write |
106
+ | `react <target> [type=like]` | React to a post or comment. | ✎ write |
107
+ | `requests send <target> [message]` | Send a connection request. | ✎ write |
108
+ | `requests sent` | List pending sent connection requests; supports `--limit`, `--cursor`, `--offset`, and `-H/--header`. | |
109
+ | `requests received` | List pending received connection requests; supports `--limit`, `--cursor`, `--offset`, and `-H/--header`. | |
110
+ | `requests accept request_id:<id>` | Accept a received connection request. | ✎ write |
111
+ | `requests cancel request_id:<id>` | Cancel a sent request or refuse a received connection request. | ✎ write |
112
+ | `posts [target]` | List a user's or company's posts; omit the target for your own account. | |
113
+ | `comments <target>` | List a post's comments. | |
114
+ | `reactions <target>` | List a post's reactions. | |
115
+ | `profile [target]` | Fetch a profile; omit the target for your own account. | |
116
+ | `connections [target]` | List connections; omit the target for account-level connections. | |
117
+ | `company <target>` | Fetch a company profile. | |
118
+ | `jobs <target>` | List a company's job postings. | |
119
+ | `search people <keywords>` | Search for people. | |
120
+ | `search posts <keywords>` | Search for posts. | |
121
+ | `search jobs <keywords>` | Search for jobs. | |
122
+ | `search companies <keywords>` | Search for companies. | |
123
+ | `messages` | List conversations. | |
124
+ | `messages <target>` | Read a conversation by `chat_id:<id>`, `@handle`, `profile_id:<id>`, profile URL, or messaging-thread URL. | |
125
+ | `message <target> <text>` | Send a message. | ✎ write |
126
+ | `message <target> delete message_id:<id>` | Delete one of your own messages. | ✎ write |
127
+ | `message <target> edit message_id:<id> <text>` | Edit one of your own messages. | ✎ write |
128
+ | `messages <target> mark read` | Mark a conversation read. | ✎ write |
129
+ | `messages <target> mark unread` | Mark a conversation unread. | ✎ write |
115
130
 
116
131
  ### `social x`
117
132
 
118
133
  | Command | Description | |
119
134
  |---|---|---|
120
- | `search recent` | Search posts from the last 7 days. | |
121
- | `timelines home` | Read the home timeline. | |
122
- | `tweets list` | Fetch up to 100 posts by ID. | |
123
- | `tweets get` | Fetch a single post by ID. | |
124
- | `tweets post` | Create a post. | write |
125
- | `tweets like` · `unlike` | Like or unlike a post. | write |
126
- | `tweets repost` · `unrepost` | Repost or undo a repost. | ✎ write |
127
- | `tweets delete` | Delete a post. | write |
128
- | `users tweets` | List a user's recent posts. | |
129
- | `users followers` | List a user's followers. | |
130
- | `users following` | List accounts a user follows. | |
131
- | `whoami` | Show the authenticated X profile. | |
132
- | `users me` | Same profile read as `whoami`. | |
133
- | `users follow` · `unfollow` | Follow or unfollow a user. | ✎ write |
134
- | `bookmarks list` | List your saved bookmarks. | |
135
- | `bookmarks add` · `remove` | Add or remove a bookmark. | ✎ write |
136
- | `dms list` | List recent DM events. | |
137
- | `dms messages` | List DM events for a conversation. | |
138
- | `dms with` | List one-to-one DM events with a user. | |
139
- | `dms get` | Fetch a DM event. | |
140
- | `dms start` | Start a DM conversation. | ✎ write |
141
- | `dms send` | Send a DM to a participant or conversation. | ✎ write |
135
+ | `post <text>` | Create a post. | write |
136
+ | `repost <target>` · `unrepost <target>` | Repost or undo a repost. | ✎ write |
137
+ | `like <target>` · `unlike <target>` | Like or unlike a post. | ✎ write |
138
+ | `follow <target>` · `unfollow <target>` | Follow or unfollow a user. | ✎ write |
139
+ | `followers [target]` | List a user's followers; omit the target for your own account. | |
140
+ | `following [target]` | List accounts a user follows; omit the target for your own account. | |
141
+ | `tweet <target>` | Fetch a single post. | |
142
+ | `tweets [target]` | List a user's recent posts; omit the target for your own account. | |
143
+ | `profile [target]` | Fetch a profile; omit the target for your own account. | |
144
+ | `timeline` | Read the home timeline. | |
145
+ | `bookmark <target>` · `unbookmark <target>` | Add or remove a bookmark. | ✎ write |
146
+ | `messages` | List conversations. | |
147
+ | `messages <target>` | Read a DM conversation or participant target: chat URL, `chat_id:<id>`, `@handle`, profile URL, or `profile_id:<id>`. | |
148
+ | `message <recipients> [text]` | Send a message to a chat URL, `chat_id:<id>`, `@handle`, profile URL, or `profile_id:<id>`; comma-separate profile targets for a group. | ✎ write |
142
149
 
143
150
  ## Built for agents
144
151
 
145
152
  - **Everything speaks JSON.** Pipe output through `jq`, `fzf`, or your agent's
146
153
  planner — anything that reads stdin. Structured errors and predictable exit
147
154
  codes mean an agent can branch on what happened.
148
- - **The same flags across networks.** `--limit`, `--cursor`, `--account`, and
149
- `--no-cache` behave consistently on LinkedIn and X.
155
+ - **The same patterns across networks.** `--limit`, `--cursor`, and `--account`
156
+ behave consistently on LinkedIn and X. Cacheable reads also list `-H/--header`
157
+ when proxy request headers such as `Cache-Control: no-cache` can be overridden.
150
158
  - **A skill you drop straight in.** Install the public skill repo with
151
159
  `npx skills add usesocial/skill`; Claude, Codex, or any other supported agent
152
160
  then knows the commands.
153
161
 
154
162
  ```sh
155
- # Find hiring posts, fan out to reaction graphs, rank warm contacts — one pipe.
156
- social linkedin search posts "AI infra hiring" \
157
- | jq -r '.posts[].urn' \
158
- | xargs -I{} social linkedin posts reactions {} \
159
- | jq -s '[.[].reactions[] | {actor, type}]
160
- | group_by(.actor.id)
161
- | map({actor: .[0].actor, signals: length})
163
+ # Find hiring posts, fan out to reaction graphs, rank warm contacts.
164
+ social linkedin search posts "AI infra hiring" --limit 25 > /tmp/hiring-posts.json
165
+ jq -r '.items[].id' /tmp/hiring-posts.json \
166
+ | xargs -I{} social linkedin reactions post_id:{} \
167
+ | jq -s '[ .[] | .items[] ]
168
+ | group_by(.actor.id // .reactor.id // .profile_id)
169
+ | map({person: (.[0].actor // .[0].reactor), signals: length})
162
170
  | sort_by(-.signals) | .[0:15]'
163
171
  ```
164
172
 
@@ -169,53 +177,68 @@ social linkedin search posts "AI infra hiring" \
169
177
  | `0` | Success | Continue. |
170
178
  | `2` | Usage or validation error | Fix the command, flags, IDs, JSON body, or local input. |
171
179
  | `3` | Not found | Check the resource ID or pick a different item. |
172
- | `4` | Auth or scope error | Run `social auth login`, or re-login with the needed scope. |
180
+ | `4` | Auth or scope error | Run `social account login`, or log out and choose the needed scope. |
173
181
  | `5` | API or unexpected error | Retry later or surface the server error. |
174
182
  | `7` | Rate limited | Back off; JSON errors may include `retryAfterSeconds`. |
175
183
 
176
184
  ## Auth
177
185
 
178
- `social auth login` runs a device-authorization flow:
186
+ `social account login` runs a device-authorization flow:
179
187
 
180
188
  1. Asks what access to grant the agent. Read and Write are both selected by
181
- default; pass `--scope read` to grant read-only access.
182
- 2. Shows you a verification code and approval URL, then tries to open that URL
189
+ default; clear Write in the prompt to grant read-only access.
190
+ 2. Asks for your email address.
191
+ 3. Shows you a verification code and approval URL, then tries to open that URL
183
192
  in your browser.
184
- 3. Waits until you approve the session in the browser.
185
- 4. Stores the returned token in your OS keyring, falling back to
193
+ 4. Waits until you approve the session in the browser.
194
+ 5. Confirms billing checkout in the terminal when a seat is needed.
195
+ 6. Stores the returned token in your OS keyring, falling back to
186
196
  `~/.social/credentials.json` (mode `0600`) when no keyring is available.
187
197
  Non-production `SOCIAL_API_URL` values use an API-specific credential
188
198
  namespace so staging tests do not overwrite the production session.
189
199
 
190
- `social auth logout` revokes the session and removes the stored token from both places.
191
- `social auth login` requires an interactive terminal and is not supported from CI,
200
+ `social account logout` revokes the session and removes the stored token from both places.
201
+ Bare `social account` prints compact JSON with the current auth state, credential
202
+ namespace, verified session when available, and connected accounts.
203
+ `social account login` requires an interactive terminal and is not supported from CI,
192
204
  background jobs, or agent-mediated setup flows.
193
205
 
194
206
  ## Cache config
195
207
 
196
- Allowlisted GET requests use a local proxy cache. The CLI sends
197
- `Cache-Control: max-age=<seconds>` on API requests from your local config:
208
+ Allowlisted GET requests use a local proxy cache. Cacheable commands send
209
+ `Cache-Control: max-age=<seconds>` from your local config:
198
210
 
199
211
  ```sh
200
- social config cache mode # read the current cache mode and TTL
201
- social config cache mode live # 15 minutes, default
202
- social config cache mode analytical # 24 hours
203
- social config cache mode historical # 1 week
204
- social config cache ttl 3600 # custom TTL in seconds
212
+ social account config cache mode # read the current cache mode and TTL
213
+ social account config cache mode live # 15 minutes, default
214
+ social account config cache mode analytical # 24 hours
215
+ social account config cache mode historical # 1 week
216
+ social account config cache ttl 3600 # custom TTL in seconds
205
217
  ```
206
218
 
207
219
  Setting `ttl` switches the mode to `custom`. Config is stored at
208
- `~/.social/config.json` with mode `0600`. Use command-level `--no-cache` when you
209
- need to bypass cached reads and refresh the stored response.
220
+ `~/.social/config.json` with mode `0600`. Use command-level
221
+ `-H "Cache-Control: no-cache"` when a command lists `--header` in help and you
222
+ need to bypass a cached read.
223
+
224
+ Command output exposes actual per-call cost and pagination under `meta`:
225
+
226
+ ```sh
227
+ social linkedin messages --limit 20 | jq '.meta.cost'
228
+ social x bookmarks --limit 20 | jq '{cost: .meta.cost, cursor: .meta.cursor}'
229
+ ```
230
+
231
+ Agents should watch `.meta.cost` during high-fanout loops and use `social account usage`
232
+ or `social account logs` after a run to summarize actual spend.
210
233
 
211
234
  ## Account safety
212
235
 
213
236
  Built so your accounts outlive your prototype.
214
237
 
215
- - **Read/write scope by default.** Pass `--scope read` when you want a
216
- read-only session that can't post, react, or invite.
238
+ - **Read/write scope by default.** Clear Write during login when you want a
239
+ read-only session that can't post, react, or request connections.
217
240
  - **A write never fires twice.** Rate-limit and server errors surface verbatim and
218
- writes are never retried — so a post or invite can't double-send.
241
+ writes are never retried — so a post or connection request can't double-send.
219
242
  - **A residential IP per account.** Each connected account runs over a dedicated
220
243
  residential proxy with smart rate-limiting, so the network sees a normal session.
221
244
 
@@ -224,21 +247,22 @@ Built so your accounts outlive your prototype.
224
247
  ```sh
225
248
  # LinkedIn
226
249
  social linkedin search people "founder ai"
227
- social linkedin whoami
250
+ social linkedin profile
228
251
 
229
252
  # X
230
- social x search recent "from:elonmusk"
231
- social x bookmarks list <my-x-user-id> --limit 50
232
- social x users followers <x-user-id> --limit 100
233
- social x users following <x-user-id> --limit 100
234
- social x dms list --limit 50
253
+ social x bookmarks --limit 50
254
+ social x followers --limit 100
255
+ social x following profile_id:<x-user-id> --limit 100
256
+ social x messages --limit 50
235
257
 
236
258
  # Usage / billing
237
- social usage --summary --platform linkedin
238
- social usage --limit 20 --from 2026-05-01T00:00:00Z
259
+ social account usage
260
+ social account logs --limit 20 --from 2026-05-01T00:00:00Z
239
261
 
240
- # Agent manifest
262
+ # Command schema
241
263
  social schema
264
+ social schema --leaves
265
+ social schema "x post"
242
266
  ```
243
267
 
244
268
  ## Links
package/bin/social.mjs CHANGED
@@ -1,10 +1,17 @@
1
1
  #!/usr/bin/env node
2
+ import { existsSync } from "node:fs";
2
3
  import { dirname, join } from "node:path";
4
+ import { loadEnvFile } from "node:process";
3
5
  import { fileURLToPath, pathToFileURL } from "node:url";
4
6
 
5
7
  const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
8
+ const localEnvPath = join(packageRoot, "..", "..", ".env.staging");
6
9
  const entryURL = pathToFileURL(join(packageRoot, "dist", "index.mjs")).href;
7
10
 
11
+ if (existsSync(localEnvPath)) {
12
+ loadEnvFile(localEnvPath);
13
+ }
14
+
8
15
  import(entryURL).catch((error) => {
9
16
  console.error(error);
10
17
  process.exit(1);