webpilot-cli 0.1.0__tar.gz

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.
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: webpilot-cli
3
+ Version: 0.1.0
4
+ Summary: pip launcher for the WebPilot browser agent (npm package: @capagents/webpilot)
5
+ Author: CLI-Agents
6
+ License: MIT
7
+ Keywords: webpilot,browser,agent,cli,opentui
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=8.0; extra == "dev"
12
+
13
+ # WebPilot
14
+
15
+ Self-contained browser agent: OODA loop (observe → orient → decide → act) → Playwright spec.
16
+
17
+ No FastAPI or database. LLM profiles live in `llms.json`, agent settings in `webpilot.yaml`. The interactive shell is [OpenTUI](https://opentui.com). Headless `run` is for CI.
18
+
19
+ The loop matches the WebPilot design in test-agent-nexus (`backend/docs/WEBPILOT_FLOW.md`): DOM observe with shadow roots, viewport JPEG, one JSON action per step, then click / type / select / navigate. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [HOW_TO_USE.md](HOW_TO_USE.md).
20
+
21
+ ## Install
22
+
23
+ OpenTUI needs **Bun 1.3+**. Node cannot load the native renderer.
24
+
25
+ The CLI is published on **npm** as `@capagents/webpilot` (the unscoped name is too close to an existing package). **PyPI** package `webpilot-cli` is a pip launcher for the same `webpilot` command (`webpilot` is already another project on PyPI).
26
+
27
+ ```bash
28
+ curl -fsSL https://bun.sh/install | bash
29
+
30
+ # npm
31
+ npm install -g @capagents/webpilot
32
+ npx @capagents/webpilot --help
33
+
34
+ # pip (launcher; runs the npm package via bun)
35
+ pip install webpilot-cli
36
+ webpilot --help
37
+ ```
38
+
39
+ Live browser profiles also need Chromium: `bunx playwright install chromium`. The `mock` profile does not.
40
+
41
+ From this repo:
42
+
43
+ ```bash
44
+ cd WebPilot
45
+ bun install
46
+ bun src/index.ts init
47
+ bun src/index.ts start
48
+ ```
49
+
50
+ One-shot release (same version on both registries; assumes `npm` and `twine` are already logged in):
51
+
52
+ ```bash
53
+ ./scripts/publish.sh # current version
54
+ ./scripts/publish.sh 0.2.0 # bump + publish
55
+ ./scripts/publish.sh --dry-run # pack only
56
+ ```
57
+
58
+ npm is published first. The pip launcher runs `bun x @capagents/webpilot@<version>`.
59
+
60
+ ## Configure
61
+
62
+ `init` writes:
63
+
64
+ | File | Purpose |
65
+ |------|---------|
66
+ | `webpilot.yaml` | Browser, prompts, export, active profile |
67
+ | `llms.json` | Named LLM profiles |
68
+ | `.env.example` | API key names |
69
+
70
+ ```bash
71
+ webpilot models
72
+ webpilot run --goal "Read the homepage" --url https://example.com --profile mock --plain
73
+ ```
74
+
75
+ `mock` uses a synthetic page, writes `workflow.yaml` and `webpilot.spec.ts`, and does not call a model. Switch `llm.active` to `azure-gpt4o` or `openai-gpt4o` for a real browser run.
76
+
77
+ ## CLI
78
+
79
+ ```bash
80
+ webpilot start
81
+ webpilot start -u https://example.com -g "Find the documentation link" -p openai-gpt4o
82
+
83
+ webpilot run --goal "Get a quote" --url https://example.com --profile azure-gpt4o --headed
84
+ webpilot run --goal "..." --url https://example.com --profile mock --plain --out ./out/demo
85
+ ```
86
+
87
+ Inside the shell: `/url`, `/goal`, `/run`, `/stop`, `/headed`, `/steps`, `/profile`, `/export`, `/exit`. A line without a slash sets the goal and starts when a URL is known.
@@ -0,0 +1,75 @@
1
+ # WebPilot
2
+
3
+ Self-contained browser agent: OODA loop (observe → orient → decide → act) → Playwright spec.
4
+
5
+ No FastAPI or database. LLM profiles live in `llms.json`, agent settings in `webpilot.yaml`. The interactive shell is [OpenTUI](https://opentui.com). Headless `run` is for CI.
6
+
7
+ The loop matches the WebPilot design in test-agent-nexus (`backend/docs/WEBPILOT_FLOW.md`): DOM observe with shadow roots, viewport JPEG, one JSON action per step, then click / type / select / navigate. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [HOW_TO_USE.md](HOW_TO_USE.md).
8
+
9
+ ## Install
10
+
11
+ OpenTUI needs **Bun 1.3+**. Node cannot load the native renderer.
12
+
13
+ The CLI is published on **npm** as `@capagents/webpilot` (the unscoped name is too close to an existing package). **PyPI** package `webpilot-cli` is a pip launcher for the same `webpilot` command (`webpilot` is already another project on PyPI).
14
+
15
+ ```bash
16
+ curl -fsSL https://bun.sh/install | bash
17
+
18
+ # npm
19
+ npm install -g @capagents/webpilot
20
+ npx @capagents/webpilot --help
21
+
22
+ # pip (launcher; runs the npm package via bun)
23
+ pip install webpilot-cli
24
+ webpilot --help
25
+ ```
26
+
27
+ Live browser profiles also need Chromium: `bunx playwright install chromium`. The `mock` profile does not.
28
+
29
+ From this repo:
30
+
31
+ ```bash
32
+ cd WebPilot
33
+ bun install
34
+ bun src/index.ts init
35
+ bun src/index.ts start
36
+ ```
37
+
38
+ One-shot release (same version on both registries; assumes `npm` and `twine` are already logged in):
39
+
40
+ ```bash
41
+ ./scripts/publish.sh # current version
42
+ ./scripts/publish.sh 0.2.0 # bump + publish
43
+ ./scripts/publish.sh --dry-run # pack only
44
+ ```
45
+
46
+ npm is published first. The pip launcher runs `bun x @capagents/webpilot@<version>`.
47
+
48
+ ## Configure
49
+
50
+ `init` writes:
51
+
52
+ | File | Purpose |
53
+ |------|---------|
54
+ | `webpilot.yaml` | Browser, prompts, export, active profile |
55
+ | `llms.json` | Named LLM profiles |
56
+ | `.env.example` | API key names |
57
+
58
+ ```bash
59
+ webpilot models
60
+ webpilot run --goal "Read the homepage" --url https://example.com --profile mock --plain
61
+ ```
62
+
63
+ `mock` uses a synthetic page, writes `workflow.yaml` and `webpilot.spec.ts`, and does not call a model. Switch `llm.active` to `azure-gpt4o` or `openai-gpt4o` for a real browser run.
64
+
65
+ ## CLI
66
+
67
+ ```bash
68
+ webpilot start
69
+ webpilot start -u https://example.com -g "Find the documentation link" -p openai-gpt4o
70
+
71
+ webpilot run --goal "Get a quote" --url https://example.com --profile azure-gpt4o --headed
72
+ webpilot run --goal "..." --url https://example.com --profile mock --plain --out ./out/demo
73
+ ```
74
+
75
+ Inside the shell: `/url`, `/goal`, `/run`, `/stop`, `/headed`, `/steps`, `/profile`, `/export`, `/exit`. A line without a slash sets the goal and starts when a URL is known.
@@ -0,0 +1,7 @@
1
+ """pip launcher for the WebPilot CLI.
2
+
3
+ The agent itself is the npm package ``@capagents/webpilot`` (OpenTUI + Bun).
4
+ This distribution only puts a ``webpilot`` command on PATH.
5
+ """
6
+
7
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from webpilot_cli.launcher import main
2
+
3
+ main()
@@ -0,0 +1,67 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import shutil
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ from webpilot_cli import __version__
9
+
10
+ NPM_PACKAGE = "@capagents/webpilot"
11
+
12
+
13
+ class LaunchError(Exception):
14
+ pass
15
+
16
+
17
+ def find_bun() -> str | None:
18
+ if os.environ.get("WEBPILOT_BUN"):
19
+ explicit = os.environ["WEBPILOT_BUN"]
20
+ if Path(explicit).is_file() or shutil.which(explicit):
21
+ return explicit
22
+ found = shutil.which("bun")
23
+ if found:
24
+ return found
25
+ home = os.environ.get("HOME") or os.environ.get("USERPROFILE") or ""
26
+ if home:
27
+ candidate = Path(home) / ".bun" / "bin" / "bun"
28
+ if candidate.is_file():
29
+ return str(candidate)
30
+ return None
31
+
32
+
33
+ def find_checkout_entry() -> Path | None:
34
+ """Repo layout is <root>/py/webpilot_cli/launcher.py. Wheels do not match."""
35
+ root = Path(__file__).resolve().parents[2]
36
+ entry = root / "src" / "index.ts"
37
+ package_json = root / "package.json"
38
+ if entry.is_file() and package_json.is_file():
39
+ return entry
40
+ return None
41
+
42
+
43
+ def resolve_launch(args: list[str]) -> list[str]:
44
+ bun = find_bun()
45
+ if not bun:
46
+ raise LaunchError(
47
+ "webpilot needs Bun 1.3 or newer.\n"
48
+ " curl -fsSL https://bun.sh/install | bash"
49
+ )
50
+ if os.environ.get("WEBPILOT_FROM_REGISTRY") == "1":
51
+ entry = None
52
+ else:
53
+ entry = find_checkout_entry()
54
+ if entry is not None:
55
+ return [bun, str(entry), *args]
56
+ return [bun, "x", f"{NPM_PACKAGE}@{__version__}", *args]
57
+
58
+
59
+ def main() -> None:
60
+ try:
61
+ cmd = resolve_launch(sys.argv[1:])
62
+ except LaunchError as exc:
63
+ print(str(exc), file=sys.stderr)
64
+ raise SystemExit(1) from exc
65
+ bindir = str(Path(cmd[0]).parent)
66
+ os.environ["PATH"] = bindir + os.pathsep + os.environ.get("PATH", "")
67
+ os.execv(cmd[0], cmd)
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: webpilot-cli
3
+ Version: 0.1.0
4
+ Summary: pip launcher for the WebPilot browser agent (npm package: @capagents/webpilot)
5
+ Author: CLI-Agents
6
+ License: MIT
7
+ Keywords: webpilot,browser,agent,cli,opentui
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=8.0; extra == "dev"
12
+
13
+ # WebPilot
14
+
15
+ Self-contained browser agent: OODA loop (observe → orient → decide → act) → Playwright spec.
16
+
17
+ No FastAPI or database. LLM profiles live in `llms.json`, agent settings in `webpilot.yaml`. The interactive shell is [OpenTUI](https://opentui.com). Headless `run` is for CI.
18
+
19
+ The loop matches the WebPilot design in test-agent-nexus (`backend/docs/WEBPILOT_FLOW.md`): DOM observe with shadow roots, viewport JPEG, one JSON action per step, then click / type / select / navigate. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [HOW_TO_USE.md](HOW_TO_USE.md).
20
+
21
+ ## Install
22
+
23
+ OpenTUI needs **Bun 1.3+**. Node cannot load the native renderer.
24
+
25
+ The CLI is published on **npm** as `@capagents/webpilot` (the unscoped name is too close to an existing package). **PyPI** package `webpilot-cli` is a pip launcher for the same `webpilot` command (`webpilot` is already another project on PyPI).
26
+
27
+ ```bash
28
+ curl -fsSL https://bun.sh/install | bash
29
+
30
+ # npm
31
+ npm install -g @capagents/webpilot
32
+ npx @capagents/webpilot --help
33
+
34
+ # pip (launcher; runs the npm package via bun)
35
+ pip install webpilot-cli
36
+ webpilot --help
37
+ ```
38
+
39
+ Live browser profiles also need Chromium: `bunx playwright install chromium`. The `mock` profile does not.
40
+
41
+ From this repo:
42
+
43
+ ```bash
44
+ cd WebPilot
45
+ bun install
46
+ bun src/index.ts init
47
+ bun src/index.ts start
48
+ ```
49
+
50
+ One-shot release (same version on both registries; assumes `npm` and `twine` are already logged in):
51
+
52
+ ```bash
53
+ ./scripts/publish.sh # current version
54
+ ./scripts/publish.sh 0.2.0 # bump + publish
55
+ ./scripts/publish.sh --dry-run # pack only
56
+ ```
57
+
58
+ npm is published first. The pip launcher runs `bun x @capagents/webpilot@<version>`.
59
+
60
+ ## Configure
61
+
62
+ `init` writes:
63
+
64
+ | File | Purpose |
65
+ |------|---------|
66
+ | `webpilot.yaml` | Browser, prompts, export, active profile |
67
+ | `llms.json` | Named LLM profiles |
68
+ | `.env.example` | API key names |
69
+
70
+ ```bash
71
+ webpilot models
72
+ webpilot run --goal "Read the homepage" --url https://example.com --profile mock --plain
73
+ ```
74
+
75
+ `mock` uses a synthetic page, writes `workflow.yaml` and `webpilot.spec.ts`, and does not call a model. Switch `llm.active` to `azure-gpt4o` or `openai-gpt4o` for a real browser run.
76
+
77
+ ## CLI
78
+
79
+ ```bash
80
+ webpilot start
81
+ webpilot start -u https://example.com -g "Find the documentation link" -p openai-gpt4o
82
+
83
+ webpilot run --goal "Get a quote" --url https://example.com --profile azure-gpt4o --headed
84
+ webpilot run --goal "..." --url https://example.com --profile mock --plain --out ./out/demo
85
+ ```
86
+
87
+ Inside the shell: `/url`, `/goal`, `/run`, `/stop`, `/headed`, `/steps`, `/profile`, `/export`, `/exit`. A line without a slash sets the goal and starts when a URL is known.
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ py/webpilot_cli/__init__.py
4
+ py/webpilot_cli/__main__.py
5
+ py/webpilot_cli/launcher.py
6
+ py/webpilot_cli.egg-info/PKG-INFO
7
+ py/webpilot_cli.egg-info/SOURCES.txt
8
+ py/webpilot_cli.egg-info/dependency_links.txt
9
+ py/webpilot_cli.egg-info/entry_points.txt
10
+ py/webpilot_cli.egg-info/requires.txt
11
+ py/webpilot_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ webpilot = webpilot_cli.launcher:main
@@ -0,0 +1,3 @@
1
+
2
+ [dev]
3
+ pytest>=8.0
@@ -0,0 +1 @@
1
+ webpilot_cli
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "webpilot-cli"
7
+ version = "0.1.0"
8
+ description = "pip launcher for the WebPilot browser agent (npm package: @capagents/webpilot)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "CLI-Agents" }]
13
+ keywords = ["webpilot", "browser", "agent", "cli", "opentui"]
14
+ dependencies = []
15
+
16
+ [project.optional-dependencies]
17
+ dev = ["pytest>=8.0"]
18
+
19
+ [project.scripts]
20
+ webpilot = "webpilot_cli.launcher:main"
21
+
22
+ [tool.setuptools.packages.find]
23
+ where = ["py"]
24
+
25
+ [tool.pytest.ini_options]
26
+ testpaths = ["tests/python"]
27
+ pythonpath = ["py"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+