Skip to content

Commit c817fc0

Browse files
docs: improve README, docs, and add usage examples
1 parent e265693 commit c817fc0

7 files changed

Lines changed: 331 additions & 30 deletions

File tree

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,53 @@ browserget doctor
8888
browserget install chrome --json
8989
```
9090

91+
## Examples
92+
93+
### CI pipeline (idempotent)
94+
95+
```bash
96+
pip install browserget
97+
browserget ensure chrome chromedriver
98+
CHROME_PATH=$(browserget path chrome)
99+
```
100+
101+
### Install a browser and its matching driver
102+
103+
```bash
104+
browserget install chrome
105+
browserget install chromedriver --for chrome
106+
```
107+
108+
### Pin a specific version
109+
110+
```bash
111+
browserget install firefox --version 131.0
112+
browserget install geckodriver --for firefox
113+
```
114+
115+
### List and clean up
116+
117+
```bash
118+
browserget list
119+
browserget remove chrome --version 130.0.6723.69
120+
browserget doctor
121+
```
122+
123+
### JSON output
124+
125+
```bash
126+
browserget list --json
127+
```
128+
129+
Output:
130+
131+
```json
132+
[
133+
{"name": "chrome", "version": "131.0.6778.87", "path": "/home/user/.browserget/chrome/131.0.6778.87"},
134+
{"name": "chromedriver", "version": "131.0.6778.87", "path": "/home/user/.browserget/chromedriver/131.0.6778.87"}
135+
]
136+
```
137+
91138
## Supported targets
92139

93140
| Target | Type | Upstream source |

docs/architecture/overview.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,32 @@ a single responsibility and can be tested in isolation.
66
## Module diagram
77

88
```
9-
┌─────────────────────────────────────────────────────────┐
10-
│ cli.py │
11-
│ Typer app, command parsing, output formatting │
12-
└────────────┬────────────────────────┬───────────────────┘
13-
│ │
14-
┌───────▼───────┐ ┌───────▼───────┐
15-
│ installers/ │ │ registry.py │
16-
│ chrome.py │ │ (JSON store) │
17-
│ firefox.py │ └───────────────┘
18-
│ edge.py │
19-
│ chromedriver │
20-
│ geckodriver │
21-
│ edgedriver │
22-
└───┬───┬───┬───┘
23-
│ │ │
24-
┌──────▼┐ ┌▼───▼────┐ ┌────────────┐
25-
│http.py│ │parsers/ │ │ cache.py │
26-
│(async)│ │ cft.py │ │ (paths) │
27-
└───────┘ │firefox │ └────────────┘
28-
│edge.py │
29-
│gecko.py │
30-
└─────────┘
9+
┌────────────────────────────────────────────────────────────┐
10+
│ cli.py │
11+
│ Typer app, command parsing, output formatting │
12+
└────────────┬───────────────────────────┬───────────────────┘
13+
│ │
14+
┌───────▼────────┐ ┌─────────▼──────────┐
15+
│ installers/ │ │ registry.py │
16+
│ chrome.py │ │ (JSON store) │
17+
│ firefox.py │ └────────────────────┘
18+
│ edge.py │
19+
│ chromedriver │
20+
│ geckodriver │
21+
│ edgedriver │
22+
└───┬───┬───┬────┘
23+
│ │ │
24+
┌──────▼┐ │ ┌─▼───────┐ ┌─────────────┐
25+
│http.py│ │ │parsers/ │ │ cache.py │
26+
│(async)│ │ │ cft.py │ │ (paths) │
27+
└───────┘ │ │firefox │ └─────────────┘
28+
│ │edge.py │
29+
│ │gecko.py │
30+
│ └─────────┘
31+
┌────┴────┐
32+
│ system.py │
33+
│ platform.py
34+
└───────────┘
3135
```
3236

3337
## Install flow

docs/architecture/parsers.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,29 @@ and checksum URLs based on the version and platform.
3636

3737
### Edge Updates API
3838

39-
Edge and EdgeDriver versions are resolved from the Microsoft Edge Updates API.
39+
Edge browser versions are resolved from the Microsoft Edge Updates API.
4040

41-
- **URL**: `https://edgeupdates.microsoft.com/api/v1/edge`
41+
- **URL**: `https://edgeupdates.microsoft.com/api/products`
4242
- **Format**: JSON
43-
- **Structure**: An array of products, each with a `downloads` list containing
44-
platform-specific URLs and SHA-256 checksums.
45-
- **Checksums**: Provided as `Hash` fields (SHA-256) in the download entries.
43+
- **Structure**: An array of products, each with a `Product` name and a
44+
`Releases` list. Each release contains `Platform`, `Architecture`,
45+
`ProductVersion`, and an `Artifacts` array. Each artifact has `Location`,
46+
`Hash`, and `HashAlgorithm` fields.
47+
- **Checksums**: Provided as `Hash` and `HashAlgorithm` fields in the artifact
48+
entries.
4649

