@index365/cli 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/cli.mjs +14 -5
- package/src/client.mjs +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@index365/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "index365 CLI - run AI-readiness and marketing-signal audits and read findings from your terminal, CI, or agents. Wraps the public /api/v1.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/cli.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
writeConfigFile,
|
|
13
13
|
} from "./config.mjs";
|
|
14
14
|
|
|
15
|
-
export const CLI_VERSION = "0.1.
|
|
15
|
+
export const CLI_VERSION = "0.1.2";
|
|
16
16
|
|
|
17
17
|
const HELP = `index365 - website audits from your terminal, CI, or agents
|
|
18
18
|
|
|
@@ -26,13 +26,13 @@ COMMANDS
|
|
|
26
26
|
projects list List projects in your organization
|
|
27
27
|
projects create Create a project (--domain <domain> [--name <name>])
|
|
28
28
|
projects delete Delete a project (<projectId> --confirm <domain>)
|
|
29
|
-
runs start Start a paid AI-readiness audit (--project <id>, optional --wait)
|
|
29
|
+
runs start Start a paid AI-readiness audit (--project <id>, repeatable --page <path>, optional --wait)
|
|
30
30
|
runs get Show one run (<runId>)
|
|
31
31
|
findings list List findings for a run (--run <id>)
|
|
32
32
|
findings get Show one finding (--run <id> <findingId>)
|
|
33
33
|
reports context Compact agent report context for a run (<runId>)
|
|
34
34
|
reports download Download the PDF report to .index365/ (<runId> [--output <file>])
|
|
35
|
-
marketing run Start a Marketing Signal audit (--project <id>, optional --wait)
|
|
35
|
+
marketing run Start a Marketing Signal audit (--project <id>, repeatable --page <path>, optional --wait)
|
|
36
36
|
marketing report Latest Marketing Signal report for a project (--project <id>)
|
|
37
37
|
marketing findings Marketing findings (--run <id> | --project <id>, optional --stage)
|
|
38
38
|
integrations list Connected-signal providers + status (--project <id>)
|
|
@@ -295,11 +295,15 @@ async function cmdRuns(argv, io, env) {
|
|
|
295
295
|
if (sub === "start") {
|
|
296
296
|
const { values } = parse(rest, {
|
|
297
297
|
project: { type: "string" },
|
|
298
|
+
page: { type: "string", multiple: true },
|
|
298
299
|
"idempotency-key": { type: "string" },
|
|
299
300
|
wait: { type: "boolean", default: false },
|
|
300
301
|
});
|
|
301
302
|
if (!values.project) {
|
|
302
|
-
throw new CliError(
|
|
303
|
+
throw new CliError(
|
|
304
|
+
"Usage: index365 runs start --project <projectId> [--page <path> ...] [--wait]",
|
|
305
|
+
EXIT.USAGE,
|
|
306
|
+
);
|
|
303
307
|
}
|
|
304
308
|
return startRunAndMaybeWait(values, io, env, "paid_ai_readiness");
|
|
305
309
|
}
|
|
@@ -426,8 +430,12 @@ async function cmdReports(argv, io, env) {
|
|
|
426
430
|
/** Shared run-start + optional poll loop (AI-readiness and Marketing Signal). */
|
|
427
431
|
async function startRunAndMaybeWait(values, io, env, scanMode) {
|
|
428
432
|
const settings = settingsFor(values, env);
|
|
433
|
+
// `--page` is repeatable (parseArgs multiple:true), so values.page is a
|
|
434
|
+
// string[] of extra same-origin pages to scan beyond the homepage. Omitted =
|
|
435
|
+
// homepage only. The engine resolves/validates same-origin + caps the set.
|
|
436
|
+
const pages = Array.isArray(values.page) ? values.page : [];
|
|
429
437
|
let run = await apiRequest(settings, "POST", "/api/v1/runs", {
|
|
430
|
-
body: { projectId: values.project, scanMode },
|
|
438
|
+
body: { projectId: values.project, scanMode, ...(pages.length ? { pages } : {}) },
|
|
431
439
|
idempotencyKey: values["idempotency-key"],
|
|
432
440
|
fetchImpl: io.fetch,
|
|
433
441
|
});
|
|
@@ -461,6 +469,7 @@ async function cmdMarketing(argv, io, env) {
|
|
|
461
469
|
if (sub === "run") {
|
|
462
470
|
const { values } = parse(rest, {
|
|
463
471
|
project: { type: "string" },
|
|
472
|
+
page: { type: "string", multiple: true },
|
|
464
473
|
"idempotency-key": { type: "string" },
|
|
465
474
|
wait: { type: "boolean", default: false },
|
|
466
475
|
});
|
package/src/client.mjs
CHANGED
|
@@ -50,8 +50,14 @@ export async function apiRequest(settings, method, apiPath, options = {}) {
|
|
|
50
50
|
|
|
51
51
|
const headers = {
|
|
52
52
|
authorization: `Bearer ${settings.apiKey}`,
|
|
53
|
-
"user-agent": "index365-cli/0.1.
|
|
53
|
+
"user-agent": "index365-cli/0.1.2",
|
|
54
54
|
};
|
|
55
|
+
// Optional source tag so a wrapping skill can attribute its traffic
|
|
56
|
+
// (e.g. INDEX365_CLIENT=skill/index365-audit-and-fix). The server validates it.
|
|
57
|
+
const clientTag = process.env.INDEX365_CLIENT;
|
|
58
|
+
if (typeof clientTag === "string" && clientTag.trim()) {
|
|
59
|
+
headers["x-index365-client"] = clientTag.trim();
|
|
60
|
+
}
|
|
55
61
|
if (body !== undefined) headers["content-type"] = "application/json";
|
|
56
62
|
if (idempotencyKey) headers["idempotency-key"] = idempotencyKey;
|
|
57
63
|
|