phyll 0.4.4 → 0.4.5

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/README.md CHANGED
@@ -10,12 +10,12 @@ The AI work runs in your agent, on your own plan. This package adds the browser,
10
10
 
11
11
  ```bash
12
12
  npx phyll signup you@example.com
13
- npx phyll setup codex # or: npx phyll setup claude
13
+ npx phyll setup codex # or claude, cursor, windsurf, gemini
14
14
  ```
15
15
 
16
16
  Then ask your agent: "review my app at http://localhost:3000".
17
17
 
18
- `setup` registers the connector in Codex's `config.toml` or with `claude mcp add`, and installs the Chromium build it uses. You need Node 20 or newer.
18
+ `setup` registers the connector in Codex's `config.toml`, with `claude mcp add`, or in the `mcpServers` of Cursor's `~/.cursor/mcp.json`, Windsurf's `~/.codeium/windsurf/mcp_config.json` or Gemini CLI's `~/.gemini/settings.json`, keeping everything else in the file. It also installs the Chromium build the connector uses. For any other agent that takes MCP servers, `npx phyll setup other` prints the entry to paste. You need Node 20 or newer.
19
19
 
20
20
  Your reports, keys and plan are also on the site: `npx phyll account` opens your account there, already signed in. If you lose the key, sign in at [agentphyll.com/login](https://agentphyll.com/login) with your email and create a new one.
21
21
 
@@ -25,12 +25,12 @@ Your reports, keys and plan are also on the site: `npx phyll account` opens your
25
25
  | --- | --- |
26
26
  | `signup <email>` | Create a free account, with 5 full reviews. The key is saved in `~/.phyll` |
27
27
  | `login <key>` | Use an account you already have on this computer |
28
- | `setup codex` or `setup claude` | Connect Phyll to your agent and install the browser |
28
+ | `setup <agent>` | Connect Phyll to `codex`, `claude`, `cursor`, `windsurf` or `gemini` and install the browser; `setup other` prints the settings for any other agent |
29
29
  | `status` | Your plan and the reviews left |
30
30
  | `account` | Open your account on agentphyll.com, already signed in: reports, usage, keys and plan |
31
31
  | `pro` | Subscribe to Phyll Pro, R$ 9 a month, with unlimited reviews |
32
32
  | `billing` | Change the card or cancel Phyll Pro |
33
- | `scan [folder]` | Scan the source for AI tells, with no account and no AI |
33
+ | `scan [folder]` | Scan the source for AI tells, with no account and no AI. `--format json` for scripts, `--format badge` for a README badge |
34
34
  | `mcp` | Run the connector for your agent; `setup` registers it for you |
35
35
  | `logout` | Forget the key on this computer |
36
36
 
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "phyll",
3
- "version": "0.4.4",
4
- "description": "UX review for apps built with AI, inside the agent you already use. Connects Codex or Claude Code to the Phyll engine; the AI work stays on your own plan.",
3
+ "version": "0.4.5",
4
+ "description": "UX review for apps built with AI, inside the agent you already use. Connects Codex, Claude Code, Cursor, Windsurf or Gemini CLI to the Phyll engine; the AI work stays on your own plan.",
5
+ "mcpName": "io.github.carlosphyll/phyll",
5
6
  "license": "MIT",
6
7
  "type": "module",
7
8
  "homepage": "https://github.com/carlosphyll/phyll",
@@ -14,8 +15,12 @@
14
15
  "ux",
15
16
  "ux-review",
16
17
  "mcp",
18
+ "mcp-server",
17
19
  "codex",
18
20
  "claude-code",
21
+ "cursor",
22
+ "windsurf",
23
+ "gemini-cli",
19
24
  "ai",
20
25
  "vibe-coding"
21
26
  ],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.4",
2
+ "version": "0.4.5",
3
3
  "tells": [
4
4
  {
5
5
  "id": "P01",
@@ -1636,6 +1636,17 @@
1636
1636
  "<input className=\"focus:outline-none focus:ring-2\" />"
1637
1637
  ]
1638
1638
  }
1639
+ },
1640
+ {
1641
+ "id": "S07",
1642
+ "name": "No results that look like an empty list",
1643
+ "dimension": "states",
1644
+ "kind": "function",
1645
+ "severity": "major",
1646
+ "weight": 2,
1647
+ "cap": 1,
1648
+ "detection": "dynamic",
1649
+ "summary": "A search or filter that matches nothing shows the same screen as a list with nothing in it, or gives no way to clear it, so people think their data is gone or get stuck."
1639
1650
  }
