# tauri-agent
Headless agent debugger for Tauri apps.
`tauri-agent` is a protocol-first control surface for agents that need to
inspect, drive, and debug live Tauri applications. One JSON-RPC 2.0 method set —
semantic tree snapshots, `@ref` actions, input synthesis, screenshots, logs /
events / network / IPC capture, dialogs, waiters, and recording — reachable from
a CLI, an MCP server, guest helpers, and Rust commands, all routing into a
single bridge inside the instrumented webview.
```bash
# drive a running app the CLI discovers by app id
tauri-agent tree --app dev.byeongsu.tauri-agent.fixture
tauri-agent find --role button --name Forge --app dev.byeongsu.tauri-agent.fixture
tauri-agent click @3 --app dev.byeongsu.tauri-agent.fixture
```
## Quickstart
1. **Register the plugin** in `src-tauri`:
```rust
tauri::Builder::default()
.plugin(tauri_agent_plugin::init())
.run(tauri::generate_context!())?;
```
2. **Grant the permission** in `src-tauri/capabilities/*.json`
(`{ "permissions": ["core:default", "agent:default"] }`).
3. **Install the guest instrumentation** in your frontend — bridge commands hang
until it runs:
```ts
import { WebviewAgentInstrumentation } from '@byeongsu-hong/tauri-agent-plugin'
new WebviewAgentInstrumentation({ windowLabel: 'main' }).install()
```
4. **Enable the inline server** in `tauri.conf.json` for out-of-process control.
5. **Verify:** `tauri-agent attach --app <your.app.identifier>`.
Full walkthrough → **[docs/adopting.md](./docs/adopting.md)**.
## Documentation
- **[docs/adopting.md](./docs/adopting.md)** — wire the plugin into your app,
inline server, VNC advertising, the fixture, fresh-clone build order.
- **[docs/commands.md](./docs/commands.md)** — every method: CLI form, MCP tool,
and bridge behavior in one table.
- **[docs/architecture.md](./docs/architecture.md)** — components, request flow,
transports, the two surfaces, screenshot support matrix, multi-webview.
- **[docs/security.md](./docs/security.md)** — token auth, loopback/release
gating, the permission model, error taxonomy.
- **[permissions/autogenerated/reference.md](./permissions/autogenerated/reference.md)**
— the generated permission reference.
## MCP
```bash
tauri-agent-mcp
```
Exposes the protocol as `tauri_<method>` stdio tools, each accepting the same
connection inputs as the CLI (`app`, `port`/`host`, or `html`/`fromHtml`). See
[docs/commands.md](./docs/commands.md).
## Develop
```bash
bun install
bun run build # produces dist-js (the fixture imports it)
bun run check # typecheck + vitest + build
bun run check:rust # cargo fmt --check + clippy -D warnings + test
```
The `examples/fixture-app` is the first real live-bridge target and ships a
headless `--self-test` mode exercised in CI.
## License
MIT OR Apache-2.0.