@soku-ai/cli 0.1.0-alpha.6 → 0.1.0-alpha.7
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/dist/commands/auth.js +1 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/generated.d.ts +1 -1
- package/dist/commands/generated.d.ts.map +1 -1
- package/dist/commands/seo-hosting.d.ts +100 -0
- package/dist/commands/seo-hosting.d.ts.map +1 -0
- package/dist/commands/seo-hosting.js +489 -0
- package/dist/commands/seo-hosting.js.map +1 -0
- package/dist/generated/capabilities.json +207 -29
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/soku/SKILL.md +98 -7
- package/README.md +0 -129
package/skills/soku/SKILL.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: soku
|
|
3
3
|
description: >-
|
|
4
|
-
Use when calling Soku ads/GA4 marketing-data capabilities
|
|
4
|
+
Use when calling Soku ads/GA4 marketing-data capabilities or SEO Hosting
|
|
5
|
+
domain connections from the shell —
|
|
5
6
|
running `soku auth login`, switching org/brand with `soku org use` /
|
|
6
7
|
`soku brand use`, discovering capabilities, calling a data action, routing a
|
|
7
8
|
third-party API call (Ahrefs/DataForSEO/Firecrawl/Gemini/…) through
|
|
8
|
-
`soku egress`, handling 401/403
|
|
9
|
+
`soku egress`, managing `soku seo-hosting connections`, handling 401/403
|
|
10
|
+
errors, or installing/updating the Soku CLI.
|
|
9
11
|
license: Proprietary
|
|
10
12
|
metadata:
|
|
11
13
|
author: nex-ad
|
|
@@ -14,10 +16,10 @@ metadata:
|
|
|
14
16
|
|
|
15
17
|
# Soku CLI
|
|
16
18
|
|
|
17
|
-
The `soku` CLI calls Soku's ads
|
|
18
|
-
preferred way for an agent to use Soku
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
The `soku` CLI calls Soku's ads, GA4, and SEO Hosting capabilities over HTTP. It
|
|
20
|
+
is the preferred way for an agent to use Soku from any shell, with no MCP host
|
|
21
|
+
required. Output is JSON on stdout; errors are a JSON envelope on stderr with a
|
|
22
|
+
semantic exit code.
|
|
21
23
|
|
|
22
24
|
## Output & exit codes
|
|
23
25
|
|
|
@@ -125,7 +127,7 @@ Each data capability is a typed sub-command under its namespace. Discover and
|
|
|
125
127
|
inspect them with `--help` — never guess action names or flags.
|
|
126
128
|
|
|
127
129
|
```bash
|
|
128
|
-
soku resources list # what's granted (e.g. data-infra)
|
|
130
|
+
soku resources list # what's granted (e.g. data-infra, seo-hosting)
|
|
129
131
|
soku --help # namespaces: ads, ga4, …
|
|
130
132
|
soku ads --help # actions in the ads namespace
|
|
131
133
|
soku ads query-single-dimension --help # flags, types, and usage for one action
|
|
@@ -176,6 +178,95 @@ soku call ads list_ad_accounts -p platform=google
|
|
|
176
178
|
soku call ads query_single_dimension --payload '{"account_id":"123","dimension":"campaign"}'
|
|
177
179
|
```
|
|
178
180
|
|
|
181
|
+
## SEO Hosting domain connections
|
|
182
|
+
|
|
183
|
+
Use `soku seo-hosting` to manage SEO Hosting for the active brand. The session
|
|
184
|
+
must include the `seo-hosting` resource. Request it at login:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
soku auth login --resource seo-hosting
|
|
188
|
+
# or include it with data access:
|
|
189
|
+
soku auth login --resource data-infra,seo-hosting
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The workspace must be ready before any connection call:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
soku workspace status
|
|
196
|
+
soku org use <slug|id>
|
|
197
|
+
soku brand use <slug|id>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Posts
|
|
201
|
+
|
|
202
|
+
Use typed `posts` commands for the same SEO Hosting content actions exposed to
|
|
203
|
+
runtime agents through `seo_hosting/*`. These create and manage owned-media web
|
|
204
|
+
pages on the brand's connected domain; they are not social posts.
|
|
205
|
+
|
|
206
|
+
Always check status first:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
soku seo-hosting status
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
If `live` is false, do not create or publish posts yet; connect or fix a domain
|
|
213
|
+
first. When hosting is live:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
soku seo-hosting posts list --section blog --status draft
|
|
217
|
+
soku seo-hosting posts get <post_id>
|
|
218
|
+
soku seo-hosting posts create --title "How to ..." --section blog --body-file post.md
|
|
219
|
+
soku seo-hosting posts update <post_id> --body-file revised.md
|
|
220
|
+
soku seo-hosting posts publish <post_id>
|
|
221
|
+
soku seo-hosting posts delete <post_id> --confirm
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`create` requires `--title` plus exactly one body source: `--body`,
|
|
225
|
+
`--body-file`, or `--body-stdin`. Optional metadata flags are `--slug`,
|
|
226
|
+
`--excerpt`, `--cover-image-url`, `--author-name`, and `--seo '<json object>'`.
|
|
227
|
+
`update` supports mutable fields only; section and slug are intentionally not
|
|
228
|
+
editable through the CLI.
|
|
229
|
+
|
|
230
|
+
Writes run immediately (the same no-review behavior as the first-party
|
|
231
|
+
`seo_hosting` data actions), so confirm intent with the user before publishing
|
|
232
|
+
or deleting.
|
|
233
|
+
|
|
234
|
+
### Domain connections
|
|
235
|
+
|
|
236
|
+
Connection commands:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
soku seo-hosting connections list
|
|
240
|
+
soku seo-hosting connections connect-cname --hostname blog.example.com
|
|
241
|
+
soku seo-hosting connections verify <connection_id>
|
|
242
|
+
soku seo-hosting connections disconnect <connection_id> --confirm
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Cloudflare Worker reverse proxy setup runs a probe before provisioning. Use it
|
|
246
|
+
when the customer's root or existing hostname is already on Cloudflare and SEO
|
|
247
|
+
Hosting needs to mount sections such as `/blog`, `/use-cases`, or
|
|
248
|
+
`/alternatives`:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
soku seo-hosting connections probe --hostname example.com --sections blog,use-cases
|
|
252
|
+
soku seo-hosting connections connect-worker --hostname example.com \
|
|
253
|
+
--sections blog,use-cases --cf-token-env CLOUDFLARE_API_TOKEN
|
|
254
|
+
printf %s "$CLOUDFLARE_API_TOKEN" | soku seo-hosting connections connect-worker \
|
|
255
|
+
--hostname example.com --sections blog --cf-token-stdin
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Allowed sections are `blog`, `use-cases`, and `alternatives`; omitted sections
|
|
259
|
+
default to `blog`. If the probe reports existing mounted content, add
|
|
260
|
+
`--accept-conflicts` only after the user confirms SEO Hosting may shadow those
|
|
261
|
+
paths. If the hostname serves its own Next.js assets, add
|
|
262
|
+
`--accept-next-assets-warning` only after confirming `/_next/static/*` may route
|
|
263
|
+
through the Worker.
|
|
264
|
+
|
|
265
|
+
Do not pass Cloudflare API tokens as literal argv values or print them. Use
|
|
266
|
+
`--cf-token-env <ENV_NAME>` or `--cf-token-stdin` exactly once. Vercel OAuth
|
|
267
|
+
domain connections are not exposed in the CLI yet; use the Studio web settings
|
|
268
|
+
for Vercel-backed domains.
|
|
269
|
+
|
|
179
270
|
## Write actions (human approval required)
|
|
180
271
|
|
|
181
272
|
Some actions mutate state (e.g. conversion-group writes) and are **review-gated**.
|
package/README.md
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# @soku-ai/cli
|
|
2
|
-
|
|
3
|
-
Call Soku ads/GA4 data capabilities from any shell or AI agent. It is the
|
|
4
|
-
preferred surface for external agents and does not require an MCP host.
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm i -g @soku-ai/cli
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Development builds can be linked from this repo:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
pnpm --filter @soku-ai/cli run build
|
|
16
|
-
npm link apps/cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick start
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
soku auth login # device-login in the browser
|
|
23
|
-
soku org use <slug|id> # pick a workspace (id, slug, or name)
|
|
24
|
-
soku brand use <slug|id>
|
|
25
|
-
soku --help # discover namespaces (ads, ga4, …)
|
|
26
|
-
soku update status # check CLI and installed skill updates
|
|
27
|
-
soku memory list # read current-brand memory context
|
|
28
|
-
soku ads --help # actions in a namespace
|
|
29
|
-
soku ads list-ad-accounts --platform google
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Each data capability is a typed sub-command under its namespace; `<command>
|
|
33
|
-
--help` shows its flags. `soku call <ns> <action>` is a raw escape hatch for
|
|
34
|
-
actions not yet exposed as a typed sub-command.
|
|
35
|
-
|
|
36
|
-
## Authentication
|
|
37
|
-
|
|
38
|
-
`soku` uses an org-agnostic, device-login session token (RFC 8628). You log in
|
|
39
|
-
once; the org and brand are chosen at runtime and sent per request.
|
|
40
|
-
|
|
41
|
-
- **Human:** `soku auth login` opens the browser and waits for approval.
|
|
42
|
-
- **Agent (non-blocking):** `soku auth login --no-wait` returns the verification
|
|
43
|
-
URL immediately; resume with `soku auth login --device-code <code>` after the
|
|
44
|
-
user approves.
|
|
45
|
-
- **CI / headless:** set `SOKU_TOKEN` to a pre-issued token to skip interactive
|
|
46
|
-
auth (and the OS keychain).
|
|
47
|
-
|
|
48
|
-
Token storage: OS keychain when available, else `~/.soku/credentials.json`
|
|
49
|
-
(0600). Set `SOKU_NO_KEYCHAIN=1` to always use the file. Behind a proxy, set
|
|
50
|
-
`ALL_PROXY`.
|
|
51
|
-
|
|
52
|
-
## Output
|
|
53
|
-
|
|
54
|
-
TTY output is human-readable: status lines, key/value summaries, and tables for
|
|
55
|
-
lists. Piped or non-TTY output stays machine-readable JSON
|
|
56
|
-
(`{"ok":true,"data":...}`). Errors go to stderr as
|
|
57
|
-
`{"ok":false,"error":{type,message,hint}}` with a semantic exit code (0 ok / 1
|
|
58
|
-
usage / 2 auth / 4 not-found / 5 runtime). `soku egress -- curl ...` is the
|
|
59
|
-
exception: successful upstream responses are passed through verbatim.
|
|
60
|
-
|
|
61
|
-
## Use from an AI agent
|
|
62
|
-
|
|
63
|
-
For a fresh agent, point it at the hosted installer guide:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
Read https://soku.ai/cli/skill.md and install the Soku CLI.
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Install the bundled skill so Claude Code / Codex / Cursor know how to drive the
|
|
70
|
-
CLI:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
soku skill install --global # all detected agents
|
|
74
|
-
soku skill install --agent claude # one agent, into the project
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The CLI writes `.soku-skills.json` only while Soku-managed skills are installed
|
|
78
|
-
in a skills directory. It is a local install manifest, not a credential or user
|
|
79
|
-
config file, and it is removed automatically when the last Soku-managed skill is
|
|
80
|
-
removed.
|
|
81
|
-
|
|
82
|
-
## Updates
|
|
83
|
-
|
|
84
|
-
`soku update status` queries the npm registry for `@soku-ai/cli@latest` and
|
|
85
|
-
compares installed Soku-managed skills against the public skill catalog.
|
|
86
|
-
`soku update skills` refreshes the bundled `soku` meta-skill plus already
|
|
87
|
-
installed business skills. `soku update cli` runs `npm i -g @soku-ai/cli`.
|
|
88
|
-
|
|
89
|
-
The CLI also performs an advisory check on every command invocation, writing
|
|
90
|
-
update notices to stderr only. There is no update-check cache; set
|
|
91
|
-
`SOKU_NO_UPDATE_CHECK=1` to disable the background notice. The legacy
|
|
92
|
-
`soku update-check` command still exists as a hidden compatibility alias.
|
|
93
|
-
|
|
94
|
-
## Release
|
|
95
|
-
|
|
96
|
-
Release publishing is handled by `.github/workflows/publish-soku-cli.yml`.
|
|
97
|
-
|
|
98
|
-
1. Bump both `apps/cli/package.json` and `apps/cli/src/version.ts`.
|
|
99
|
-
2. Run `pnpm --filter @soku-ai/cli test` and `pnpm --filter @soku-ai/cli build`.
|
|
100
|
-
3. Use workflow dispatch with `dry_run=true` to verify packaging.
|
|
101
|
-
4. After the PR is merged, push a tag named `soku-ai-cli-v<version>`.
|
|
102
|
-
|
|
103
|
-
The workflow verifies that the tag matches the package version, checks that the
|
|
104
|
-
version is not already on npm, runs `npm pack --dry-run`, then publishes with
|
|
105
|
-
`npm publish --access public --tag latest` via npm Trusted Publishing.
|
|
106
|
-
The publish workflow upgrades npm to the Trusted Publishing compatible runtime
|
|
107
|
-
before calling `npm publish`.
|
|
108
|
-
|
|
109
|
-
## Environment variables
|
|
110
|
-
|
|
111
|
-
Production is the default: API calls go to `https://api.soku.ai`, and skills are
|
|
112
|
-
downloaded from `https://api.soku.ai/api/cli/skills`. Local and staging
|
|
113
|
-
endpoints are environment-only overrides so a dev session cannot poison
|
|
114
|
-
`~/.soku/config.json`.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
SOKU_API_BASE=http://localhost:15386 soku auth status
|
|
118
|
-
SOKU_SKILLS_URL=http://127.0.0.1:18080 soku skill list
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
| Variable | Purpose |
|
|
122
|
-
|----------|---------|
|
|
123
|
-
| `SOKU_TOKEN` | Pre-issued session token (overrides stored credentials) |
|
|
124
|
-
| `SOKU_API_BASE` | Per-command API base URL override; default is `https://api.soku.ai` |
|
|
125
|
-
| `SOKU_ORG_ID` / `SOKU_BRAND_ID` | One-off workspace override |
|
|
126
|
-
| `SOKU_NO_KEYCHAIN` | Skip the OS keychain; use the 0600 file |
|
|
127
|
-
| `SOKU_NO_UPDATE_CHECK` | Disable the background update notice |
|
|
128
|
-
| `SOKU_SKILLS_URL` | Per-command skill catalog override |
|
|
129
|
-
| `ALL_PROXY` | Proxy for outbound HTTPS |
|