Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ export async function runInit(options: InitOptions): Promise<number> {
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;
}
3 changes: 2 additions & 1 deletion tests/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
1 change: 1 addition & 0 deletions tests/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Loading