Skip to content

Commit 33ff27c

Browse files
committed
Clean up.
1 parent 1b4a073 commit 33ff27c

14 files changed

Lines changed: 961 additions & 1288 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ that may never merge. They are not releases and are not listed here.
1919

2020
## Unreleased
2121

22+
- Clean up.
23+
2224
### Added
2325

2426
- The README now documents installing without the install script: the

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mapbox-cli"
3-
version = "0.2.2"
3+
version = "0.3.0"
44
edition = "2021"
55
description = "A command-line interface for Mapbox APIs, with commands generated at build time from OpenAPI specs."
66
repository = "https://github.com/mapbox/cli"

‎docs/commands.md‎

Lines changed: 20 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Implemented commands
22

3-
Every command the CLI ships: four auth commands, 34 API operations across 11
3+
Every command the CLI ships: four auth commands, 33 API operations across 10
44
command groups, the tilesets-cli proxy, `completion` and `generate-skills`. Each is
55
shown in both of its renderings. Which one you get is decided by `--output`, whose default
66
(`auto`) reads stdout: a terminal gets the left column, a pipe or redirect
@@ -10,7 +10,7 @@ gets the right one. See
1010
Account names, style ids and tokens in the examples are replaced; everything
1111
else is as the API sent it.
1212

13-
**29 of the 34 were run against the live API and show what came back:** 26
13+
**29 of the 33 were run against the live API and show what came back:** 26
1414
on 2026-09-01, and `fonts list`, `fonts upload` and `fonts delete` on
1515
2026-09-08, once `fonts:list`/`fonts:write` became
1616
registrable. The write operations were exercised as round trips on
@@ -29,12 +29,10 @@ commands and the flags they take — is held to `mapbox --schema` on every
2929
`cargo test` run by `tests/docs_contract.rs`, so the half of this page that
3030
can be checked cannot fall behind the binary.
3131

32-
The remaining 5 give the response shape from the spec or the docs instead
33-
of a live capture, for two different reasons. `rasterarrays get-mrt-tile`
34-
needs a raster-array job this account does not have. The other four are
35-
`search`'s: read-only and safe to run, but the credentials used to write
36-
this page have no Search Box API access, so every call answers 401 rather
37-
than a result.
32+
The remaining 4 give the response shape from the spec or the docs instead
33+
of a live capture: they're all `search`'s — read-only and safe to run, but
34+
the credentials used to write this page have no Search Box API access, so
35+
every call answers 401 rather than a result.
3836

