@cli4ai/chrome 1.0.2 → 1.0.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 +28 -9
- package/c4ai.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cli4ai/chrome
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Official @cli4ai package • https://cli4ai.com • Install c4ai: `npm i -g c4ai`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Chrome profile automation via Puppeteer (connects to a running Chrome with remote debugging enabled).
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
npm i -g c4ai
|
|
11
|
+
c4ai add -g chrome
|
|
10
12
|
```
|
|
11
13
|
|
|
14
|
+
1) Quit all running Chrome instances.
|
|
15
|
+
|
|
16
|
+
2) Start Chrome with remote debugging enabled (port `9222`):
|
|
17
|
+
|
|
18
|
+
- macOS: `open -na "Google Chrome" --args --remote-debugging-port=9222`
|
|
19
|
+
- Linux: `google-chrome --remote-debugging-port=9222`
|
|
20
|
+
|
|
21
|
+
3) Connect:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
c4ai run chrome connect # default port 9222
|
|
25
|
+
# or
|
|
26
|
+
c4ai run chrome connect 9222
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Other browser tools (e.g. `@cli4ai/twitter`, `@cli4ai/linkedin`) reuse this connection.
|
|
30
|
+
|
|
12
31
|
## Commands
|
|
13
32
|
|
|
14
33
|
```bash
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
34
|
+
c4ai run chrome navigate <url> [--new-tab]
|
|
35
|
+
c4ai run chrome eval "<js>"
|
|
36
|
+
c4ai run chrome screenshot [file] [--full-page]
|
|
37
|
+
c4ai run chrome cookies [domain]
|
|
19
38
|
```
|
package/c4ai.json
CHANGED