1640
1651
  ]
1641
1652
  }
@@ -1,3 +1,3 @@
1
1
  // Single source for the tool name and version used in scan output and reports.
2
2
  export const NAME = "phyll";
3
- export const VERSION = "0.4.4";
3
+ export const VERSION = "0.4.5";
@@ -90,7 +90,7 @@ export function formatText(result) {
90
90
  const row = (t) => {
91
91
  const where = t.locations[0] ? `${t.locations[0].file}:${t.locations[0].line}` : "";
92
92
  const name = t.name.length > width ? t.name.slice(0, width - 1) + "." : t.name.padEnd(width);
93
- return ` ${t.id} ${name} ${String(t.hits).padStart(3)} hits ${where}`;
93
+ return ` ${t.id} ${name} ${String(t.hits).padStart(3)} ${t.hits === 1 ? "hit " : "hits"} ${where}`;
94
94
  };
95
95
 
96
96
  if (functionTells.length === 0) lines.push("No tells that get in the way of use were found in the source.");
package/src/cli.mjs CHANGED
@@ -1,25 +1,29 @@
1
1
  // phyll: the commands a person types. The review itself happens inside their agent, through
2
2
  // the MCP server that `phyll mcp` runs and `phyll setup` registers.
3
3
  import { spawn } from "node:child_process";
4
- import { hostname } from "node:os";
4
+ import { homedir, hostname } from "node:os";
5
+ import { join } from "node:path";
5
6
  import { parseArgs } from "node:util";
6
7
  import { clearCredentials, credentialsPath, loadCredentials, saveCredentials } from "./credentials.mjs";
7
8
  import { engineClient } from "./engine.mjs";
8
9
  import { importSkill, VERSION } from "./paths.mjs";
9
- import { ensureBrowser, mcpCommand, registerClaude, writeCodexConfig } from "./setup.mjs";
10
+ import { ensureBrowser, JSON_AGENTS, mcpCommand, mcpJson, registerClaude, writeCodexConfig, writeJsonConfig } from "./setup.mjs";
11
+
12
+ const AGENTS = ["codex", "claude", ...Object.keys(JSON_AGENTS)];
10
13
 
11
14
  export const HELP = `Phyll ${VERSION}: UX review for apps built with AI, inside the agent you already use.
12
15
 
13
16
  Get started:
14
17
  npx phyll signup you@example.com Create a free account; the key is saved on this computer
15
- npx phyll setup codex Connect Phyll to Codex (or: npx phyll setup claude)
18
+ npx phyll setup codex Connect Phyll to Codex (or claude, cursor, windsurf, gemini)
16
19
  Then ask your agent: review my app at http://localhost:3000
17
20
 
18
21
  Commands:
19
22
  signup <email> Create a free account, with free full reviews
20
23
  login Use your account on this computer: allow it in the browser
21
24
  login <key> Or use it with a key
22
- setup <agent> Connect Phyll to codex or claude, and install the browser it uses
25
+ setup <agent> Connect Phyll to codex, claude, cursor, windsurf or gemini, and install the
26
+ browser it uses. setup other prints the settings for any agent with MCP
23
27
  status Your plan and the reviews left
24
28
  account Open your account on the site, signed in: reports, keys and plan
25
29
  pro Subscribe to Phyll Pro
@@ -28,7 +32,7 @@ Commands:
28
32
  mcp Run the connector for your agent (setup registers it for you)
29
33
  logout Forget the key on this computer
30
34
 
31
- Options: --server <address> for signup and login, --lang <code> for signup, --format json for scan.
35
+ Options: --server <address> for signup and login, --lang <code> for signup, --format json or badge for scan.
32
36
 
33
37
  The AI work runs in your agent, on your own plan. Phyll's engine sends the method and keeps the reports.
34
38
  Every command, with examples: https://agentphyll.com/commands
@@ -53,6 +57,23 @@ function options(args, spec) {
53
57
  return parseArgs({ args, allowPositionals: true, strict: true, options: spec });
54
58
  }
55
59
 
60
+ // After a scan: the full review, which sees what the source cannot show, and the badge once the
61
+ // index is low enough to show off.
62
+ export function scanNext(index) {
63
+ const lines = [
64
+ "",
65
+ "Next: a full review opens the app as a first-time user, checks these hints along with what",
66
+ "only the running app shows, and can fix what it finds without changing your design.",
67
+ " npx phyll setup codex (or claude, cursor, windsurf, gemini)",
68
+ " then ask your agent: review my app at http://localhost:3000",
69
+ ];
70
+ if (index !== null && index !== undefined && index <= 25) lines.push("Show the index in your README: npx phyll scan --format badge");
71
+ return `${lines.join("\n")}\n`;
72
+ }
73
+
74
+ // A README badge with the static index. The engine draws it, and it links to Phyll.
75
+ export const badgeMarkdown = (index, server) => `[![Phyll AI tell index: ${index}/100](${server}/badge/index/${index}.svg)](${server})`;
76
+
56
77
  export async function main(argv, io = {}) {
57
78
  const out = io.stdout ?? process.stdout;
58
79
  const err = io.stderr ?? process.stderr;
@@ -111,7 +132,7 @@ export async function main(argv, io = {}) {
111
132
  const answer = await client(server, null).signup(positionals[0], values.lang ?? guessLanguage());
112
133
  if (!answer.ok) return fail(answer.json.message ?? `Phyll answered ${answer.status}.`);
113
134
  const path = saveCredentials({ server, key: answer.json.key }, env);
114
- write(`${answer.json.message}\nYour key, shown only now: ${answer.json.key}\nIt is saved in ${path}.\n\nNext, connect Phyll to your agent:\n npx phyll setup codex\n npx phyll setup claude\n`);
135
+ write(`${answer.json.message}\nYour key, shown only now: ${answer.json.key}\nIt is saved in ${path}.\n\nNext, connect Phyll to your agent:\n npx phyll setup codex (or claude, cursor, windsurf, gemini)\n`);
115
136
  return 0;
116
137
  }
117
138
 
@@ -169,18 +190,30 @@ export async function main(argv, io = {}) {
169
190
 
170
191
  case "setup": {
171
192
  const agent = rest[0];
172
- if (!["codex", "claude"].includes(agent)) return fail("say which agent to connect: npx phyll setup codex, or npx phyll setup claude", 2);
193
+ if (![...AGENTS, "other"].includes(agent)) {
194
+ return fail("say which agent to connect: npx phyll setup codex, claude, cursor, windsurf or gemini. For any other agent with MCP: npx phyll setup other", 2);
195
+ }
173
196
  const command = io.mcpCommand ?? mcpCommand();
174
197
  if (agent === "codex") {
175
198
  const file = writeCodexConfig(command, env);
176
199
  write(`Phyll is connected to Codex in ${file}. Restart Codex so it loads the connector.\n`);
177
- } else {
200
+ } else if (agent === "claude") {
178
201
  const result = registerClaude(command, io.run);
179
202
  write(
180
203
  result.ok
181
204
  ? "Phyll is connected to Claude Code. Start a new session so it loads the connector.\n"
182
205
  : `Claude Code was not found on this computer. Run this where it is installed:\n ${result.manual}\n`,
183
206
  );
207
+ } else if (agent === "other") {
208
+ write(`Add Phyll to your agent's MCP servers, then restart the agent:\n${mcpJson(command)}\n`);
209
+ } else {
210
+ const { name, path } = JSON_AGENTS[agent];
211
+ const file = join(io.home ?? homedir(), ...path);
212
+ write(
213
+ writeJsonConfig(file, command)
214
+ ? `Phyll is connected to ${name} in ${file}. Restart ${name} so it loads the connector.\n`
215
+ : `${file} is not plain JSON, so Phyll left it as it was. Add this to its mcpServers, then restart ${name}:\n${mcpJson(command)}\n`,
216
+ );
184
217
  }
