@@ -120,7 +120,9 @@ tool = "1.2.3"
120120### Guidelines
121121
122122- major, minor, patch - ` 0-9 ` of any length
123- - pre, build - ` a-z ` , ` 0-9 ` , ` - ` , ` . `
123+ - pre, build - ` a-z ` , ` A-Z ` , ` 0-9 ` , ` - ` , ` _ ` , ` . `
124+ - Must start with a letter or number.
125+ - A leading ` v ` or ` V ` prefix is accepted and ignored (` v1.2.3 ` ).
124126
125127> [ Learn more about this format!] ( https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions )
126128
@@ -138,31 +140,65 @@ tool = "2025-02-26"
138140
139141- ` <year>-<month> ` - 2024-02
140142- ` <year>-<month>-<day> ` - 2024-02-26
141- - ` <year>-<month>-<day>.<build> ` - 2024-02-26.123
142- - ` <year>-<month>-<day>_<build> ` - 2024-02-26_123
143- - ` <year>-<month>-<day>.<build>-<pre> ` - 2024-02-26.123-alpha.0
144- - ` <year>-<month>-<day>_<build>-<pre> ` - 2024-02-26_123-alpha.0
145143- ` <year>-<month>-<day>-<pre> ` - 2024-02-26-alpha.0
144+ - ` <year>-<month>-<day>+<build> ` - 2024-02-26+123
145+ - ` <year>-<month>-<day>-<pre>+<build> ` - 2024-02-26-alpha.0+123
146146
147147### Guidelines
148148
149- - year - ` 0-9 ` of 1 -4 length
149+ - year - ` 0-9 ` of 2 -4 length
150150 - If the year is not YYYY format, it will use the year 2000 as the base. For example, ` 24 ` becomes
151151 ` 2024 ` , and ` 124 ` becomes ` 2124 ` .
152152- month - ` 0-9 ` of 1-2 length
153153 - Supports with and without a leading zero (` 02 ` vs ` 2 ` ).
154154 - Does not support invalid months (` 0 ` or ` 13 ` ).
155155- day - ` 0-9 ` of 1-2 length
156- - Can be omitted, even with build/ pre.
156+ - Can be omitted, even with pre/build .
157157 - Supports with and without a leading zero (` 02 ` vs ` 2 ` ).
158158 - Does not support invalid days (` 0 ` or ` 32 ` ).
159- - build - ` 0-9 ` of any length
160- - Also known as a "micro" number.
161- - The leading dot ` . ` format is preferred.
162- - pre - ` a-z ` , ` 0-9 ` , ` - ` , ` . `
159+ - pre - ` a-z ` , ` A-Z ` , ` 0-9 ` , ` - ` , ` _ ` , ` . `
160+ - Must start with a letter, so that it is not mistaken for a day number.
161+ - build - ` a-z ` , ` A-Z ` , ` 0-9 ` , ` - ` , ` _ ` , ` . `
162+ - Uses the same ` + ` prefixed build metadata syntax as semver.
163+ - A leading ` v ` or ` V ` prefix is accepted and ignored (` v2024-02 ` ).
164+
165+ :::caution
166+
167+ The dot (` 2024-02-26.123 ` ) and underscore (` 2024-02-26_123 ` ) suffixed "micro" build segments from
168+ older proto versions were removed in v0.59. Use build metadata instead, for example
169+ ` 2024-02-26+123 ` .
170+
171+ :::
163172
164173> [ Learn more about this format!] ( https://calver.org/#scheme )
165174
175+ ## Version scopes<VersionLabel version = " 0.59.0" />
176+
177+ Both version formats support an optional scope, which is a named prefix attached to the version
178+ with a dash. What a scope represents is defined by each tool's plugin — for example, the built-in
179+ Java plugin uses scopes to choose a [ distribution vendor] ( ./tools ) — but the format itself is
180+ universal.
181+
182+ ``` toml title=".prototools"
183+ java = " openjdk-21.0.2"
184+ jdk = " temurin-21"
185+ ```
186+
187+ ### Syntax
188+
189+ - ` <scope>-<version> ` - openjdk-21.0.2, zulu-2026-01-15
190+ - ` <scope>-<requirement> ` - temurin-21, ^zulu-26
191+
192+ ### Guidelines
193+
194+ - scope - ` a-z ` , ` A-Z ` , ` 0-9 ` , ` - ` , ` _ ` , ` . `
195+ - Must start with a letter or number.
196+ - May itself contain dashes, as the scope ends where a valid version or requirement begins. For
197+ example, ` graalvm-community-24.1.2 ` is the scope ` graalvm-community ` with the version ` 24.1.2 ` .
198+ - Scopes also work within [ requirements and ranges] ( #requirements-and-ranges ) , for example
199+ ` temurin-21 || zulu-22 ` .
200+ - Available version lists are fetched and cached separately for each scope.
201+
166202## Requirements and ranges
167203
168204Besides an explicit version, we also support partial versions known as version requirements or
@@ -178,8 +214,9 @@ tool-c = ">=2000-10"
178214
179215### Syntax
180216
181- - Requirement - ` [<op>]<pattern> ` - ` 1.2.3 ` , ` >4.5 ` , ` ~3 ` , ` ^2000-10 ` , etc
182- - AND range - ` <requirement>[,] <requirement> ... ` - ` >=1, <2 ` , ` ^1.3 <=1.3.9 ` , etc
217+ - Requirement - ` [<op>]<pattern> ` - ` 1.2.3 ` , ` >4.5 ` , ` ~3 ` , ` ^2000-10 ` , ` 1.x ` , etc
218+ - AND range - ` <requirement>[,|&&] <requirement> ... ` - ` >=1, <2 ` , ` >=1 && <2 ` , ` ^1.3 <=1.3.9 ` ,
219+ etc
183220- OR range - ` <requirement> || <requirement> ... ` - ` ^1.2 || ^2.3 ` , ` ~2000-10 || ~2010-2 ` , etc
184221
185222### Guidelines
@@ -191,9 +228,11 @@ tool-c = ">=2000-10"
191228 compatible)
192229 - To specify an _ exact_ version, use the ` = ` operator explicitly.
193230- pattern
194- - Dot-separated semver, with optional major and patch numbers.
231+ - Dot-separated semver, with optional minor and patch numbers.
195232 - Dash-separated calver, with optional month and day numbers.
196- - Pre-release and build metadata are only supported when suffixed to full versions.
233+ - Numbers may be a wildcard (` * ` , ` x ` , ` X ` ) to match any value, for example ` 1.x ` or ` 2024-2-* ` .
234+ - May be prefixed with a [ version scope] ( #version-scopes ) .
235+ - Pre-releases may be suffixed to partial versions, but must start with a letter.
197236
198237For example, if you want to use ` npm ` 11.6.2 but 11.6.3 has an issue, use:
199238` npm = "^11.6.4 || =11.6.2" `
0 commit comments