Skip to main content

CLI Reference

This page lists every command. Run chartplotter <command> --help to see the flags for a command at any time.

version

Print the version and whether the S-101 Portrayal Catalogue is built into the binary.

chartplotter version

emit-assets

Generate the S-101 client assets into a directory. These files tell the browser how to draw the chart: the color tables, the symbol sprites, the line styles, and the area patterns.

chartplotter emit-assets DIR
Argument / flagDescription
DIROutput directory. The command writes the asset files here.
--s101 DIREmit from an external S-101 PortrayalCatalog directory instead of the embedded catalogue.
--css FILEPalette stylesheet under Symbols/ (default daySvgStyle.css).

bake

Generate a PMTiles archive from S-57 ENC data. Inputs can be .000 base cells, directories (scanned for *.000 and *.zip), and NOAA ENC .zip bundles. The command groups each cell with its update files (.001, .002, …) and applies them.

chartplotter bake -o OUT.pmtiles IN [IN ...]
FlagDefaultDescription
-o, --out FILEcharts.pmtilesOutput archive.
--bandsoffWrite one gap-clipped archive per navigational band (<out>-<slug>.pmtiles) so the client reproduces the best-available display.
--manifest FILEAlso write a charts-index.json manifest for the app's catalog=… option.
--base-url URLarchive basenameURL or prefix for the archive in the manifest.
--overzoomoffOverzoom every band down to the world view, so a standalone large-scale set stays visible when zoomed out.
--max-zoom NnativeCap the highest baked zoom (0 = each cell's native band max), then let the client overzoom.
--s101 DIRembeddedOverride the embedded catalogue with an external S-101 PortrayalCatalog (requires --s101-fc).
--s101-fc FILES-101 FeatureCatalogue.xml path, used with --s101.

catalog-json

Distil NOAA's ENCProdCat.xml product catalog into a compact catalog.json. The viewer loads this file to show the list of regions you can download.

chartplotter catalog-json IN.xml OUT.json
ArgumentDescription
IN.xmlNOAA ENCProdCat.xml.
OUT.jsonPath to the compact catalog to write.

serve

Serve the web frontend together with the server-side baking and tile-serving API. The frontend is built into the binary, so the server needs no files on disk. Chart imports are parsed and baked into tiles in the backend; the browser only renders pre-baked tiles.

chartplotter serve [flags]
FlagDefaultDescription
--host127.0.0.1Address to bind.
--port8080Port to bind.
--assets DIRembeddedServe static assets from this directory instead of the embedded bundle. Use this when you develop the frontend.
--cache DIRXDG cacheDirectory for regenerable baked .pmtiles tile sets. Defaults to ~/.cache/chartplotter.
--data DIRXDG dataDirectory for source ENC (district zips, raw cells). This is kept safe and never auto-deleted.
--clear-cacheoffDelete the cached baked archives on startup for a clean slate (source ENC is kept).
--s101 DIRembeddedOverride the embedded catalogue with an external S-101 PortrayalCatalog (requires --s101-fc).
--s101-fc FILES-101 FeatureCatalogue.xml path, used with --s101.

When you bind to a loopback address (127.0.0.1, localhost, or ::1), the server enforces a Host-header check on the API to guard against DNS-rebind attacks. Binding to any other address turns this off, because you have chosen to expose the server on the network.

The API

The viewer talks to the server over a small HTTP API. The main endpoints:

Method and pathWhat it does
GET /api/healthLiveness check.
POST /api/importStart a background bake job for uploaded or named ENC data.
GET /api/import/status, /api/import/eventsPoll a job's status, or stream its progress (SSE).
GET /api/packsList every baked tile pack and whether it is enabled.
POST /api/set/enable, /api/set/disableShow or hide a pack on the map (data is kept).
DELETE /api/setUnregister a tile set and remove its baked files.
GET /api/cell/<NAME>Serve a raw .000 cell, acting as a NOAA download proxy and cache.
GET /api/settingsGet or post the persisted display settings (shared across screens).
GET /api/shareGet or post the latest "share my view" snapshot.
GET /api/aux, /api/aux/<name>Aux attachment manifest, or one TXTDSC/PICREP file on demand.
GET /api/vessel, /api/ais (+ /stream)NMEA 0183 vessel state and AIS targets, with SSE streams.

The frontend also fetches tiles from /tiles/<set>/….

simulate

Run an NMEA 0183 traffic generator over TCP, useful for testing the own-ship and AIS overlays without live hardware.

chartplotter simulate [flags]
FlagDefaultDescription
--host127.0.0.1Bind host.
--port10110Bind port (IANA NMEA-0183-over-IP).
--center LAT,LON38.978,-76.478Own-ship start position.
--course45Own-ship course, degrees true.
--speed6Own-ship speed, knots.
--targets6Number of AIS targets.
--collisiononPut one target on a collision course (--no-collision to disable).
--seed1RNG seed for reproducible scenarios.
--cell FILES-57 cell to keep traffic in navigable water.