185
218
  if (!(await (io.ensureBrowser ?? ensureBrowser)({ write }))) return fail("the browser could not be installed. Run: npx playwright install chromium");
186
219
  write(
@@ -193,9 +226,14 @@ export async function main(argv, io = {}) {
193
226
 
194
227
  case "scan": {
195
228
  const { values, positionals } = options(rest, { format: { type: "string" } });
229
+ const format = values.format ?? "text";
230
+ if (!["text", "json", "badge"].includes(format)) return fail("the format is text, json or badge", 2);
196
231
  const { scan, formatText } = await importSkill("scripts/scan.mjs");
197
232
  const result = scan(positionals[0] ?? cwd);
198
- write(values.format === "json" ? `${JSON.stringify(result, null, 2)}\n` : formatText(result));
233
+ if (format === "json") write(`${JSON.stringify(result, null, 2)}\n`);
234
+ else if (format === "text") write(`${formatText(result)}${scanNext(result.staticIndex)}`);
235
+ else if (result.staticIndex === null) return fail("there is no index to show: the scan found no files it reads");
236
+ else write(`${badgeMarkdown(result.staticIndex, loadCredentials(env).server)}\n`);
199
237
  return 0;
200
238
  }
201
239
 
package/src/review.mjs CHANGED
@@ -100,7 +100,7 @@ export class Connector {
100
100
  await session.start();
101
101
  } catch (error) {
102
102
  const missing = /Executable doesn't exist|playwright install/i.test(error?.message ?? "");
103
- throw new Error(missing ? "the browser is not installed. Ask the person to run npx phyll setup codex (or claude) once." : `the browser did not start: ${error.message}`);
103
+ throw new Error(missing ? "the browser is not installed. Ask the person to run npx phyll setup once, with the name of their agent, such as npx phyll setup codex." : `the browser did not start: ${error.message}`);
104
104
  }
105
105
  review.browser = session;
106
106
  }
package/src/setup.mjs CHANGED
@@ -1,5 +1,6 @@
1
- // Connects Phyll to the person's agent: an MCP server entry in Codex's config.toml, or a
2
- // `claude mcp add` for Claude Code, and the Chromium build Playwright needs.
1
+ // Connects Phyll to the person's agent: an MCP server entry in Codex's config.toml, a
2
+ // `claude mcp add` for Claude Code, or an entry in the JSON file Cursor, Windsurf or Gemini CLI
3
+ // read, and the Chromium build Playwright needs.
3
4
  import { spawnSync } from "node:child_process";
4
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
6
  import { createRequire } from "node:module";
@@ -43,6 +44,38 @@ export function writeCodexConfig(command, env = process.env) {
43
44
  return file;
44
45
  }
45
46
 
47
+ // Agents that keep their MCP servers under "mcpServers" in a JSON file in the home folder.
48
+ export const JSON_AGENTS = {
49
+ cursor: { name: "Cursor", path: [".cursor", "mcp.json"] },
50
+ windsurf: { name: "Windsurf", path: [".codeium", "windsurf", "mcp_config.json"] },
51
+ gemini: { name: "Gemini CLI", path: [".gemini", "settings.json"] },
52
+ };
53
+
54
+ const serverEntry = (command) => ({ command: command[0], args: command.slice(1) });
55
+
56
+ // The entry to paste into the MCP settings of any other agent.
57
+ export const mcpJson = (command) => JSON.stringify({ mcpServers: { phyll: serverEntry(command) } }, null, 2);
58
+
59
+ // Adds phyll to mcpServers and keeps the rest of the file as it was. A file that is not plain
60
+ // JSON, such as one with comments, is left alone and the caller shows the entry to paste.
61
+ export function writeJsonConfig(file, command) {
62
+ let config = {};
63
+ if (existsSync(file)) {
64
+ const text = readFileSync(file, "utf8").replace(String.fromCharCode(0xfeff), "").trim();
65
+ try {
66
+ config = text ? JSON.parse(text) : {};
67
+ } catch {
68
+ return false;
69
+ }
70
+ if (!config || typeof config !== "object" || Array.isArray(config)) return false;
71
+ }
72
+ const servers = config.mcpServers && typeof config.mcpServers === "object" && !Array.isArray(config.mcpServers) ? config.mcpServers : {};
73
+ config.mcpServers = { ...servers, phyll: serverEntry(command) };
74
+ mkdirSync(dirname(file), { recursive: true });
75
+ writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`);
76
+ return true;
77
+ }
78
+
46
79
  const quote = (arg) => (/[\s"]/.test(arg) ? `"${arg.replaceAll('"', '\\"')}"` : arg);
47
80
 
48
81
  export function registerClaude(command, run = spawnSync) {