diff --git a/src/cli.ts b/src/cli.ts index ac1ac74..7a32cc6 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -28,9 +28,11 @@ Init options --force Overwrite an existing file Examples - npx @nhtanvir/pollen check example.com - npx @nhtanvir/pollen check https://example.com --json - npx @nhtanvir/pollen check ./public/.well-known/poppy.json + pollen check example.com + pollen check https://example.com --json + pollen check ./public/.well-known/poppy.json + +Run it without installing: npx github:NHTanvir/pollen check example.com Exit codes: 0 = passed, 1 = failed, 2 = usage error. Spec: https://personalagentprotocol.org/docs/1.0/spec#discovery diff --git a/src/demo.ts b/src/demo.ts index 8116894..3aff75b 100644 --- a/src/demo.ts +++ b/src/demo.ts @@ -76,6 +76,6 @@ export function runDemo(options: { color: boolean; write: (text: string) => void return 1; } out(`All ${total} examples behaved as expected. Now check your own site:`); - out(` npx @nhtanvir/pollen check your-domain.com`); + out(` npx github:NHTanvir/pollen check your-domain.com`); return 0; } diff --git a/src/init.ts b/src/init.ts index bce5380..8c4bcb3 100644 --- a/src/init.ts +++ b/src/init.ts @@ -199,9 +199,9 @@ export async function runInit(options: InitOptions): Promise { say(` 2. Publish https://${answers.domain}${PROTECTED_RESOURCE_PATH}:`); say(` { "resource": "https://${answers.domain}", "authorization_servers": ["${answers.issuer}"] }`); say(` and list "https://${answers.domain}" in your issuer's protected_resources.`); - say(` 3. Check it: npx @nhtanvir/pollen check ${answers.domain}`); + say(` 3. Check it: npx github:NHTanvir/pollen check ${answers.domain}`); } else { - say(` 2. Check it: npx @nhtanvir/pollen check ${answers.domain}`); + say(` 2. Check it: npx github:NHTanvir/pollen check ${answers.domain}`); } return report.ok ? 0 : 1; } diff --git a/tests/cli.test.ts b/tests/cli.test.ts index 17c4cbb..6229e57 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -52,7 +52,8 @@ describe("pollen", () => { it("--help lists every command and exits 0", async () => { const { code, stdout } = await run(["--help"]); assert.equal(code, 0); - for (const text of ["pollen check", "pollen init", "pollen demo", "--json", "--skip-oauth"]) assert.ok(stdout.includes(text), text); + for (const text of ["pollen check", "pollen init", "pollen demo", "--json", "--skip-oauth", "npx github:NHTanvir/pollen"]) assert.ok(stdout.includes(text), text); + assert.ok(!stdout.includes("@nhtanvir/pollen"), "help must not point to an unpublished npm package"); }); it("exits 2 with usage when there's no command, an unknown command, or a bad flag", async () => { diff --git a/tests/init.test.ts b/tests/init.test.ts index 8646083..3dc3dbe 100644 --- a/tests/init.test.ts +++ b/tests/init.test.ts @@ -178,6 +178,7 @@ describe("runInit", () => { assert.equal(validateDocument(readFileSync(out, "utf8"), { servedHost: "orbit.example" }).score, 100); assert.match(output.text(), /score 100\/100/); assert.match(output.text(), /Serve it at https:\/\/orbit\.example\/\.well-known\/poppy\.json/); + assert.match(output.text(), /npx github:NHTanvir\/pollen check orbit\.example/); }); it("won't overwrite a file without --force", async () => {