47-
The parser (`parsers/edge.py`) filters by target (edge or edgedriver) and
48-
platform, using the same internal platform strings as the CfT API
49-
(e.g. `win64`, `linux64`, `mac-arm64`).
50+
The parser (`parsers/edge.py`) only supports the `Stable` product and the
51+
`edge` target. It filters by the mapped `Platform` and `Architecture` and
52+
returns the first artifact for each matching release.
53+
54+
### EdgeDriver CDN
55+
56+
EdgeDriver is **not** available from the Edge Updates API. It is distributed
57+
from a separate CDN:
58+
59+
- **Latest version URL**: `https://msedgedriver.microsoft.com/LATEST_STABLE`
60+
- **Download URL**: `https://msedgedriver.microsoft.com/{version}/edgedriver_{platform}.zip`
61+
- **Format**: Zip archive, no checksums published.
5062

5163
### GeckoDriver GitHub releases
5264

docs/cli-reference/commands.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,78 @@ These options are available on `install` and `ensure` commands:
1717

1818
### install
1919

20+
Downloads and installs one or more browser or driver binaries.
21+
22+
```bash
23+
browserget install chrome
24+
browserget install chrome --version 131.0.6778.87
25+
browserget install chromedriver --for chrome
26+
```
27+
2028
::: browserget.cli.install
2129

2230
### ensure
2331

32+
Idempotent version of `install`: only downloads if the target is missing.
33+
34+
```bash
35+
browserget ensure chrome chromedriver
36+
```
37+
2438
::: browserget.cli.ensure
2539

2640
### list
2741

42+
Lists all installed artifacts in the registry.
43+
44+
```bash
45+
browserget list
46+
browserget list --json
47+
```
48+
2849
::: browserget.cli.list_cmd
2950

3051
### path
3152

53+
Prints the absolute path to an installed artifact.
54+
55+
```bash
56+
browserget path chrome
57+
browserget path chromedriver --version 131.0.6778.87
58+
```
59+
3260
::: browserget.cli.path_cmd
3361

3462
### remove
3563

64+
Removes an installed artifact from the cache and registry.
65+
66+
```bash
67+
browserget remove chrome
68+
browserget remove chrome --version 130.0.6723.69
69+
browserget remove chrome --all
70+
```
71+
3672
::: browserget.cli.remove
3773

3874
### versions
3975

76+
Lists available versions for a target from the upstream API.
77+
78+
```bash
79+
browserget versions chrome
80+
```
81+
4082
::: browserget.cli.versions
4183

4284
### doctor
4385

86+
Checks cache, disk space, and upstream API reachability.
87+
88+
```bash
89+
browserget doctor
90+
```
91+
4492
::: browserget.cli.doctor
4593

4694
## Exit codes

docs/index.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,37 @@ browserget install chromedriver --for chrome
2929
browserget doctor
3030
```
3131

32+
## Common examples
33+
34+
### Idempotent CI setup
35+
36+
```bash
37+
pip install browserget
38+
browserget ensure chrome chromedriver
39+
CHROME_PATH=$(browserget path chrome)
40+
```
41+
42+
### Pin a version
43+
44+
```bash
45+
browserget install chrome --version 131.0.6778.87
46+
browserget install chromedriver --for chrome
47+
```
48+
49+
### Manage the cache
50+
51+
```bash
52+
browserget list
53+
browserget remove chrome --version 130.0.6723.69
54+
browserget doctor
55+
```
56+
57+
### Machine-readable output
58+
59+
```bash
60+
browserget list --json
61+
```
62+
3263
## Features
3364

3465
- **7 commands**: `install`, `ensure`, `list`, `path`, `remove`, `versions`, `doctor`

0 commit comments

Comments
 (0)