real-browser-cli 0.14.2__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.
Files changed (182) hide show
  1. real_browser_cli-0.14.2/.claude/settings.local.json +62 -0
  2. real_browser_cli-0.14.2/.gitea/workflows/package-extension.yml +189 -0
  3. real_browser_cli-0.14.2/.gitea/workflows/publish.yml +28 -0
  4. real_browser_cli-0.14.2/.gitea/workflows/testing.yml +47 -0
  5. real_browser_cli-0.14.2/.gitignore +13 -0
  6. real_browser_cli-0.14.2/.python-version +1 -0
  7. real_browser_cli-0.14.2/CLAUDE.md +66 -0
  8. real_browser_cli-0.14.2/LICENSE +75 -0
  9. real_browser_cli-0.14.2/PKG-INFO +87 -0
  10. real_browser_cli-0.14.2/PRIVACY.md +23 -0
  11. real_browser_cli-0.14.2/README.md +539 -0
  12. real_browser_cli-0.14.2/browser_cli/__init__.py +164 -0
  13. real_browser_cli-0.14.2/browser_cli/async_sdk.py +237 -0
  14. real_browser_cli-0.14.2/browser_cli/auth.py +263 -0
  15. real_browser_cli-0.14.2/browser_cli/cli.py +151 -0
  16. real_browser_cli-0.14.2/browser_cli/client/__init__.py +47 -0
  17. real_browser_cli-0.14.2/browser_cli/client/auth.py +63 -0
  18. real_browser_cli-0.14.2/browser_cli/client/core.py +200 -0
  19. real_browser_cli-0.14.2/browser_cli/client/messages.py +45 -0
  20. real_browser_cli-0.14.2/browser_cli/client/targets.py +95 -0
  21. real_browser_cli-0.14.2/browser_cli/command_security.py +119 -0
  22. real_browser_cli-0.14.2/browser_cli/commands/__init__.py +81 -0
  23. real_browser_cli-0.14.2/browser_cli/commands/auth.py +157 -0
  24. real_browser_cli-0.14.2/browser_cli/commands/clients.py +173 -0
  25. real_browser_cli-0.14.2/browser_cli/commands/completion.py +56 -0
  26. real_browser_cli-0.14.2/browser_cli/commands/doctor.py +90 -0
  27. real_browser_cli-0.14.2/browser_cli/commands/dom.py +191 -0
  28. real_browser_cli-0.14.2/browser_cli/commands/events.py +52 -0
  29. real_browser_cli-0.14.2/browser_cli/commands/extension.py +42 -0
  30. real_browser_cli-0.14.2/browser_cli/commands/extract.py +70 -0
  31. real_browser_cli-0.14.2/browser_cli/commands/groups.py +108 -0
  32. real_browser_cli-0.14.2/browser_cli/commands/install.py +121 -0
  33. real_browser_cli-0.14.2/browser_cli/commands/navigate.py +96 -0
  34. real_browser_cli-0.14.2/browser_cli/commands/page.py +26 -0
  35. real_browser_cli-0.14.2/browser_cli/commands/perf.py +47 -0
  36. real_browser_cli-0.14.2/browser_cli/commands/raw.py +23 -0
  37. real_browser_cli-0.14.2/browser_cli/commands/remote.py +68 -0
  38. real_browser_cli-0.14.2/browser_cli/commands/script.py +68 -0
  39. real_browser_cli-0.14.2/browser_cli/commands/search.py +79 -0
  40. real_browser_cli-0.14.2/browser_cli/commands/serve.py +117 -0
  41. real_browser_cli-0.14.2/browser_cli/commands/serve_http.py +115 -0
  42. real_browser_cli-0.14.2/browser_cli/commands/session.py +163 -0
  43. real_browser_cli-0.14.2/browser_cli/commands/storage.py +36 -0
  44. real_browser_cli-0.14.2/browser_cli/commands/tabs.py +252 -0
  45. real_browser_cli-0.14.2/browser_cli/commands/watch.py +60 -0
  46. real_browser_cli-0.14.2/browser_cli/commands/windows.py +87 -0
  47. real_browser_cli-0.14.2/browser_cli/commands/workspace.py +91 -0
  48. real_browser_cli-0.14.2/browser_cli/compat/__init__.py +4 -0
  49. real_browser_cli-0.14.2/browser_cli/compat/auth.py +44 -0
  50. real_browser_cli-0.14.2/browser_cli/compat/commands.py +43 -0
  51. real_browser_cli-0.14.2/browser_cli/constants.py +95 -0
  52. real_browser_cli-0.14.2/browser_cli/endpoints.py +55 -0
  53. real_browser_cli-0.14.2/browser_cli/errors.py +9 -0
  54. real_browser_cli-0.14.2/browser_cli/framing.py +83 -0
  55. real_browser_cli-0.14.2/browser_cli/local_transport.py +64 -0
  56. real_browser_cli-0.14.2/browser_cli/markdown/__init__.py +8 -0
  57. real_browser_cli-0.14.2/browser_cli/markdown/html.py +259 -0
  58. real_browser_cli-0.14.2/browser_cli/markdown/render.py +188 -0
  59. real_browser_cli-0.14.2/browser_cli/models.py +182 -0
  60. real_browser_cli-0.14.2/browser_cli/native/__init__.py +1 -0
  61. real_browser_cli-0.14.2/browser_cli/native/host.py +211 -0
  62. real_browser_cli-0.14.2/browser_cli/native/local_server.py +111 -0
  63. real_browser_cli-0.14.2/browser_cli/native/protocol.py +30 -0
  64. real_browser_cli-0.14.2/browser_cli/platform.py +34 -0
  65. real_browser_cli-0.14.2/browser_cli/registry.py +99 -0
  66. real_browser_cli-0.14.2/browser_cli/remote/__init__.py +1 -0
  67. real_browser_cli-0.14.2/browser_cli/remote/registry.py +53 -0
  68. real_browser_cli-0.14.2/browser_cli/remote/transport.py +230 -0
  69. real_browser_cli-0.14.2/browser_cli/sdk/__init__.py +48 -0
  70. real_browser_cli-0.14.2/browser_cli/sdk/base.py +116 -0
  71. real_browser_cli-0.14.2/browser_cli/sdk/browser_data.py +37 -0
  72. real_browser_cli-0.14.2/browser_cli/sdk/decorators.py +107 -0
  73. real_browser_cli-0.14.2/browser_cli/sdk/dom.py +169 -0
  74. real_browser_cli-0.14.2/browser_cli/sdk/extension.py +24 -0
  75. real_browser_cli-0.14.2/browser_cli/sdk/factories.py +103 -0
  76. real_browser_cli-0.14.2/browser_cli/sdk/groups.py +51 -0
  77. real_browser_cli-0.14.2/browser_cli/sdk/navigation.py +122 -0
  78. real_browser_cli-0.14.2/browser_cli/sdk/perf.py +23 -0
  79. real_browser_cli-0.14.2/browser_cli/sdk/routing.py +149 -0
  80. real_browser_cli-0.14.2/browser_cli/sdk/session.py +72 -0
  81. real_browser_cli-0.14.2/browser_cli/sdk/tabs.py +213 -0
  82. real_browser_cli-0.14.2/browser_cli/sdk/windows.py +26 -0
  83. real_browser_cli-0.14.2/browser_cli/sdk/workflow_decorators.py +200 -0
  84. real_browser_cli-0.14.2/browser_cli/serve/__init__.py +0 -0
  85. real_browser_cli-0.14.2/browser_cli/serve/auth.py +107 -0
  86. real_browser_cli-0.14.2/browser_cli/serve/control.py +59 -0
  87. real_browser_cli-0.14.2/browser_cli/serve/logging.py +16 -0
  88. real_browser_cli-0.14.2/browser_cli/serve/proxy.py +79 -0
  89. real_browser_cli-0.14.2/browser_cli/serve/runtime.py +196 -0
  90. real_browser_cli-0.14.2/browser_cli/transport.py +214 -0
  91. real_browser_cli-0.14.2/browser_cli/version_manager.py +17 -0
  92. real_browser_cli-0.14.2/examples/demo.py +109 -0
  93. real_browser_cli-0.14.2/examples/demo.sh +88 -0
  94. real_browser_cli-0.14.2/extension/content.js +9 -0
  95. real_browser_cli-0.14.2/extension/icon.svg +31 -0
  96. real_browser_cli-0.14.2/extension/icons/icon-128.png +0 -0
  97. real_browser_cli-0.14.2/extension/icons/icon-16.png +0 -0
  98. real_browser_cli-0.14.2/extension/icons/icon-32.png +0 -0
  99. real_browser_cli-0.14.2/extension/icons/icon-48.png +0 -0
  100. real_browser_cli-0.14.2/extension/manifest.json +35 -0
  101. real_browser_cli-0.14.2/extension/src/classes/CommandGroup.ts +21 -0
  102. real_browser_cli-0.14.2/extension/src/classes/CommandRegistry.ts +94 -0
  103. real_browser_cli-0.14.2/extension/src/classes/JobManager.ts +160 -0
  104. real_browser_cli-0.14.2/extension/src/classes/NativeConnection.ts +152 -0
  105. real_browser_cli-0.14.2/extension/src/commands/autosave.ts +84 -0
  106. real_browser_cli-0.14.2/extension/src/commands/browser-data.ts +49 -0
  107. real_browser_cli-0.14.2/extension/src/commands/dom.ts +179 -0
  108. real_browser_cli-0.14.2/extension/src/commands/extension.ts +43 -0
  109. real_browser_cli-0.14.2/extension/src/commands/groups.ts +114 -0
  110. real_browser_cli-0.14.2/extension/src/commands/injected.ts +4 -0
  111. real_browser_cli-0.14.2/extension/src/commands/navigation.ts +122 -0
  112. real_browser_cli-0.14.2/extension/src/commands/perf.ts +38 -0
  113. real_browser_cli-0.14.2/extension/src/commands/session-snapshot.ts +54 -0
  114. real_browser_cli-0.14.2/extension/src/commands/session.ts +177 -0
  115. real_browser_cli-0.14.2/extension/src/commands/tabs-query.ts +95 -0
  116. real_browser_cli-0.14.2/extension/src/commands/tabs.ts +176 -0
  117. real_browser_cli-0.14.2/extension/src/commands/windows.ts +45 -0
  118. real_browser_cli-0.14.2/extension/src/content/dispatch.ts +51 -0
  119. real_browser_cli-0.14.2/extension/src/content/dom-ops.ts +114 -0
  120. real_browser_cli-0.14.2/extension/src/content/extract.ts +45 -0
  121. real_browser_cli-0.14.2/extension/src/content/markdown.ts +404 -0
  122. real_browser_cli-0.14.2/extension/src/content/page-info.ts +14 -0
  123. real_browser_cli-0.14.2/extension/src/content-dispatch.ts +7 -0
  124. real_browser_cli-0.14.2/extension/src/core/errors.ts +35 -0
  125. real_browser_cli-0.14.2/extension/src/core/group-helpers.ts +15 -0
  126. real_browser_cli-0.14.2/extension/src/core/index.ts +6 -0
  127. real_browser_cli-0.14.2/extension/src/core/scripting.ts +23 -0
  128. real_browser_cli-0.14.2/extension/src/core/storage.ts +30 -0
  129. real_browser_cli-0.14.2/extension/src/core/tab-helpers.ts +123 -0
  130. real_browser_cli-0.14.2/extension/src/core/throttle.ts +117 -0
  131. real_browser_cli-0.14.2/extension/src/index.ts +23 -0
  132. real_browser_cli-0.14.2/extension/src/types/command-args.ts +95 -0
  133. real_browser_cli-0.14.2/extension/src/types/index.ts +6 -0
  134. real_browser_cli-0.14.2/extension/src/types/jobs.ts +28 -0
  135. real_browser_cli-0.14.2/extension/src/types/json.ts +23 -0
  136. real_browser_cli-0.14.2/extension/src/types/messages.ts +27 -0
  137. real_browser_cli-0.14.2/extension/src/types/session.ts +21 -0
  138. real_browser_cli-0.14.2/extension/src/types/tabs.ts +6 -0
  139. real_browser_cli-0.14.2/extension/test/autosave.test.ts +127 -0
  140. real_browser_cli-0.14.2/extension/test/chrome-mock.ts +55 -0
  141. real_browser_cli-0.14.2/extension/test/jobs.test.ts +146 -0
  142. real_browser_cli-0.14.2/justfile +81 -0
  143. real_browser_cli-0.14.2/package-lock.json +548 -0
  144. real_browser_cli-0.14.2/package.json +18 -0
  145. real_browser_cli-0.14.2/pyproject.toml +37 -0
  146. real_browser_cli-0.14.2/scripts/gen_extension_key.py +74 -0
  147. real_browser_cli-0.14.2/scripts/package_extension.py +78 -0
  148. real_browser_cli-0.14.2/shell.nix +20 -0
  149. real_browser_cli-0.14.2/tests/conftest.py +52 -0
  150. real_browser_cli-0.14.2/tests/test_api.py +1212 -0
  151. real_browser_cli-0.14.2/tests/test_auth.py +199 -0
  152. real_browser_cli-0.14.2/tests/test_cli.py +689 -0
  153. real_browser_cli-0.14.2/tests/test_client.py +557 -0
  154. real_browser_cli-0.14.2/tests/test_commands_cli.py +946 -0
  155. real_browser_cli-0.14.2/tests/test_dom.py +267 -0
  156. real_browser_cli-0.14.2/tests/test_extension_error_page_handling.py +184 -0
  157. real_browser_cli-0.14.2/tests/test_extension_packaging.py +57 -0
  158. real_browser_cli-0.14.2/tests/test_extract.py +58 -0
  159. real_browser_cli-0.14.2/tests/test_framing.py +59 -0
  160. real_browser_cli-0.14.2/tests/test_groups.py +190 -0
  161. real_browser_cli-0.14.2/tests/test_native_host.py +420 -0
  162. real_browser_cli-0.14.2/tests/test_nav.py +102 -0
  163. real_browser_cli-0.14.2/tests/test_new_feature_commands.py +105 -0
  164. real_browser_cli-0.14.2/tests/test_page.py +39 -0
  165. real_browser_cli-0.14.2/tests/test_perf.py +72 -0
  166. real_browser_cli-0.14.2/tests/test_performance_integration.py +157 -0
  167. real_browser_cli-0.14.2/tests/test_platform.py +30 -0
  168. real_browser_cli-0.14.2/tests/test_refactor_boundaries.py +123 -0
  169. real_browser_cli-0.14.2/tests/test_registry.py +30 -0
  170. real_browser_cli-0.14.2/tests/test_remote_protocol_matrix.py +213 -0
  171. real_browser_cli-0.14.2/tests/test_serve.py +530 -0
  172. real_browser_cli-0.14.2/tests/test_session.py +112 -0
  173. real_browser_cli-0.14.2/tests/test_storage.py +54 -0
  174. real_browser_cli-0.14.2/tests/test_tabs.py +158 -0
  175. real_browser_cli-0.14.2/tests/test_transport.py +117 -0
  176. real_browser_cli-0.14.2/tests/test_windows.py +59 -0
  177. real_browser_cli-0.14.2/tsconfig.json +15 -0
  178. real_browser_cli-0.14.2/uv.lock +670 -0
  179. real_browser_cli-0.14.2/webstore-assets/icon-128.png +0 -0
  180. real_browser_cli-0.14.2/webstore-assets/screenshots/screenshot-1.png +0 -0
  181. real_browser_cli-0.14.2/webstore-assets/screenshots/screenshot-2.png +0 -0
  182. real_browser_cli-0.14.2/webstore-assets/screenshots/screenshot-3.png +0 -0
