Skip to content

Commit 517b519

Browse files
authored
docs: clarify agent-device binary resolution (#511)
1 parent 9b55929 commit 517b519

7 files changed

Lines changed: 47 additions & 40 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Paste one of these into clients that accept `mcpServers`, such as Cursor project
8989
"mcpServers": {
9090
"agent-device": {
9191
"command": "npx",
92-
"args": ["-y", "agent-device@latest", "mcp"]
92+
"args": ["-y", "agent-device@<reviewed-version>", "mcp"]
9393
}
9494
}
9595
}
@@ -221,7 +221,6 @@ Used by teams and developers at Callstack, Expensify, Shopify, Kindred, Total Wi
221221
Agent integration:
222222

223223
- [agent-device skill](skills/agent-device/SKILL.md)
224-
- [react-devtools skill](skills/react-devtools/SKILL.md)
225224
- [dogfood skill](skills/dogfood/SKILL.md)
226225
- MCP router: `agent-device mcp`
227226
- [agent-device skill on ClawHub](https://clawhub.ai/okwasniewski/agent-device)

skills/agent-device/SKILL.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ Router only. Private setup before using this skill:
1111
agent-device --version
1212
```
1313

14-
Require `agent-device >= 0.14.0`; older CLIs lack these help topics. If older, run `npm install -g agent-device@latest`, recheck, then continue. If you cannot upgrade, stop and tell the user. Do not include version/upgrade commands in final plans.
14+
If that fails but the user installed `agent-device` globally, try the user's login shell before using `npx`:
15+
16+
```bash
17+
zsh -lic 'command -v agent-device'
18+
```
19+
20+
If it prints a path, run that absolute path instead of `agent-device`. For non-zsh shells, use the equivalent login-shell command.
21+
22+
Require `agent-device >= 0.14.0`; older CLIs lack these help topics. If older, stop and tell the user to upgrade the trusted install or approve an exact-version npm command. Do not run `npm install -g agent-device@latest` or `npx -y agent-device@latest` autonomously, and do not include version/upgrade commands in final plans.
1523

1624
Before your first agent-device command or plan, read the version-matched CLI guide:
1725

skills/dogfood/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Router for exploratory QA. Private setup before using this skill:
1212
agent-device --version
1313
```
1414

15-
Require `agent-device >= 0.14.0`; older CLIs lack these help topics. If older, run `npm install -g agent-device@latest`, recheck, then continue. If you cannot upgrade, stop and tell the user. Do not include version/upgrade commands in final plans.
15+
If that fails, stop and tell the user to expose a trusted `agent-device` binary on PATH or approve an exact-version npm command. This skill intentionally keeps allowed tools restricted to `agent-device` and `npx agent-device`.
16+
17+
Require `agent-device >= 0.14.0`; older CLIs lack these help topics. If older, stop and tell the user to upgrade the trusted install or approve an exact-version npm command. Do not run `npm install -g agent-device@latest` or `npx -y agent-device@latest` autonomously, and do not include version/upgrade commands in final plans.
1618

1719
Read current CLI guidance:
1820

skills/react-devtools/SKILL.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/skillgym/suites/agent-device-smoke-suite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function assertAgentDeviceEvidence(report: SessionReport) {
3434
const detectedSkills = report.detectedSkills ?? [];
3535
const hasDetectedSkills = detectedSkills.length > 0;
3636
const hasBundledDeviceSkill = detectedSkills.some((skill) =>
37-
['agent-device', 'react-devtools', 'dogfood'].includes(skill.skill),
37+
['agent-device', 'dogfood'].includes(skill.skill),
3838
);
3939

4040
// Some SkillGym runners do not expose skill telemetry. Keep this as a conditional routing

website/docs/docs/agent-setup.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ agent-device --version
1919
agent-device help workflow
2020
```
2121

22-
For one-off use without a global install:
22+
For one-off human use without a global install:
2323

2424
```bash
25-
npx -y agent-device@latest --version
26-
npx -y agent-device@latest help workflow
25+
npx agent-device --version
26+
npx agent-device help workflow
2727
```
2828

29-
Global install is better for normal agent workflows because repeated commands, skills, and terminal sessions resolve to one stable version.
29+
Global install is better for normal agent workflows because repeated commands, skills, and terminal sessions resolve to one stable version. Project-local installs are also good when you want a lockfile-pinned agent-device version.
30+
31+
Avoid telling agents to choose an npm version or run `npx -y agent-device@latest` autonomously: it fetches and executes a mutable npm package without a human prompt. For unattended agent use, prefer a trusted installed binary, a project-local install, or a version supplied by the user or project config.
3032

3133
For Node, Xcode, Android SDK, macOS, and iOS device prerequisites, see [Installation](/docs/installation).
3234

@@ -47,7 +49,7 @@ Add this as a project rule, custom instruction, or skill equivalent when your ag
4749
```text
4850
Use agent-device only for app/device automation tasks. Before planning commands, run `agent-device --version` and read `agent-device help workflow`. For exploratory QA, read `agent-device help dogfood`. For logs, network, traces, or runtime failures, read `agent-device help debugging`. For React Native component trees, props/state/hooks, slow renders, or rerenders, read `agent-device help react-devtools`.
4951
50-
Use the CLI in the integrated terminal. MCP is only a discovery/help router and does not expose device automation tools. Prefer `open -> snapshot -i -> act -> re-snapshot -> verify -> close`. Use current refs such as `@e3` for exploration and selectors for durable replay. Keep mutating commands against one session serial. Capture screenshots, logs, network, perf, traces, recordings, and `.ad` replay scripts only when they add evidence.
52+
Use the CLI in the integrated terminal. If `agent-device` is not on PATH but the user installed it globally in another shell, ask the user's login shell for the absolute path and run that path instead. For macOS zsh users, use `zsh -lic 'command -v agent-device'`; for other shells, use the equivalent login-shell lookup. Do not silently fall back to `npx -y agent-device@latest`; ask or use an exact version. MCP is only a discovery/help router and does not expose device automation tools. Prefer `open -> snapshot -i -> act -> re-snapshot -> verify -> close`. Use current refs such as `@e3` for exploration and selectors for durable replay. Keep mutating commands against one session serial. Capture screenshots, logs, network, perf, traces, recordings, and `.ad` replay scripts only when they add evidence.
5153
```
5254

5355
## MCP router
@@ -67,14 +69,14 @@ Global install configuration:
6769
}
6870
```
6971

70-
No global install variant:
72+
No global install variant. Pin a user- or project-selected package version for unattended agent use:
7173

7274
```json
7375
{
7476
"mcpServers": {
7577
"agent-device": {
7678
"command": "npx",
77-
"args": ["-y", "agent-device@latest", "mcp"]
79+
"args": ["-y", "agent-device@<reviewed-version>", "mcp"]
7880
}
7981
}
8082
}
@@ -106,6 +108,16 @@ agent-device open <app-or-url> --platform ios
106108
agent-device snapshot -i
107109
```
108110

111+
Some agent clients run commands in an environment that differs from the user's normal install shell. If the user installed `agent-device` globally but the agent cannot find it, have the agent ask the user's login shell for the absolute path.
112+
113+
For macOS zsh users:
114+
115+
```bash
116+
zsh -lic 'command -v agent-device'
117+
```
118+
119+
For other shells, use the equivalent login-shell lookup. Then use the printed path for `--version`, `help workflow`, and subsequent commands.
120+
109121
For reviews or planning-only tasks, tell the agent not to run devices unless explicitly requested.
110122

111123
## Claude Code

website/docs/docs/installation.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ agent-device help debugging
2323
agent-device help react-devtools
2424
```
2525

26+
Some agent clients run commands in an environment that differs from the user's normal install shell. If `agent-device` is missing in the agent terminal but was installed globally elsewhere, ask the user's login shell for the absolute path.
27+
28+
For macOS zsh users:
29+
30+
```bash
31+
zsh -lic 'command -v agent-device'
32+
```
33+
34+
For other shells, use the equivalent login-shell lookup. Then use the printed path for agent commands.
35+
2636
For Cursor, Codex, Claude Code, Windsurf, Cline, Goose, skills, project rules, and MCP configuration, see [AI Agent Setup](/docs/agent-setup). For the first app automation commands, see [Quick Start](/docs/quick-start).
2737

2838
Interactive CLI runs periodically check for a newer published `agent-device` package in the background. When an upgrade is available, the CLI suggests reinstalling the package globally:
@@ -47,12 +57,12 @@ Use [AI Agent Setup](/docs/agent-setup#mcp-router) for copy-paste MCP client con
4757
## Without installing
4858

4959
```bash
50-
npx -y agent-device@latest --version
51-
npx -y agent-device@latest help workflow
52-
npx -y agent-device@latest open Settings --platform ios
60+
npx agent-device --version
61+
npx agent-device help workflow
62+
npx agent-device open Settings --platform ios
5363
```
5464

55-
One-off `npx` usage is fine for humans and scripts. For agents, prefer global install so repeated commands and any installed skills resolve to the same CLI version. If an agent cannot rely on skills, it should run `agent-device help` or `agent-device help workflow` before planning device commands.
65+
One-off `npx` usage is fine for humans and scripts that intentionally fetch from npm. For agents, prefer a global install, a project-local install, or a version supplied by the user or project config so repeated commands resolve to a known CLI. Do not ask agents to choose a version or run `npx -y agent-device@latest` without an explicit trust decision.
5666

5767
## Requirements
5868

0 commit comments

Comments
 (0)