chrome-devtools-axi 0.1.1 → 0.1.3

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
@@ -1,9 +1,13 @@
1
- # chrome-devtools-axi
1
+ <h1 align="center">chrome-devtools-axi</h1>
2
2
 
3
- [![CI](https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/ci.yml/badge.svg)](https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/ci.yml)
4
- [![Release](https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/release-please.yml/badge.svg)](https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/release-please.yml)
5
- ![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue)
6
- [![X](https://img.shields.io/badge/X-@kunchenguid-black?logo=x)](https://x.com/kunchenguid)
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/chrome-devtools-axi"><img alt="npm" src="https://img.shields.io/npm/v/chrome-devtools-axi?style=flat-square" /></a>
5
+ <a href="https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/kunchenguid/chrome-devtools-axi/ci.yml?style=flat-square&label=CI" /></a>
6
+ <a href="https://github.com/kunchenguid/chrome-devtools-axi/actions/workflows/release-please.yml"><img alt="Release" src="https://img.shields.io/github/actions/workflow/status/kunchenguid/chrome-devtools-axi/release-please.yml?style=flat-square&label=Release" /></a>
7
+ <a href="#"><img alt="Platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square" /></a>
8
+ <a href="https://x.com/kunchenguid"><img alt="X" src="https://img.shields.io/badge/X-@kunchenguid-black?style=flat-square" /></a>
9
+ <a href="https://discord.gg/BW4aJuQhTf"><img alt="Discord" src="https://img.shields.io/discord/1439901831038763092?style=flat-square&label=discord" /></a>
10
+ </p>
7
11
 
8
12
  <h3 align="center">Highly agent-ergonomic browser automation</h3>
9
13
 
@@ -34,19 +38,10 @@ snapshot:
34
38
 
35
39
  ## Install
36
40
 
37
- **npm**
41
+ **Tell your agent:**
38
42
 
39
- ```sh
40
- npm install -g chrome-devtools-axi
41
43
  ```
42
-
43
- **From source**
44
-
45
- ```sh
46
- git clone https://github.com/kunchenguid/chrome-devtools-axi.git
47
- cd chrome-devtools-axi
48
- npm install && npm run build
49
- npm link
44
+ Execute `npm i -g chrome-devtools-axi` and run `chrome-devtools-axi` for browser automation.
50
45
  ```
51
46
 
52
47
  ## How It Works
@@ -74,28 +69,103 @@ npm link
74
69
 
75
70
  ## CLI Reference
76
71
 
77
- | Command | Description |
78
- | -------------------- | ----------------------------------- |
79
- | `open <url>` | Navigate to URL and snapshot |
80
- | `snapshot` | Capture current page state |
81
- | `click @<uid>` | Click an element by ref |
82
- | `fill @<uid> <text>` | Fill a form field |
83
- | `type <text>` | Type text at current focus |
84
- | `press <key>` | Press a keyboard key |
85
- | `scroll <dir>` | Scroll: up, down, top, bottom |
86
- | `back` | Navigate back |
87
- | `wait <ms\|text>` | Wait for time or text to appear |
88
- | `eval <js>` | Evaluate JavaScript in page context |
89
- | `start` | Start the bridge server |
90
- | `stop` | Stop the bridge server |
72
+ ### Navigation
73
+
74
+ | Command | Description |
75
+ | ----------------- | ----------------------------------- |
76
+ | `open <url>` | Navigate to URL and snapshot |
77
+ | `snapshot` | Capture current page state |
78
+ | `screenshot <p>` | Save a screenshot to a file |
79
+ | `scroll <dir>` | Scroll: up, down, top, bottom |
80
+ | `back` | Navigate back |
81
+ | `wait <ms\|text>` | Wait for time or text to appear |
82
+ | `eval <js>` | Evaluate JavaScript in page context |
83
+
84
+ ### Interaction
85
+
86
+ | Command | Description |
87
+ | -------------------------- | ------------------------------ |
88
+ | `click @<uid>` | Click an element by ref |
89
+ | `fill @<uid> <text>` | Fill a form field |
90
+ | `type <text>` | Type text at current focus |
91
+ | `press <key>` | Press a keyboard key |
92
+ | `hover @<uid>` | Hover over an element |
93
+ | `drag @<from> @<to>` | Drag an element onto another |
94
+ | `fillform @<uid>=<val>...` | Fill multiple form fields |
95
+ | `dialog <accept\|dismiss>` | Handle a browser dialog |
96
+ | `upload @<uid> <path>` | Upload a file through an input |
97
+
98
+ ### Page Management
99
+
100
+ | Command | Description |
101
+ | ----------------- | --------------------------- |
102
+ | `pages` | List all open tabs |
103
+ | `newpage <url>` | Open a new tab |
104
+ | `selectpage <id>` | Switch to a tab by ID |
105
+ | `closepage <id>` | Close a tab by ID |
106
+ | `resize <w> <h>` | Resize the browser viewport |
107
+
108
+ ### Emulation
109
+
110
+ | Command | Description |
111
+ | --------- | ------------------------------- |
112
+ | `emulate` | Emulate device/network/viewport |
113
+
114
+ ### DevTools Debugging
115
+
116
+ | Command | Description |
117
+ | ------------------ | ------------------------------ |
118
+ | `console` | List console messages |
119
+ | `console-get <id>` | Get a specific console message |
120
+ | `network` | List network requests |
121
+ | `network-get [id]` | Get a specific network request |
122
+
123
+ ### Performance
124
+
125
+ | Command | Description |
126
+ | --------------------------- | ----------------------------- |
127
+ | `lighthouse` | Run a Lighthouse audit |
128
+ | `perf-start` | Start a performance trace |
129
+ | `perf-stop` | Stop the performance trace |
130
+ | `perf-insight <set> <name>` | Analyze a performance insight |
131
+ | `heap <path>` | Capture a heap snapshot |
132
+
133
+ ### Bridge
134
+
135
+ | Command | Description |
136
+ | ------- | ----------------------- |
137
+ | `start` | Start the bridge server |
138
+ | `stop` | Stop the bridge server |
91
139
 
92
140
  Running with no command is equivalent to `snapshot`.
93
141
 
94
142
  ### Flags
95
143
 
96
- | Flag | Description |
97
- | -------- | ---------------------- |
98
- | `--help` | Show usage information |
144
+ | Flag | Description |
145
+ | --------------------------- | ------------------------------------------- |
146
+ | `--help` | Show usage information |
147
+ | `--full` | Show complete snapshot without truncation |
148
+ | `--background` | Open new page in background (newpage) |
149
+ | `--uid @<uid>` | Target a specific element (screenshot) |
150
+ | `--full-page` | Capture entire scrollable page (screenshot) |
151
+ | `--format <fmt>` | Image format: png, jpeg, webp (screenshot) |
152
+ | `--viewport <spec>` | Viewport like "390x844x3,mobile" (emulate) |
153
+ | `--color-scheme <value>` | dark, light, or auto (emulate) |
154
+ | `--network <condition>` | Network throttle: Slow 3G, etc. (emulate) |
155
+ | `--cpu <rate>` | CPU throttling rate 1-20 (emulate) |
156
+ | `--geolocation <lat>x<lon>` | Set geolocation (emulate) |
157
+ | `--user-agent <string>` | Custom user agent (emulate) |
158
+ | `--type <type>` | Filter by type (console, network) |
159
+ | `--limit <n>` | Max items to return (console, network) |
160
+ | `--page <n>` | Pagination (console, network) |
161
+ | `--device <device>` | desktop or mobile (lighthouse) |
162
+ | `--mode <mode>` | navigation or snapshot (lighthouse) |
163
+ | `--output-dir <path>` | Directory for reports (lighthouse) |
164
+ | `--no-reload` | Skip page reload (perf-start) |
165
+ | `--no-auto-stop` | Disable auto-stop (perf-start) |
166
+ | `--file <path>` | Save trace data to file (perf-start/stop) |
167
+ | `--response-file <path>` | Save response body (network-get) |
168
+ | `--request-file <path>` | Save request body (network-get) |
99
169
 
100
170
  ## Configuration
101
171
 
File without changes
package/dist/src/cli.d.ts CHANGED
@@ -1 +1,59 @@
1
+ export declare function getCommandHelp(command: string): string | null;
2
+ export interface ScreenshotArgs {
3
+ filePath: string | null;
4
+ uid: string | undefined;
5
+ fullPage: boolean;
6
+ format: string | undefined;
7
+ }
8
+ export declare function parseScreenshotArgs(args: string[]): ScreenshotArgs;
9
+ export declare function formatScreenshotOutput(filePath: string): string;
10
+ /** Parse MCP list_pages markdown into structured data. */
11
+ export declare function parsePagesList(text: string): {
12
+ id: number;
13
+ url: string;
14
+ selected: boolean;
15
+ }[];
16
+ /** Format raw MCP text result as AXI output: labeled block + truncation + suggestions. */
17
+ export declare function formatMcpResult(label: string, text: string, suggestions: string[]): string;
18
+ export declare function parseFillFormArgs(args: string[]): {
19
+ entries: {
20
+ uid: string;
21
+ value: string;
22
+ }[];
23
+ };
24
+ export interface EmulateArgs {
25
+ viewport?: string;
26
+ colorScheme?: string;
27
+ networkConditions?: string;
28
+ cpuThrottlingRate?: number;
29
+ geolocation?: string;
30
+ userAgent?: string;
31
+ }
32
+ export declare function parseEmulateArgs(args: string[]): EmulateArgs;
33
+ export declare function parseConsoleArgs(args: string[]): {
34
+ types?: string[];
35
+ pageSize?: number;
36
+ pageIdx?: number;
37
+ };
38
+ export declare function parseNetworkArgs(args: string[]): {
39
+ resourceTypes?: string[];
40
+ pageSize?: number;
41
+ pageIdx?: number;
42
+ };
43
+ export declare function parseNetworkGetArgs(args: string[]): {
44
+ reqid?: number;
45
+ responseFilePath?: string;
46
+ requestFilePath?: string;
47
+ };
48
+ export declare function parseLighthouseArgs(args: string[]): {
49
+ device?: string;
50
+ mode?: string;
51
+ outputDirPath?: string;
52
+ };
53
+ export declare function parsePerfStartArgs(args: string[]): {
54
+ reload?: boolean;
55
+ autoStop?: boolean;
56
+ filePath?: string;
57
+ };
58
+ export declare function formatStopOutput(wasStopped: boolean): string;
1
59
  export declare function main(argv: string[]): Promise<void>;