@@ -0,0 +1,62 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(uv init:*)",
5
+ "Bash(uv add:*)",
6
+ "Bash(uv sync:*)",
7
+ "Bash(uv run:*)",
8
+ "Bash(chmod +x:*)",
9
+ "Bash(python3 -c \"import click.shell_completion; print\\(dir\\(click.shell_completion\\)\\)\")",
10
+ "Bash(uv tool:*)",
11
+ "Read(//home/daniel156161/.local/bin/**)",
12
+ "Read(//home/daniel156161/.config/uv/**)",
13
+ "Bash(env)",
14
+ "Bash(zsh -i -c 'echo $PATH | tr \":\" \"\\\\n\"')",
15
+ "Bash(bash -c 'echo $PATH | tr \":\" \"\\\\n\"')",
16
+ "Read(//var/lib/snapd/snap/code/232/**)",
17
+ "Read(//home/daniel156161/snap/code/**)",
18
+ "Bash(ls ~/.local/bin/browser-cli*)",
19
+ "Bash(/home/daniel156161/.local/share/uv/tools/browser-cli/bin/browser-cli native-host:*)",
20
+ "Bash(kill %1)",
21
+ "Bash(echo \"exit: $?\")",
22
+ "Bash(python3 -c ':*)",
23
+ "Bash(python3:*)",
24
+ "Bash(/home/daniel156161/.local/share/uv/tools/browser-cli/bin/browser-cli --help)",
25
+ "Bash(/home/daniel156161/.local/share/browser-cli/native-host)",
26
+ "Read(//tmp/**)",
27
+ "Bash(echo \"EXIT: $?\")",
28
+ "Bash(browser-cli --version)",
29
+ "Bash(browser-cli --help)",
30
+ "Bash(browser-cli native-host:*)",
31
+ "Bash(ls:*)",
32
+ "Bash(.venv/bin/python:*)",
33
+ "Bash(git *)",
34
+ "Bash(python *)",
35
+ "Bash(uv lock *)",
36
+ "Bash(grep *)",
37
+ "Bash(sed -n '158,162p' /home/daniel156161/Dokumente/git/Tools/browser-cli/tests/test_api.py)",
38
+ "Bash(sed -n '456,470p' /home/daniel156161/Dokumente/git/Tools/browser-cli/tests/test_api.py)",
39
+ "Bash(sed -n '583,587p' /home/daniel156161/Dokumente/git/Tools/browser-cli/tests/test_api.py)",
40
+ "Bash(sed -n '620,624p' /home/daniel156161/Dokumente/git/Tools/browser-cli/tests/test_api.py)",
41
+ "Bash(COMP_WORDS=\"browser-cli tabs \" COMP_CWORD=2 _BROWSER_CLI_COMPLETE=zsh_complete uv run *)",
42
+ "Bash(npm install *)",
43
+ "Bash(npm run *)",
44
+ "WebFetch(domain:)",
45
+ "Bash(pip show *)",
46
+ "Bash(uv pip *)",
47
+ "WebSearch",
48
+ "Bash(openssl s_client -connect browsercli.yiprawr.dev:443 -servername browsercli.yiprawr.dev)",
49
+ "Bash(/home/daniel156161/.local/bin/browser-cli *)",
50
+ "Bash(nc -zv 192.168.188.104 8765)",
51
+ "Bash(ssh zeus *)",
52
+ "Read(//home/daniel156161/Dokumente/git/terraform-template/build/**)",
53
+ "Bash(gpg --card-status)",
54
+ "Bash(gpgconf --kill gpg-agent)",
55
+ "Bash(gpg-agent --daemon)",
56
+ "Bash(browser-cli -V)",
57
+ "Bash(yes)",
58
+ "Read(//home/daniel156161/.config/BraveSoftware/Brave-Browser/**)",
59
+ "Read(//home/daniel156161/.config/BraveSoftware/Brave-Browser/Crashpad/**)"
60
+ ]
61
+ }
62
+ }
@@ -0,0 +1,189 @@
1
+ name: Package Extension
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ package-extension:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Setup Node.js
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 22
21
+ cache: npm
22
+
23
+ - name: Install extension build dependencies
24
+ run: npm ci
25
+
26
+ - name: Build extension
27
+ run: npm run check:extension
28
+
29
+ - name: Read extension version
30
+ id: version
31
+ run: |
32
+ version="$(python - <<'PY'
33
+ import json
34
+ from pathlib import Path
35
+
36
+ manifest = json.loads(Path("extension/manifest.json").read_text())
37
+ print(manifest["version"])
38
+ PY
39
+ )"
40
+ echo "version=$version" >> "$GITHUB_OUTPUT"
41
+
42
+ - name: Build extension archives
43
+ run: |
44
+ python scripts/package_extension.py --out "dist/browser-cli-extension-testing-v${{ steps.version.outputs.version }}.zip"
45
+ python scripts/package_extension.py --webstore --out "dist/browser-cli-extension-webstore-v${{ steps.version.outputs.version }}.zip"
46
+
47
+ - name: Publish extension release assets
48
+ env:
49
+ ACTION_ACCESS_TOKEN: ${{ secrets.ACTION_ACCESS_TOKEN }}
50
+ ASSET_NAMES: |
51
+ browser-cli-extension-testing-v${{ steps.version.outputs.version }}.zip
52
+ browser-cli-extension-webstore-v${{ steps.version.outputs.version }}.zip
53
+ EXTENSION_VERSION: ${{ steps.version.outputs.version }}
54
+ GITHUB_REPOSITORY: ${{ github.repository }}
55
+ GITHUB_SERVER_URL: ${{ github.server_url }}
56
+ GITHUB_SHA: ${{ github.sha }}
57
+ run: |
58
+ set -euo pipefail
59
+
60
+ tag_name="v${EXTENSION_VERSION}"
61
+ api_base="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
62
+
63
+ while IFS= read -r asset_name; do
64
+ [ -n "$asset_name" ] || continue
65
+ asset_path="dist/${asset_name}"
66
+ if [ ! -f "$asset_path" ]; then
67
+ echo "Missing asset: $asset_path" >&2
68
+ exit 1
69
+ fi
70
+ done <<EOF
71
+ ${ASSET_NAMES}
72
+ EOF
73
+
74
+ release_body="$(mktemp)"
75
+ create_body="$(mktemp)"
76
+ trap 'rm -f "$release_body" "$create_body"' EXIT
77
+
78
+ release_status="$(curl --silent --show-error \
79
+ --output "$release_body" \
80
+ --write-out "%{http_code}" \
81
+ --header "Authorization: token ${ACTION_ACCESS_TOKEN}" \
82
+ --header "Accept: application/json" \
83
+ "${api_base}/releases/tags/${tag_name}")"
84
+
85
+ release_id="$(python - "$release_body" <<'PY'
86
+ import json
87
+ import sys
88
+
89
+ path = sys.argv[1]
90
+ try:
91
+ with open(path, "r", encoding="utf-8") as fh:
92
+ data = json.load(fh)
93
+ except (FileNotFoundError, json.JSONDecodeError):
94
+ print("")
95
+ raise SystemExit(0)
96
+
97
+ print(data.get("id", ""))
98
+ PY
99
+ )"
100
+
101
+ if [ "$release_status" = "404" ] || [ -z "$release_id" ]; then
102
+ create_payload="$(python - <<'PY'
103
+ import json
104
+ import os
105
+
106
+ version = os.environ["EXTENSION_VERSION"]
107
+ sha = os.environ["GITHUB_SHA"]
108
+
109
+ print(json.dumps({
110
+ "tag_name": f"v{version}",
111
+ "target_commitish": sha,
112
+ "name": f"v{version}",
113
+ "draft": False,
114
+ "prerelease": False,
115
+ }))
116
+ PY
117
+ )"
118
+
119
+ create_status="$(curl --silent --show-error \
120
+ --request POST \
121
+ --output "$create_body" \
122
+ --write-out "%{http_code}" \
123
+ --header "Authorization: token ${ACTION_ACCESS_TOKEN}" \
124
+ --header "Accept: application/json" \
125
+ --header "Content-Type: application/json" \
126
+ --data "$create_payload" \
127
+ "${api_base}/releases")"
128
+
129
+ if [ "$create_status" -lt 200 ] || [ "$create_status" -ge 300 ]; then
130
+ echo "Failed to create release for ${tag_name} (HTTP ${create_status})" >&2
131
+ cat "$create_body" >&2
132
+ exit 1
133
+ fi
134
+
135
+ release_id="$(python - "$create_body" <<'PY'
136
+ import json
137
+ import sys
138
+
139
+ with open(sys.argv[1], "r", encoding="utf-8") as fh:
140
+ data = json.load(fh)
141
+ print(data["id"])
142
+ PY
143
+ )"
144
+ cp "$create_body" "$release_body"
145
+ elif [ "$release_status" -lt 200 ] || [ "$release_status" -ge 300 ]; then
146
+ echo "Failed to fetch release for ${tag_name} (HTTP ${release_status})" >&2
147
+ cat "$release_body" >&2
148
+ exit 1
149
+ fi
150
+
151
+ while IFS= read -r asset_name; do
152
+ [ -n "$asset_name" ] || continue
153
+ asset_path="dist/${asset_name}"
154
+
155
+ existing_asset_id="$(ASSET_NAME="$asset_name" python - "$release_body" <<'PY'
156
+ import json
157
+ import os
158
+ import sys
159
+
160
+ with open(sys.argv[1], "r", encoding="utf-8") as fh:
161
+ data = json.load(fh)
162
+ asset_name = os.environ["ASSET_NAME"]
163
+
164
+ for asset in data.get("assets", []):
165
+ if asset.get("name") == asset_name:
166
+ print(asset["id"])
167
+ break
168
+ else:
169
+ print("")
170
+ PY
171
+ )"
172
+
173
+ if [ -n "$existing_asset_id" ]; then
174
+ curl --silent --show-error \
175
+ --request DELETE \
176
+ --header "Authorization: token ${ACTION_ACCESS_TOKEN}" \
177
+ --header "Accept: application/json" \
178
+ "${api_base}/releases/${release_id}/assets/${existing_asset_id}"
179
+ fi
180
+
181
+ curl --silent --show-error \
182
+ --request POST \
183
+ --header "Authorization: token ${ACTION_ACCESS_TOKEN}" \
184
+ --header "Accept: application/json" \
185
+ --form "attachment=@${asset_path}" \
186
+ "${api_base}/releases/${release_id}/assets?name=${asset_name}"
187
+ done <<EOF
188
+ ${ASSET_NAMES}
189
+ EOF
@@ -0,0 +1,28 @@
1
+ name: Build & Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*" # triggers on version tags like v0.1.0, v1.2.3
7
+ workflow_dispatch: # allows manual trigger from the Gitea UI
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+
20
+ - name: Build package
21
+ run: uv build
22
+
23
+ - name: Publish to Gitea
24
+ run: |
25
+ uv publish \
26
+ --publish-url "${{ vars.REGISTRY_URL }}/api/packages/${{ github.repository_owner }}/pypi" \
27
+ --username "${{ github.repository_owner }}" \
28
+ --password "${{ secrets.ACTION_ACCESS_TOKEN }}"
@@ -0,0 +1,47 @@
1
+ name: Testing
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v5
18
+
19
+ - name: Install dependencies
20
+ run: uv sync --group dev --managed-python
21
+
22
+ - name: Run tests
23
+ run: uv run pytest
24
+
25
+ remote-protocol-compat:
26
+ runs-on: ubuntu-latest
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ browser-cli-client-version:
31
+ - "0.9.3"
32
+ - "0.9.5"
33
+
34
+ steps:
35
+ - name: Checkout
36
+ uses: actions/checkout@v4
37
+
38
+ - name: Install uv
39
+ uses: astral-sh/setup-uv@v5
40
+
41
+ - name: Install dependencies
42
+ run: uv sync --group dev --managed-python
43
+
44
+ - name: Run remote protocol compatibility matrix
45
+ env:
46
+ BROWSER_CLI_COMPAT_CLIENT_VERSION: ${{ matrix.browser-cli-client-version }}
47
+ run: uv run pytest tests/test_remote_protocol_matrix.py -v
@@ -0,0 +1,13 @@
1
+ # TypeScript / Node
2
+ extension/background.js
3
+ extension/content-dispatch.js
4
+ extension/test-dist/
5
+ node_modules/
6
+ dist/
7
+
8
+ # Python
9
+ __pycache__/
10
+ *.pyc
11
+
12
+ # IDE
13
+ .vscode/
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,66 @@
1
+ # browser-cli — Claude Project Context
2
+
3
+ ## Memory laden
4
+ Beim Start dieser Session: Memory-Datei lesen für vollständigen Codebase-Kontext:
5
+ ```
6
+ /home/daniel156161/Dokumente/Nodes - Obsidian/AI-Worker/03 Bereiche/Open Source & Side Projects/browser-cli.md
7
+ ```
8
+
9
+ Memory nach Änderungen aktualisieren (neue Commands, Architektur-Änderungen, neue Patterns, Version-Bumps).
10
+
11
+ ---
12
+
13
+ ## Projekt auf einen Blick
14
+ CLI-Tool + Python-API zur Steuerung eines laufenden Browsers (Brave, Chrome, etc.) vom Terminal.
15
+ **Kein Headless** — steuert echtes sichtbares Browser-Fenster.
16
+
17
+ Repo: `/home/daniel156161/Dokumente/git/Tools/browser-cli`
18
+ Version: `0.8.6` | Stack: Python ≥3.10, Click, Rich, Chrome Extension MV3 | Build: uv + hatchling
19
+
20
+ ## Architektur (3-Tier IPC)
21
+ ```
22
+ Terminal / Python-Script
23
+ ↓ Unix Socket (Linux) / Named Pipe (Windows)
24
+ Native Messaging Host [native_host.py]
25
+ ↓ 4-Byte LE-Length-Prefix + JSON (Native Messaging Protocol)
26
+ Chrome Extension Service Worker [extension/background.js]
27
+ ↓ Chrome APIs
28
+ Browser
29
+ ```
30
+
31
+ ## Wichtige Dateien
32
+ | Datei | Rolle |
33
+ |-------|-------|
34
+ | `browser_cli/__init__.py` | Public Python-API: `BrowserCLI`-Klasse, `Tab`/`Group` Dataclasses |
35
+ | `browser_cli/cli.py` | Click CLI Entry Point |
36
+ | `browser_cli/client.py` | `send_command()` — IPC-Kern |
37
+ | `browser_cli/native_host.py` | Native Messaging Host, Threading, Queue-Routing |
38
+ | `browser_cli/platform.py` | Plattform-Pfade (Linux/macOS/Windows) |
39
+ | `browser_cli/commands/` | 12 Command-Module (tabs, dom, extract, session, ...) |
40
+ | `extension/background.js` | Command-Dispatcher im Browser (~1610 Zeilen) |
41
+
42
+ ## Key Patterns
43
+ - **Dual Interface:** CLI (Click) und Python-API nutzen dieselbe `send_command()` Funktion
44
+ - **Bound Methods:** `Tab`/`Group` Dataclasses haben Methoden (`tab.close()`) — binden sich an erzeugende `BrowserCLI`-Instanz
45
+ - **Multi-Browser:** `--browser ALIAS` oder `BROWSER_CLI_PROFILE`, Registry in `~/.browser_cli/registry.json`
46
+ - **Native Host Threading:** Thread A liest stdin (Extension→Host), Thread B lauscht auf Socket (CLI→Host), UUID-basiertes Response-Matching
47
+ - **DOM Injection:** `chrome.scripting.executeScript()` in main world — kein Content Script nötig
48
+
49
+ ## Tests
50
+ ```bash
51
+ uv run pytest # alle Tests
52
+ uv run pytest -v # verbose
53
+ uv run pytest tests/test_api.py # einzelne Datei
54
+ ```
55
+
56
+ - **Unit** (gemockt): `test_api.py`, `test_client.py`, `test_native_host.py`, `test_platform.py`
57
+ - **Integration** (brauchen laufenden Browser): alle anderen, Fixture `browser` skippt automatisch wenn nicht verbunden
58
+ - Bei Code-Änderungen: Tests ausführen **und** neue Tests schreiben
59
+
60
+ ## Memory-Update-Regel
61
+ Wenn sich etwas ändert → Memory-Datei updaten:
62
+ - Neue CLI-Commands oder Command-Module
63
+ - Architektur-Änderungen
64
+ - Neue Key Patterns
65
+ - Version-Bump
66
+ - Neue Dependencies
@@ -0,0 +1,75 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ Required Notice: Copyright (c) 2026 Daniel Dolezal
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
12
+
13
+ ## Distribution License
14
+
15
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
16
+
17
+ ## Notices
18
+
19
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
20
+
21
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
22
+
23
+ ## Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ ## Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ ## Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ ## Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ ## Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ ## Fair Use
44
+
45
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
46
+
47
+ ## No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ ## Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ ## Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ ## No Liability
60
+
61
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
62
+
63
+ ## Definitions
64
+
65
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
66
+
67
+ **You** refers to the individual or entity agreeing to these terms.
68
+
69
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization.
70
+
71
+ **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
+
73
+ **Your licenses** are all the licenses granted to you for the software under these terms.
74
+
75
+ **Use** means anything you do with the software requiring one of your licenses.
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: real-browser-cli
3
+ Version: 0.14.2
4
+ Summary: Control your real running browser from the terminal or Python SDK
5
+ License: # PolyForm Noncommercial License 1.0.0
6
+
7
+ Required Notice: Copyright (c) 2026 Daniel Dolezal
8
+
9
+ ## Acceptance
10
+
11
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
12
+
13
+ ## Copyright License
14
+
15
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
16
+
17
+ ## Distribution License
18
+
19
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
20
+
21
+ ## Notices
22
+
23
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
24
+
25
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
26
+
27
+ ## Changes and New Works License
28
+
29
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
30
+
31
+ ## Patent License
32
+
33
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
34
+
35
+ ## Noncommercial Purposes
36
+
37
+ Any noncommercial purpose is a permitted purpose.
38
+
39
+ ## Personal Uses
40
+
41
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
42
+
43
+ ## Noncommercial Organizations
44
+
45
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
46
+
47
+ ## Fair Use
48
+
49
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
50
+
51
+ ## No Other Rights
52
+
53
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
54
+
55
+ ## Patent Defense
56
+
57
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
58
+
59
+ ## Violations
60
+
61
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
62
+
63
+ ## No Liability
64
+
65
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
66
+
67
+ ## Definitions
68
+
69
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
70
+
71
+ **You** refers to the individual or entity agreeing to these terms.
72
+
73
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization.
74
+
75
+ **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
76
+
77
+ **Your licenses** are all the licenses granted to you for the software under these terms.
78
+
79
+ **Use** means anything you do with the software requiring one of your licenses.
80
+ License-File: LICENSE
81
+ Requires-Python: >=3.10
82
+ Requires-Dist: click>=8
83
+ Requires-Dist: cryptography>=48
84
+ Requires-Dist: msgpack>=1
85
+ Requires-Dist: rich>=13
86
+ Provides-Extra: fast
87
+ Requires-Dist: zstandard>=0.22; extra == 'fast'
@@ -0,0 +1,23 @@
1
+ # Privacy Policy for browser-cli
2
+ Last updated: 2026-06-14
3
+
4
+ browser-cli does not collect, transmit, sell, or share user data with the developer or any third party.
5
+
6
+ browser-cli is a local browser automation tool. The browser extension communicates with the locally installed browser-cli native messaging host so the user can control their own browser through the command line or Python SDK.
7
+
8
+ ## Local data access
9
+ Depending on the command explicitly run by the user, browser-cli may locally access browser data such as:
10
+ - tab URLs, titles, status, and window or tab group information
11
+ - page content, links, images, HTML, text, screenshots, or DOM data
12
+ - cookies, local storage, session storage, and saved browser-cli session data
13
+
14
+ This access happens only to perform the command requested by the user. The data stays on the user's device unless the user explicitly configures browser-cli to connect to another machine they control.
15
+
16
+ ## Remote control mode
17
+ browser-cli includes an optional remote control mode. If the user enables this mode, command data may be transmitted between the user's configured browser-cli client and server endpoints. This is user-configured infrastructure. The developer does not receive or operate these endpoints.
18
+
19
+ ## No analytics or tracking
20
+ browser-cli does not use analytics, telemetry, advertising, behavioral tracking, or remote code. The extension does not send data to the developer.
21
+
22
+ ## Contact
23
+ For privacy questions or security reports, please open an issue in the project repository or contact the project maintainer through the repository hosting platform.