3937
Each **Parameters** section lists only what is specific to its command. The
4038
globals every API command takes are
@@ -102,7 +100,6 @@ nests, and is typed `mapbox styles draft get`.
102100
**[Tilesets](#tilesets)** —
103101
[tilesets.get-tile](#mapbox-tilesets-get-tile) ·
104102
[tilesets.get-mvt](#mapbox-tilesets-get-mvt) ·
105-
[tilesets.get-mrt](#mapbox-tilesets-get-mrt) ·
106103
[tilesets.query](#mapbox-tilesets-query)
107104

108105
**[Tilesets CLI](#tilesets-cli)** — [tilesets-cli](#mapbox-tilesets-cli-args)
@@ -349,7 +346,7 @@ Docs: https://docs.mapbox.com/api/accounts/tokens/
349346

350347
## API command groups
351348

352-
34 operations across 11 command groups. Ten are generated from the OpenAPI specs
349+
33 operations across 10 command groups. Nine are generated from the OpenAPI specs
353350
vendored in `openapi/`; `search` is the one exception — a hand-authored
354351
spec versioned in this repo's own `custom-openapi/`, see
355352
`custom-openapi/README.md`.
@@ -367,7 +364,6 @@ operation moved to `tilesets`.
367364
| [`accounts`](#accounts) | **3** |
368365
| [`fonts`](#fonts) | **3** |
369366
| [`geocoder`](#geocoder) | **3** |
370-
| [`rasterarrays`](#raster-arrays) | **1** |
371367
| [`search`](#search) | **4** |
372368
| [`sprites`](#sprites) | **5** |
373369
| [`static-images`](#static-images) | **3** |
@@ -376,7 +372,7 @@ operation moved to `tilesets`.
376372
| [`tilequery`](#tilequery) | **1** |
377373
| [`tilesets`](#tilesets) | **2** |
378374

379-
The [Contents](#contents) list above names every one of the 34.
375+
The [Contents](#contents) list above names every one of the 33.
380376

381377
**Everything else the Mapbox specs describe is not here at all.** Not
382378
hidden, not shipped as a command that refuses: absent from the spec content
@@ -487,7 +483,7 @@ Three things worth knowing about the read forms:
487483
A command that changes something takes `--dry-run`, which prints the request
488484
it would send, on stdout, and sends nothing. Which commands those are is not
489485
a list anyone keeps: it is every `POST`, `PUT`, `PATCH` and `DELETE` — 12 of
490-
the 34 operations — plus `auth login`, `auth logout`, `auth refresh` and
486+
the 33 operations — plus `auth login`, `auth logout`, `auth refresh` and
491487
`generate-skills`. A read-only `GET` does not take it, so `mapbox styles
492488
list --dry-run` is a usage error rather than a no-op. It rehearses
493489
rather than describes: `--data` is parsed and every `--file` is read, so a
@@ -568,8 +564,8 @@ properties directly. A conforming response never reaches that case:
568564
`geocoder` requires `name`/`feature_type` on every feature, `tilequery`
569565
requires `tilequery.layer`.
570566

571-
Four of the eleven command groups can answer with bytes — `rasterarrays`,
572-
`static-images`, `static-tiles` and `tilesets`. Those bypass `--output` in
567+
Three of the ten command groups can answer with bytes — `static-images`,
568+
`static-tiles` and `tilesets`. Those bypass `--output` in
573569
both modes:
574570

575571
<table>
@@ -817,14 +813,8 @@ afterward.
817813

818814
### `mapbox fonts list`
819815

820-
The font faces an account owns.
821-
822-
#### Parameters
823-
824-
`--fresh` skips the cache. Worth knowing even outside a script: a font
825-
just uploaded does not appear without it — the API's own `Cache-Control`
826-
otherwise serves a listing from before the upload for some window
827-
afterward.
816+
The font faces an account owns. Cached: a font just uploaded may not appear
817+
for some window afterward, per the API's own `Cache-Control`.
828818

829819
#### Examples
830820

@@ -1915,8 +1905,7 @@ mapbox styles get ckstyle00000000000000001a --username user -o json > style.json
19151905
— is served through CloudFront with `max-age=900`, so a `styles get` right
19161906
after an `styles update` may still show the old document. The mutation
19171907
commands return the new state themselves, from the origin; trust that rather
1918-
than reading back. `list-files --fresh true` is the one read that rebuilds
1919-
instead of being served from cache.
1908+
than reading back.
19201909

19211910
A style document is a nested tree of layers and sources, not rows, so it
19221911
stays JSON in both modes — indented under `text`, one line under `json`.
@@ -2247,18 +2236,17 @@ beforehand.
22472236

22482237
## Tilesets
22492238

2250-
Tiles by tileset id, plus the raster-array and vector-tile lookups that key
2251-
off one: raster from the Raster Tiles API, vector from the Vector Tiles
2252-
API, MRT tiles from a raster-array job, and `query` from the Tilequery
2253-
API. Four operations, out of four different specs, under one command
2254-
group (#116) — a caller asking about a tileset is asking the same kind of
2255-
question regardless of which API answers it.
2239+
Tiles by tileset id, plus the vector-tile lookup that keys off one: raster
2240+
from the Raster Tiles API, vector from the Vector Tiles API, and `query`
2241+
from the Tilequery API. Three operations, out of three different specs,
2242+
under one command group (#116) — a caller asking about a tileset is asking
2243+
the same kind of question regardless of which API answers it.
22562244

22572245
Not to be confused with [`mapbox tilesets-cli`](#tilesets-cli), which
22582246
forwards to the separately installed Python Tilesets CLI and shares
22592247
nothing with this but the word.
22602248

2261-
The three tile commands return bytes, so `--output` does not apply on
2249+
The two tile commands return bytes, so `--output` does not apply on
22622250
them — redirect to a file. `query` returns GeoJSON.
22632251

22642252
### `mapbox tilesets get-tile`
@@ -2355,44 +2343,6 @@ $ ls -l tile.mvt
23552343
</td></tr>
23562344
</table>
23572345

2358-
### `mapbox tilesets get-mrt`
2359-
2360-
One MRT tile from a raster-array job.
2361-
2362-
#### Parameters
2363-
2364-
`--jobid <jobid>` is required and comes from the raster-array job that
2365-
produced the tiles.
2366-
2367-
#### Examples
2368-
2369-
```sh
2370-
mapbox tilesets get-mrt --jobid <jobid> <tileset-id> 12 2048 1361 > tile.mrt
2371-
```
2372-
2373-
#### Outputs
2374-
2375-
Not exercised: this account has no raster-array job. A `--jobid` that does
2376-
not exist gets a 500 rather than a 404, so the error says nothing useful
2377-
about what was wrong:
2378-
2379-
<table>
2380-
<tr><th width="50%">Terminal — <code>-o text</code></th><th width="50%">Agent — <code>-o json</code></th></tr>
2381-
<tr><td>
2382-
2383-
```
2384-
Error: Internal Server Error (HTTP 500)
2385-
```
2386-
2387-
</td><td>
2388-
2389-
```json
2390-
{"code":"http_500","message":"Internal Server Error","status":500}
2391-
```
2392-
2393-
</td></tr>
2394-
</table>
2395-
23962346
### `mapbox tilesets query`
23972347

23982348
What features a vector tileset has at or near a point.

‎openapi/api-accounts/tokens-api.yaml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,6 @@ components:
217217
description: The username of the account that owns the tokens.
218218
schema:
219219
type: string
220-
TokenId:
221-
name: token_id
222-
in: path
223-
required: true
224-
description: The unique identifier of the token (the `id` field of a token object), not the token
225-
string itself.
226-
schema:
227-
type: string
228220
responses:
229221
BadRequest:
230222
description: The request was malformed — for example, the token string was supplied where a token

‎openapi/api-fonts/fonts.production.v1.yaml‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,14 @@ servers:
1818
security:
1919
- AccessTokenQuery: []
2020
tags:
21-
- name: health
22-
description: API health check
2321
- name: fonts
2422
description: Manage and retrieve custom fonts
25-
- name: fontstacks
26-
description: Retrieve Mapbox fontstack glyphs
27-
- name: models
28-
description: Retrieve 3D model assets
2923
components:
3024
securitySchemes:
3125
AccessTokenQuery:
3226
type: apiKey
3327
in: query
3428
name: access_token
35-
parameters:
36-
fresh:
37-
name: fresh
38-
in: query
39-
required: false
40-
schema:
41-
type: boolean
42-
description: If true, sets Cache-Control to no-cache.
4329
schemas:
4430
Error:
4531
type: object
@@ -113,7 +99,6 @@ paths:
11399
security:
114100
- AccessTokenQuery: []
115101
parameters:
116-
- $ref: '#/components/parameters/fresh'
117102
- name: owner
118103
in: path
119104
required: true

‎openapi/api-gl/static-images.production.v1.yaml‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,6 @@ components:
158158
schema:
159159
type: string
160160
example: pin-s+ff0000(-118.2437,34.0522),pin-s+0000ff(-118.2537,34.0422)
161-
bbox:
162-
name: bbox
163-
in: path
164-
required: true
165-
description: |
166-
Bounding box as `[minlon,minlat,maxlon,maxlat]`. Coordinates are
167-
WGS84 longitude/latitude. `minlon` must be less than `maxlon` and
168-
`minlat` less than `maxlat`, otherwise the request returns `422`.
169-
170-
The square brackets may be sent literally or percent-encoded as `%5B`
171-
and `%5D`; both are accepted. Note that `curl` treats `[` and `]` as
172-
glob characters, so a literal bounding box on the command line needs
173-
either the percent-encoded form or the `--globoff` flag.
174-
schema:
175-
type: string
176-
example: '[-77.043686,38.892035,-76.933086,38.942035]'
177161
lon:
178162
name: lon
179163
in: path
@@ -311,24 +295,6 @@ components:
311295
schema:
312296
type: string
313297
example: waterway-label
314-
padding:
315-
name: padding
316-
in: query
317-
required: false
318-
description: |
319-
Padding in pixels around the overlay or bounding box. Accepts 1 to 4
320-
comma-separated integers (CSS shorthand order: top, right, bottom,
321-
left). Only applies to `auto` and bounding box positioning; using it on
322-
any other endpoint returns `422`.
323-
324-
Left plus right padding must be less than `width`, and top plus bottom
325-
padding must be less than `height`, otherwise the request returns
326-
`422`.
327-
328-
Defaults to 5% of the smallest dimension, up to a maximum of 12 pixels.
329-
schema:
330-
type: string
331-
example: 50,20,50,20
332298
addlayer:
333299
name: addlayer
334300
in: query

0 commit comments

Comments
 (0)