outrank-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/LICENSE +21 -0
- package/README.md +152 -0
- package/SKILL.md +348 -0
- package/bin/outrank-cli.js +2 -0
- package/package.json +46 -0
- package/src/commands/articles.js +301 -0
- package/src/commands/auth.js +127 -0
- package/src/commands/billing.js +129 -0
- package/src/commands/keywords.js +311 -0
- package/src/commands/products.js +476 -0
- package/src/commands/subscription.js +39 -0
- package/src/commands/usage.js +39 -0
- package/src/core/api.js +82 -0
- package/src/core/args.js +144 -0
- package/src/core/config.js +80 -0
- package/src/core/errors.js +15 -0
- package/src/core/io.js +49 -0
- package/src/index.js +134 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Outrank SAS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Outrank CLI
|
|
2
|
+
|
|
3
|
+
Agent-first CLI for the Outrank agent API.
|
|
4
|
+
|
|
5
|
+
## Current scope
|
|
6
|
+
|
|
7
|
+
This repo currently targets the agent endpoints that already exist in `outrank`:
|
|
8
|
+
|
|
9
|
+
- `auth whoami`
|
|
10
|
+
- `products list|get|create|update|pause|resume`
|
|
11
|
+
- `products output-settings get|update` for product article settings
|
|
12
|
+
- `products target-audiences list|replace`
|
|
13
|
+
- `products competitors list|replace`
|
|
14
|
+
- `products gsc status|connect|poll|reconnect|disconnect|accounts|properties|set-property|performance|search-analytics|inspect-url|cannibalization`
|
|
15
|
+
- `keywords list|get|export|generation-status|add|suggest|generate|reschedule|bulk-reschedule|delete|bulk-delete`
|
|
16
|
+
- `articles list|get|get-content|update|update-content|replace|bulk-replace|upload-image|upload-featured-image|retry-publish|delete|precreate|generate`
|
|
17
|
+
- `subscription status`
|
|
18
|
+
- `usage stats`
|
|
19
|
+
- `billing portal-url`
|
|
20
|
+
- `billing purchase-products quote|buy`
|
|
21
|
+
|
|
22
|
+
The broader roadmap from the internal implementation plan is larger than the live backend surface. This CLI is structured so new groups can be added cleanly as the server catches up.
|
|
23
|
+
|
|
24
|
+
## Auth
|
|
25
|
+
|
|
26
|
+
The CLI can read credentials from either:
|
|
27
|
+
|
|
28
|
+
- `OUTRANK_API_KEY`
|
|
29
|
+
- `~/.outrank/config.json` after `outrank-cli auth login <api-key>`
|
|
30
|
+
|
|
31
|
+
Optional config storage override:
|
|
32
|
+
|
|
33
|
+
- `OUTRANK_CONFIG_DIR`
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
outrank-cli auth login outr_live_xxx
|
|
39
|
+
outrank-cli auth status
|
|
40
|
+
outrank-cli auth whoami
|
|
41
|
+
outrank-cli products list --limit 20
|
|
42
|
+
outrank-cli keywords list --product 00000000-0000-0000-0000-000000000000 --scope all
|
|
43
|
+
outrank-cli keywords generation-status --product 00000000-0000-0000-0000-000000000000
|
|
44
|
+
outrank-cli articles list --product 00000000-0000-0000-0000-000000000000 --status published
|
|
45
|
+
outrank-cli articles get 00000000-0000-0000-0000-000000000000
|
|
46
|
+
outrank-cli articles get-content 00000000-0000-0000-0000-000000000000 --format html
|
|
47
|
+
outrank-cli articles update 00000000-0000-0000-0000-000000000000 --json '{"title":"New title"}'
|
|
48
|
+
outrank-cli articles update 00000000-0000-0000-0000-000000000000 --json '{"image_url":"https://example.com/featured.jpg"}'
|
|
49
|
+
outrank-cli articles upload-image --file .\diagram.png --article 00000000-0000-0000-0000-000000000000
|
|
50
|
+
outrank-cli articles upload-featured-image 00000000-0000-0000-0000-000000000000 --file .\hero.jpg
|
|
51
|
+
outrank-cli articles replace 00000000-0000-0000-0000-000000000000 --json '{"find":"Old brand","replace_with":"New brand","preview_only":true}'
|
|
52
|
+
outrank-cli articles retry-publish 00000000-0000-0000-0000-000000000000
|
|
53
|
+
outrank-cli articles precreate 00000000-0000-0000-0000-000000000000
|
|
54
|
+
outrank-cli articles generate 00000000-0000-0000-0000-000000000000
|
|
55
|
+
outrank-cli subscription status
|
|
56
|
+
outrank-cli usage stats
|
|
57
|
+
outrank-cli products get 00000000-0000-0000-0000-000000000000
|
|
58
|
+
outrank-cli keywords suggest --product 00000000-0000-0000-0000-000000000000 --theme "email marketing"
|
|
59
|
+
outrank-cli keywords generate --product 00000000-0000-0000-0000-000000000000 --count 10 --source both
|
|
60
|
+
outrank-cli keywords add --product 00000000-0000-0000-0000-000000000000 --json-file .\keywords.json
|
|
61
|
+
outrank-cli keywords export --product 00000000-0000-0000-0000-000000000000
|
|
62
|
+
outrank-cli products create --json-file .\product.json
|
|
63
|
+
# products create now auto-queues the initial ~30-day keyword plan; poll with keywords generation-status / keywords list
|
|
64
|
+
outrank-cli billing portal-url
|
|
65
|
+
outrank-cli products update 00000000-0000-0000-0000-000000000000 --json '{"daily_article_count":2}'
|
|
66
|
+
outrank-cli products output-settings update 00000000-0000-0000-0000-000000000000 --json-file .\output-settings.json
|
|
67
|
+
outrank-cli products target-audiences replace 00000000-0000-0000-0000-000000000000 --json-file .\target-audiences.json
|
|
68
|
+
outrank-cli products competitors replace 00000000-0000-0000-0000-000000000000 --json-file .\competitors.json
|
|
69
|
+
outrank-cli products gsc status 00000000-0000-0000-0000-000000000000
|
|
70
|
+
outrank-cli products gsc connect 00000000-0000-0000-0000-000000000000
|
|
71
|
+
outrank-cli products gsc poll 00000000-0000-0000-0000-000000000000 --attempt-id <attempt-id>
|
|
72
|
+
outrank-cli products gsc accounts 00000000-0000-0000-0000-000000000000
|
|
73
|
+
outrank-cli products gsc properties 00000000-0000-0000-0000-000000000000 --email owner@example.com
|
|
74
|
+
outrank-cli products gsc set-property 00000000-0000-0000-0000-000000000000 --email owner@example.com --site-url sc-domain:example.com
|
|
75
|
+
outrank-cli products gsc performance 00000000-0000-0000-0000-000000000000 --months 3
|
|
76
|
+
outrank-cli products gsc search-analytics 00000000-0000-0000-0000-000000000000 --dimensions query,page --limit 50 --query "brand"
|
|
77
|
+
outrank-cli products gsc inspect-url 00000000-0000-0000-0000-000000000000 --url https://example.com/blog/post
|
|
78
|
+
outrank-cli products gsc cannibalization 00000000-0000-0000-0000-000000000000
|
|
79
|
+
outrank-cli keywords reschedule 00000000-0000-0000-0000-000000000000 --scheduled-for 2026-05-20
|
|
80
|
+
outrank-cli billing purchase-products quote --additional-products 2
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Google Search Console workflow
|
|
84
|
+
|
|
85
|
+
- Start with `outrank-cli products gsc connect <product-id>`.
|
|
86
|
+
- Open the returned `connect_url` in a browser and complete the Google OAuth flow with a human.
|
|
87
|
+
- Poll with `outrank-cli products gsc poll <product-id> --attempt-id <attempt-id>` until the response reports completion.
|
|
88
|
+
- Inspect connected Google identities with `outrank-cli products gsc accounts <product-id>`.
|
|
89
|
+
- List Search Console properties for one account with `outrank-cli products gsc properties <product-id> --email owner@example.com`.
|
|
90
|
+
- Save the verified property with `outrank-cli products gsc set-property <product-id> --email owner@example.com --site-url <verified-site-url>`.
|
|
91
|
+
- Read performance summaries with `outrank-cli products gsc performance <product-id>`.
|
|
92
|
+
- Run custom keyword/page/device reports with `outrank-cli products gsc search-analytics <product-id>`.
|
|
93
|
+
- Inspect one page's indexing and canonical state with `outrank-cli products gsc inspect-url <product-id> --url <url>`.
|
|
94
|
+
- Analyze overlapping-query cannibalization with `outrank-cli products gsc cannibalization <product-id>`.
|
|
95
|
+
- Use `reconnect` when the token is expired and `disconnect` to remove the product connection.
|
|
96
|
+
|
|
97
|
+
## Keyword mutation rules
|
|
98
|
+
|
|
99
|
+
- Run `outrank-cli keywords generation-status --product <product-id>` before keyword writes when you are not sure the product is writable.
|
|
100
|
+
- `keywords generate` now mirrors the dashboard Generate Keywords flow. Ask the human how many keywords to generate before calling it if they did not specify a count.
|
|
101
|
+
- The allowed generation count is 5-30, but the real upper bound depends on free scheduler slots. Check `keywords generation-status` first when you need the current capacity.
|
|
102
|
+
- Stored keywords are read-only inventory. They can be promoted into the plan with `keywords add`, but they cannot be deleted directly.
|
|
103
|
+
- Scheduled keywords with created or pre-created articles are read-only.
|
|
104
|
+
- Keywords in `generating_article` are read-only until generation finishes.
|
|
105
|
+
- Past keywords are read-only except past `scheduled` or `disabled` keywords without an article, which can still be rescheduled.
|
|
106
|
+
- If the main subscription is `past_due`, keyword mutations are blocked and reads still work.
|
|
107
|
+
|
|
108
|
+
## Article behavior notes
|
|
109
|
+
|
|
110
|
+
- Article content is markdown in the current app and agent API. `articles get-content` returns markdown by default; `--format html` returns rendered HTML.
|
|
111
|
+
- Featured image can be updated either by hosted URL through `articles update --json '{"image_url":"..."}'` or by local-file upload through `articles upload-featured-image`.
|
|
112
|
+
- In-content images can be uploaded from a local file with `articles upload-image`; the command returns the hosted URL plus generated alt text so the agent can insert or replace the markdown image reference.
|
|
113
|
+
- Per-article instructions are stored on the linked scheduled keyword, so `articles update --json '{"instructions":"..."}'` only works for articles that still have a linked planner keyword.
|
|
114
|
+
- Slug is returned for read-only reference but cannot be changed through the agent API.
|
|
115
|
+
- `articles generate <keyword-id>` is only valid for scheduled keywords due today; it mirrors the dashboard's create-and-publish action.
|
|
116
|
+
- `articles precreate <keyword-id>` is only valid for eligible future scheduled keywords, is unavailable on trial subscriptions, and should be polled through the keyword state afterward.
|
|
117
|
+
- `articles update --json '{"status":"published"}'` cannot be used to manually publish a future scheduled article before its due date.
|
|
118
|
+
- `articles retry-publish <article-id>` is only valid for generated articles with a publish error.
|
|
119
|
+
|
|
120
|
+
## Custom API target (advanced)
|
|
121
|
+
|
|
122
|
+
The CLI talks to `https://outrank.so` by default and you should not need to change that. The override below exists only for Outrank staff debugging against a staging deployment.
|
|
123
|
+
|
|
124
|
+
```powershell
|
|
125
|
+
$env:OUTRANK_BASE_URL="https://staging.example"
|
|
126
|
+
outrank-cli auth whoami
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`--base-url <url>` is the per-command form.
|
|
130
|
+
|
|
131
|
+
The agent API expects product UUIDs, not numeric ids like `88`.
|
|
132
|
+
|
|
133
|
+
## Notes on `whoami`
|
|
134
|
+
|
|
135
|
+
`auth whoami` currently returns `organization.product_count` from the backend. In the current Outrank backend, that value behaves as the organization's purchased or available product-slot count, not necessarily the number of product rows returned by `products list`.
|
|
136
|
+
|
|
137
|
+
If you do not want a global link yet, you can run the CLI directly from this repo:
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
node .\src\index.js auth whoami --api-key outr_live_xxx
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## JSON-first contract
|
|
144
|
+
|
|
145
|
+
Every command writes a single JSON object to stdout.
|
|
146
|
+
|
|
147
|
+
- Successful API calls pass through the server's `ok`, `data`, and `agent_guidance` shape.
|
|
148
|
+
- Local CLI-only commands (`auth login`, `auth logout`, usage help) emit the same envelope shape.
|
|
149
|
+
- Invalid usage and local runtime failures also emit JSON and exit non-zero.
|
|
150
|
+
|
|
151
|
+
This makes the CLI easier for AI agents to drive reliably.
|
|
152
|
+
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: outrank
|
|
3
|
+
description: Drive the Outrank agent API from the terminal via outrank-cli. Use when the user asks to list/create/update Outrank products, inspect or manage keyword plans, inspect or edit articles, manage article settings, target audiences, competitors, Google Search Console connections, or quote/buy product slots. Requires outrank-cli on PATH and an Outrank API key (env OUTRANK_API_KEY or stored via auth login).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Outrank Skill
|
|
7
|
+
|
|
8
|
+
Use `outrank-cli` to drive Outrank from the terminal. The CLI is JSON-first and every command returns `agent_guidance`, so read that field after each step and let it steer the next call.
|
|
9
|
+
|
|
10
|
+
In human-facing responses, call `products get` / `products update` the product's General settings. These cover the non-editorial product basics such as name, URL, description, sitemap URL, blog root URL, publishing cadence, backlink toggles, and similar core product fields.
|
|
11
|
+
|
|
12
|
+
In human-facing responses, call product `output-settings` article settings or article preferences. Use `output-settings` only when you are quoting the literal CLI command or API path.
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
1. If `OUTRANK_API_KEY` is not set, ask the human for an Outrank API key from `https://outrank.so/dashboard/settings/api-keys`.
|
|
17
|
+
2. Store it with `outrank-cli auth login <api-key>`.
|
|
18
|
+
3. Verify access with `outrank-cli auth whoami`.
|
|
19
|
+
4. If a command fails with auth errors, tell the human exactly how to refresh the key, then retry.
|
|
20
|
+
5. If the environment blocks writes to the default home directory, set `OUTRANK_CONFIG_DIR` to a writable folder before using `auth login`.
|
|
21
|
+
6. If the API is hosted on a non-default Outrank deployment, set `OUTRANK_BASE_URL=<deployment-url>`. Use `--base-url <deployment-url>` only as a per-command override when needed.
|
|
22
|
+
|
|
23
|
+
## Discovery
|
|
24
|
+
|
|
25
|
+
Run `outrank-cli --help` first if you need the command tree.
|
|
26
|
+
|
|
27
|
+
Run group help when needed:
|
|
28
|
+
|
|
29
|
+
- `outrank-cli auth --help`
|
|
30
|
+
- `outrank-cli products --help`
|
|
31
|
+
- `outrank-cli keywords --help`
|
|
32
|
+
- `outrank-cli articles --help`
|
|
33
|
+
- `outrank-cli subscription --help`
|
|
34
|
+
- `outrank-cli usage --help`
|
|
35
|
+
- `outrank-cli billing --help`
|
|
36
|
+
- `outrank-cli auth status`
|
|
37
|
+
|
|
38
|
+
Prefer inspecting before mutating:
|
|
39
|
+
|
|
40
|
+
- `outrank-cli products list --limit 20`
|
|
41
|
+
- `outrank-cli products get <productId>` for General settings
|
|
42
|
+
- `outrank-cli products output-settings get <productId>`
|
|
43
|
+
- `outrank-cli keywords list --product <productId> --scope all`
|
|
44
|
+
- `outrank-cli articles list --product <productId>`
|
|
45
|
+
- `outrank-cli articles get <articleId>`
|
|
46
|
+
- `outrank-cli articles get-content <articleId>`
|
|
47
|
+
- `outrank-cli articles upload-image --file <path> --article <articleId>`
|
|
48
|
+
- `outrank-cli articles upload-featured-image <articleId> --file <path>`
|
|
49
|
+
- `outrank-cli keywords export --product <productId>`
|
|
50
|
+
- `outrank-cli products target-audiences list <productId>`
|
|
51
|
+
- `outrank-cli products competitors list <productId>`
|
|
52
|
+
- `outrank-cli products gsc status <productId>`
|
|
53
|
+
- `outrank-cli products gsc accounts <productId>`
|
|
54
|
+
- `outrank-cli products gsc performance <productId>`
|
|
55
|
+
- `outrank-cli subscription status`
|
|
56
|
+
- `outrank-cli usage stats`
|
|
57
|
+
|
|
58
|
+
Interpret `auth whoami` carefully:
|
|
59
|
+
|
|
60
|
+
- `organization.product_count` may represent purchased product slots, not the literal number of rows returned by `products list`.
|
|
61
|
+
|
|
62
|
+
## Write pattern
|
|
63
|
+
|
|
64
|
+
For complex writes, prefer JSON via file or stdin over long shell escaping.
|
|
65
|
+
|
|
66
|
+
Accepted input forms:
|
|
67
|
+
|
|
68
|
+
- `--json '{...}'`
|
|
69
|
+
- `--json-file payload.json`
|
|
70
|
+
- `--json-stdin`
|
|
71
|
+
|
|
72
|
+
Write commands currently supported:
|
|
73
|
+
|
|
74
|
+
- `outrank-cli products create --json-file product.json`
|
|
75
|
+
After create, the initial ~30-day keyword plan is queued automatically. Poll with `outrank-cli keywords generation-status --product <productId>` and then inspect `outrank-cli keywords list --product <productId>`.
|
|
76
|
+
- `outrank-cli products update <productId> --json-file patch.json` for General settings
|
|
77
|
+
- `outrank-cli products output-settings update <productId> --json-file output-settings.json`
|
|
78
|
+
- `outrank-cli products target-audiences replace <productId> --json-file target-audiences.json`
|
|
79
|
+
- `outrank-cli products competitors replace <productId> --json-file competitors.json`
|
|
80
|
+
- `outrank-cli products gsc connect <productId>`
|
|
81
|
+
- `outrank-cli products gsc reconnect <productId>`
|
|
82
|
+
- `outrank-cli products gsc disconnect <productId>`
|
|
83
|
+
- `outrank-cli products gsc set-property <productId> --email owner@example.com --site-url <verified-site-url>`
|
|
84
|
+
- `outrank-cli products gsc search-analytics <productId> --dimensions query,page --limit 50`
|
|
85
|
+
- `outrank-cli products gsc inspect-url <productId> --url https://example.com/blog/post`
|
|
86
|
+
- `outrank-cli products gsc cannibalization <productId>`
|
|
87
|
+
- `outrank-cli keywords add --product <productId> --json-file keywords.json`
|
|
88
|
+
- `outrank-cli keywords bulk-reschedule --json-file keyword-reschedule.json`
|
|
89
|
+
- `outrank-cli keywords bulk-delete --json-file keyword-delete.json`
|
|
90
|
+
- `outrank-cli articles update <articleId> --json-file article-patch.json`
|
|
91
|
+
- `outrank-cli articles update-content <articleId> --json-file article-content.json`
|
|
92
|
+
- `outrank-cli articles replace <articleId> --json-file replace.json`
|
|
93
|
+
- `outrank-cli articles bulk-replace --json-file bulk-replace.json`
|
|
94
|
+
- `outrank-cli articles upload-image --file local-image.png --article <articleId>`
|
|
95
|
+
- `outrank-cli articles upload-featured-image <articleId> --file hero.jpg`
|
|
96
|
+
|
|
97
|
+
Billing-management helper:
|
|
98
|
+
|
|
99
|
+
- `outrank-cli billing portal-url`
|
|
100
|
+
|
|
101
|
+
## New-product preflight
|
|
102
|
+
|
|
103
|
+
When the human asks to create or add a new product, do not jump straight to `products create` or a billing purchase.
|
|
104
|
+
|
|
105
|
+
Treat product creation as blocked until you have either:
|
|
106
|
+
|
|
107
|
+
1. Collected the key product and article-settings inputs, or
|
|
108
|
+
2. Explicit human approval to keep the current defaults for anything they did not specify.
|
|
109
|
+
|
|
110
|
+
Ask for missing information explicitly. Do not silently rely on defaults for editorial behavior.
|
|
111
|
+
When the account already has products, inspect at least one existing product's article settings first so you can see the current backend's actual setting keys before you ask the human to configure a new one.
|
|
112
|
+
|
|
113
|
+
Use this inspection pattern before asking article-setting questions:
|
|
114
|
+
|
|
115
|
+
- `outrank-cli products list --limit 20`
|
|
116
|
+
- `outrank-cli products output-settings get <existingProductId>`
|
|
117
|
+
|
|
118
|
+
Use the returned `output-settings` object as the authoritative checklist of fields currently visible through the live API for that account. Do not rely on a hardcoded short list if the live object contains more agent-visible settings. Do not infer dashboard-only or internal generation fields that are intentionally hidden from the agent API, including `outline`, `outrank_prompt`, and `not_included_words`.
|
|
119
|
+
|
|
120
|
+
When the response includes `data._meta`:
|
|
121
|
+
|
|
122
|
+
- if `data._human` is present, use that as the default source for any human-facing summary
|
|
123
|
+
- use `data._meta.sections` to decide which settings to show humans and how to group them
|
|
124
|
+
- use `data._meta.fields.<field>.label` and `.description` instead of inventing meanings from snake_case names
|
|
125
|
+
- use `data._meta.fields.<field>.options` for enum choices and `constraints` for numeric/color limits before proposing or writing a new value
|
|
126
|
+
- treat `data._meta.hidden_from_human_summary_fields` as bookkeeping fields that usually should not be surfaced in prose
|
|
127
|
+
- if a field is missing from `data._meta.fields`, do not guess what it means; say the live API did not define that field's semantics clearly
|
|
128
|
+
- never mention database table names, raw API field names, raw enum keys, or internal ids in normal human-facing explanations unless the user explicitly asks for implementation details
|
|
129
|
+
|
|
130
|
+
Minimum product brief to collect before creation:
|
|
131
|
+
|
|
132
|
+
- product name
|
|
133
|
+
- canonical website URL
|
|
134
|
+
- product description
|
|
135
|
+
- target audiences
|
|
136
|
+
- competitor set
|
|
137
|
+
- language
|
|
138
|
+
- keyword region
|
|
139
|
+
|
|
140
|
+
Article settings to confirm before creation or immediately before the first write:
|
|
141
|
+
|
|
142
|
+
- tone and style
|
|
143
|
+
- whether to auto-publish
|
|
144
|
+
- whether to include a table of contents
|
|
145
|
+
- whether to mention similar products
|
|
146
|
+
- whether to include CTAs
|
|
147
|
+
- whether to include YouTube videos, if that field exists in the inspected article settings
|
|
148
|
+
- featured-image style, article-image style, or similar image fields, if those fields exist in the inspected article settings
|
|
149
|
+
|
|
150
|
+
The list above is a minimum reminder, not the full agent-visible schema. If the inspected live output-settings object includes additional visible fields, ask about those too. Do not ask the human to configure hidden internal fields that are absent from the live object.
|
|
151
|
+
|
|
152
|
+
For preset-backed fields, do not ask for free-form prose unless the backend clearly accepts arbitrary text. Many settings are select-style options. Examples may include tone, image style, or featured-image style.
|
|
153
|
+
|
|
154
|
+
If the live API or current repo context does not expose the full allowed option list for a preset-backed field:
|
|
155
|
+
|
|
156
|
+
- do not pretend the value is free-form
|
|
157
|
+
- ask the human for the exact option label they want as it appears in Outrank
|
|
158
|
+
- if helpful, show the current value from an existing product as a reference point
|
|
159
|
+
- say clearly when the CLI exposes the field's current value but not the full enum catalog
|
|
160
|
+
|
|
161
|
+
Business-critical settings that may matter even if the current CLI surface cannot set them yet:
|
|
162
|
+
|
|
163
|
+
- blog URL or publishing destination
|
|
164
|
+
- internal linking preferences
|
|
165
|
+
- image style or image-generation preferences
|
|
166
|
+
- article examples or brand-writing examples
|
|
167
|
+
- publishing workflow preferences such as draft-first vs direct publish
|
|
168
|
+
|
|
169
|
+
If the human has not provided those business-critical settings yet, say so clearly. Explain which of them are currently exposed by `outrank-cli` and which are not. For settings that are not yet supported by the current CLI surface, do not invent commands. Instead, ask the human whether to:
|
|
170
|
+
|
|
171
|
+
- proceed with existing/default Outrank settings for now, or
|
|
172
|
+
- stop product creation until those settings are provided and/or configured elsewhere
|
|
173
|
+
|
|
174
|
+
Before any billing or create step, present a short confirmation summary that includes:
|
|
175
|
+
|
|
176
|
+
- what will be created
|
|
177
|
+
- what competitors and audiences will be set
|
|
178
|
+
- which article settings will be written
|
|
179
|
+
- which fields were confirmed from the live output-settings schema versus inferred from docs/examples
|
|
180
|
+
- which important settings are still defaulting because they were not provided or are not yet exposed in the CLI
|
|
181
|
+
- whether a real billing charge approval is still required
|
|
182
|
+
|
|
183
|
+
## Product workflow
|
|
184
|
+
|
|
185
|
+
For a new product:
|
|
186
|
+
|
|
187
|
+
1. Gather the new-product preflight inputs above. If anything important is missing, ask the human before continuing.
|
|
188
|
+
2. If another paid product slot is needed, quote the billing change before creating anything.
|
|
189
|
+
3. After the human approves the plan, create it with `products create`.
|
|
190
|
+
4. Read the returned `agent_guidance`.
|
|
191
|
+
5. Tune article behavior with `products output-settings update`.
|
|
192
|
+
6. Replace the target-audience set with `products target-audiences replace`.
|
|
193
|
+
7. Replace the competitor set with `products competitors replace`.
|
|
194
|
+
8. Re-read the product, article settings, target audiences, and competitors to confirm the final state.
|
|
195
|
+
|
|
196
|
+
When you only need a small change, use `products update` rather than recreating the product.
|
|
197
|
+
|
|
198
|
+
## Google Search Console workflow
|
|
199
|
+
|
|
200
|
+
Use the product-scoped Google Search Console commands when the human needs to connect, inspect, select, reconnect, or remove a Search Console property.
|
|
201
|
+
|
|
202
|
+
Recommended flow:
|
|
203
|
+
|
|
204
|
+
1. Inspect current status with `outrank-cli products gsc status <productId>`.
|
|
205
|
+
2. Start OAuth with `outrank-cli products gsc connect <productId>`.
|
|
206
|
+
3. Tell the human to open the returned `connect_url` and finish the Google flow in a browser.
|
|
207
|
+
4. Poll with `outrank-cli products gsc poll <productId> --attempt-id <attempt-id>` until the response reports completion.
|
|
208
|
+
5. Inspect available connected Google identities with `outrank-cli products gsc accounts <productId>`.
|
|
209
|
+
6. List properties for one identity with `outrank-cli products gsc properties <productId> --email owner@example.com`.
|
|
210
|
+
7. Save the verified property with `outrank-cli products gsc set-property <productId> --email owner@example.com --site-url <verified-site-url>`.
|
|
211
|
+
8. Read live/cached search performance with `outrank-cli products gsc performance <productId>` or run custom reports with `outrank-cli products gsc search-analytics <productId>`.
|
|
212
|
+
9. Inspect one page's indexing details with `outrank-cli products gsc inspect-url <productId> --url <url>`.
|
|
213
|
+
10. Inspect overlapping-query issues with `outrank-cli products gsc cannibalization <productId>`.
|
|
214
|
+
|
|
215
|
+
Important behavior:
|
|
216
|
+
|
|
217
|
+
- `accounts` returns stored connected Google identities already known to Outrank for the organization. It does not query the browser or operating system for every Google account.
|
|
218
|
+
- `properties` requires an `--email` that matches one of those connected identities.
|
|
219
|
+
- `set-property` only succeeds for verified properties. If the property is unverified, keep the current selection unchanged and ask the human to verify access in Google Search Console first.
|
|
220
|
+
- `performance` is the fastest high-level read for clicks, impressions, CTR, position, trend lines, top pages, and top queries.
|
|
221
|
+
- `search-analytics` is the flexible raw report endpoint for keyword/page/country/device exploration.
|
|
222
|
+
- `inspect-url` is the indexing/debug endpoint for canonical, crawl, AMP, mobile, rich-result, sitemap, and referring-URL details on one page.
|
|
223
|
+
- `cannibalization` highlights queries where multiple pages from the same site compete against each other.
|
|
224
|
+
- Use `reconnect` when the status shows an expired token or refresh failure.
|
|
225
|
+
- Use `disconnect` to remove the product's Search Console connection.
|
|
226
|
+
|
|
227
|
+
## Keyword workflow
|
|
228
|
+
|
|
229
|
+
Keyword plans now have two buckets:
|
|
230
|
+
|
|
231
|
+
- scheduled keywords: already on the content calendar
|
|
232
|
+
- stored keywords: unscheduled inventory waiting to be promoted into the plan
|
|
233
|
+
|
|
234
|
+
Inspect before mutating:
|
|
235
|
+
|
|
236
|
+
- `outrank-cli keywords list --product <productId> --scope scheduled`
|
|
237
|
+
- `outrank-cli keywords list --product <productId> --scope stored`
|
|
238
|
+
- `outrank-cli keywords list --product <productId> --scope all`
|
|
239
|
+
- `outrank-cli keywords export --product <productId>`
|
|
240
|
+
- `outrank-cli keywords generation-status --product <productId>`
|
|
241
|
+
|
|
242
|
+
Use the returned `data.scope`, `data.scheduled`, and `data.stored` structure literally. Do not invent a different keyword model.
|
|
243
|
+
|
|
244
|
+
When the user asks for keyword ideas:
|
|
245
|
+
|
|
246
|
+
- use `outrank-cli keywords suggest --product <productId> --theme "<theme>"` for related-keyword exploration around a theme or seed term
|
|
247
|
+
- use `outrank-cli keywords generate --product <productId> --count <n> --source competitors|audiences|both` for the dashboard-equivalent Generate Keywords flow
|
|
248
|
+
|
|
249
|
+
Treat `keywords suggest` as candidate-generation only. It does not change the content plan until you add keywords.
|
|
250
|
+
Treat `keywords generate` as the dashboard Generate Keywords action. It creates scheduled keywords through the same backend pipeline.
|
|
251
|
+
|
|
252
|
+
Before `keywords generate`:
|
|
253
|
+
|
|
254
|
+
- if the human did not specify how many keywords to generate, ask them
|
|
255
|
+
- the allowed range is 5-30, but the real maximum depends on free scheduler slots
|
|
256
|
+
- check `outrank-cli keywords generation-status --product <productId>` when you need the current slot capacity
|
|
257
|
+
|
|
258
|
+
To add keywords:
|
|
259
|
+
|
|
260
|
+
- for direct adds, use `outrank-cli keywords add --product <productId> --json-file keywords.json`
|
|
261
|
+
- for promoting existing stored keywords, include `stored_keyword_ids` in that JSON payload
|
|
262
|
+
|
|
263
|
+
Important behavior to remember:
|
|
264
|
+
|
|
265
|
+
- add is idempotent where possible; existing scheduled keywords come back as existing rather than being duplicated
|
|
266
|
+
- stored keywords are unscheduled inventory, not disabled scheduled keywords
|
|
267
|
+
- stored keywords are read-only inventory; they can be promoted into the plan but not deleted directly
|
|
268
|
+
- auto-scheduling respects the backend's real planner logic, including publish days and pending downgrade limits
|
|
269
|
+
- if keyword generation status says writes are blocked, treat both scheduled and stored keywords as read-only until the blocker clears
|
|
270
|
+
- if the main subscription is `past_due`, keyword mutations are blocked and only reads are allowed
|
|
271
|
+
- scheduled keywords with created or pre-created articles are read-only
|
|
272
|
+
- keywords in `generating_article` are read-only until generation finishes
|
|
273
|
+
- past keywords are read-only except past `scheduled` or `disabled` keywords without an article, which may still be rescheduled
|
|
274
|
+
- if the response reports skipped keywords, explain the actual skip reason to the human instead of pretending the add fully succeeded
|
|
275
|
+
|
|
276
|
+
For schedule changes:
|
|
277
|
+
|
|
278
|
+
- check writability first when there is any doubt: `outrank-cli keywords generation-status --product <productId>`
|
|
279
|
+
- reschedule one: `outrank-cli keywords reschedule <keywordId> --scheduled-for YYYY-MM-DD`
|
|
280
|
+
- reschedule many: `outrank-cli keywords bulk-reschedule --json-file keyword-reschedule.json`
|
|
281
|
+
|
|
282
|
+
For article actions:
|
|
283
|
+
|
|
284
|
+
- `outrank-cli articles generate <keywordId>` is only for keywords scheduled for today
|
|
285
|
+
- `outrank-cli articles precreate <keywordId>` is only for eligible future scheduled keywords
|
|
286
|
+
- trial users cannot pre-create articles
|
|
287
|
+
- past-due subscriptions block article actions
|
|
288
|
+
- future scheduled articles cannot be manually published early through `articles update`
|
|
289
|
+
|
|
290
|
+
For deletion:
|
|
291
|
+
|
|
292
|
+
- delete one: `outrank-cli keywords delete <keywordId>`
|
|
293
|
+
- delete many: `outrank-cli keywords bulk-delete --json-file keyword-delete.json`
|
|
294
|
+
|
|
295
|
+
When answering humans, call the scheduled set the content plan or keyword plan. Call stored keywords unscheduled inventory or stored keywords. Do not talk about internal table names.
|
|
296
|
+
|
|
297
|
+
## Pause and resume
|
|
298
|
+
|
|
299
|
+
Use:
|
|
300
|
+
|
|
301
|
+
- `outrank-cli products pause <productId>`
|
|
302
|
+
- `outrank-cli products resume <productId>`
|
|
303
|
+
|
|
304
|
+
These affect billing-adjacent product state. Read the returned guidance carefully and relay any human-only step.
|
|
305
|
+
|
|
306
|
+
## Article workflow
|
|
307
|
+
|
|
308
|
+
Inspect before mutating:
|
|
309
|
+
|
|
310
|
+
- `outrank-cli articles list --product <productId>`
|
|
311
|
+
- `outrank-cli articles get <articleId>`
|
|
312
|
+
- `outrank-cli articles get-content <articleId>`
|
|
313
|
+
|
|
314
|
+
Important behavior to remember:
|
|
315
|
+
|
|
316
|
+
- article metadata and history mirror the current app behavior, including soft-delete instead of hard-delete
|
|
317
|
+
- article bodies are markdown in the backend; `--format html` is rendered output, not the source of truth
|
|
318
|
+
- featured image is separate from the markdown body and can be updated either through the normal article update payload via `image_url` or by local-file upload with `articles upload-featured-image`
|
|
319
|
+
- in-content images can be uploaded from local files with `articles upload-image`; the command returns a hosted URL and alt text for markdown insertion or replacement
|
|
320
|
+
- per-article instructions live on the linked scheduled keyword, so they are only editable while that planner relationship still exists and is writable
|
|
321
|
+
- slug is readable for reference but read-only in the agent API
|
|
322
|
+
- `articles generate <keywordId>` mirrors the current create-and-publish flow for a scheduled keyword
|
|
323
|
+
- `articles precreate <keywordId>` mirrors the current pre-generation flow; after calling it, inspect the keyword state until it moves from `generating_article` to `pregenerated` or back to `scheduled`
|
|
324
|
+
- `articles retry-publish <articleId>` only works for generated articles with a publish error
|
|
325
|
+
- `articles bulk-replace` is preview-first; review the returned excerpts, then rerun with `"confirm": true` in the JSON payload to write changes
|
|
326
|
+
|
|
327
|
+
## Buying more product slots
|
|
328
|
+
|
|
329
|
+
Always do this in two steps:
|
|
330
|
+
|
|
331
|
+
1. Quote the change: `outrank-cli billing purchase-products quote --additional-products <n>`
|
|
332
|
+
2. If the human approves, submit the purchase with the exact quoted recurring total:
|
|
333
|
+
`outrank-cli billing purchase-products buy --additional-products <n> --confirm-charge-cents <quoted> --idempotency-key <stable-random-key>`
|
|
334
|
+
|
|
335
|
+
Never guess `confirm-charge-cents`. Use the server-quoted number.
|
|
336
|
+
Do not ask for billing approval until you have already clarified the intended product configuration and any defaulted article/publishing settings.
|
|
337
|
+
|
|
338
|
+
## Error handling
|
|
339
|
+
|
|
340
|
+
- If `ok` is `false`, read both `error.message` and `agent_guidance`.
|
|
341
|
+
- For `401`, help the human refresh `OUTRANK_API_KEY`.
|
|
342
|
+
- For `403` or `409`, the guidance usually tells you whether to inspect state, pause another product, or ask the human to approve a billing step.
|
|
343
|
+
- For `402`, stop retrying and ask the human to fix billing.
|
|
344
|
+
|
|
345
|
+
## Current limitation
|
|
346
|
+
|
|
347
|
+
The implementation plan is broader than the current live API. Keywords and core article flows are now exposed in `outrank-cli`, but integrations, backlinks, and onboarding flows are still incomplete. If the user asks for something not present in `outrank-cli --help`, say that exact command surface is not shipped yet and do not invent unsupported commands.
|
|
348
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "outrank-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Agent-first CLI for the Outrank agent API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"bin",
|
|
8
|
+
"src",
|
|
9
|
+
"README.md",
|
|
10
|
+
"SKILL.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"outrank-cli": "./bin/outrank-cli.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "node ./src/index.js",
|
|
18
|
+
"help": "node ./src/index.js --help",
|
|
19
|
+
"link:local": "npm link",
|
|
20
|
+
"unlink:local": "npm unlink -g outrank-cli"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"outrank",
|
|
24
|
+
"cli",
|
|
25
|
+
"agent",
|
|
26
|
+
"seo",
|
|
27
|
+
"content",
|
|
28
|
+
"ai"
|
|
29
|
+
],
|
|
30
|
+
"author": "Outrank SAS",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"homepage": "https://github.com/Outrank-SAS/outrank-cli#readme",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Outrank-SAS/outrank-cli.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Outrank-SAS/outrank-cli/issues"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
}
|
|
46
|
+
}
|