Technical Reference · CLI

CLI Reference (texspace)

The texspace command-line tool lets you query remote or local datasets, pack custom territory polygons (pack-layer) and private location overlays (pack-overlay), download pre-built shards or offline mobile packs, geocode CSV files locally, and run the HTTP REST or MCP servers.

Install from crates.io or download pre-built binaries from GitHub Releases:

bash
cargo install texspace

Serverless Commands (Zero Local Download Required)#

texspace txg — Query Local or Remote .txg Archives#

Query static .txg archives directly over HTTP Range requests or from local disk without downloading SQLite databases:

bash
texspace txg --txg <PATH_OR_URL> --mode <MODE> [OPTIONS] [QUERY]
FlagDefaultDescription
--txg <SPEC>requiredLocal directory, single .txg file, or https://... base URL (e.g. https://shards.texspace.dev/txg/v2).
--mode <MODE>searchsearch | verify | autocomplete | reverse | timezone | layer | enrich | nearby.
--lat <F64>, --lon <F64>—Target coordinate (reverse, timezone, layer, enrich, or coordinate nearby).
--focus-lat, --focus-lon—Soft proximity focus bias.
--radius <METERS>2000Radius in meters for --mode nearby.
--category <STR>—Category filter for --mode nearby (station, warehouse, charger, park, etc.).
--layers <PATHS>—Comma-separated or repeatable TXGL paths/URLs for --mode layer / --mode enrich.
--overlays <PATHS>—Comma-separated or repeatable TXGO overlay paths/URLs fused into search, autocomplete, reverse, nearby.
--spatialfalseInclude S2/H3/Geohash/Plus Code encodings in --mode enrich.
--geometryfalseInclude compact GeoJSON polygon geometry in --mode layer / --mode enrich.
--no-reverse, --no-timezonefalseSkip reverse or timezone lookup in --mode enrich.
--limit <N>5Maximum results returned.
--jsonfalseEmit raw pretty-printed JSON.

Examples:

bash
# Forward search (handles typos like "4865 Mision St")
texspace txg --txg https://shards.texspace.dev/txg/v2 "4865 Mision St, San Francisco, CA 94112"

# Address verification
texspace txg --txg https://shards.texspace.dev/txg/v2 --mode verify "4865 Mission St Apt 4B 94112 Oakland"

# Parallel enrichment (reverse + timezone + custom polygon layers)
texspace txg --txg https://shards.texspace.dev/txg/v2 --mode enrich \
  --lat 37.72047 --lon -122.43765 \
  --layers layers/us_states.txg,layers/world_countries.txg --json

# Relational nearby search with a private overlay
texspace txg --txg https://shards.texspace.dev/txg/v2 --mode nearby \
  --overlays ./stores.txg "stores within 5km of 2750 Middlefield Rd, Palo Alto, CA"

texspace pack-layer — Pack GeoJSON Polygons into Static TXGL#

Compile any GeoJSON Polygon / MultiPolygon file (or .geojsonl) into a static point-in-polygon archive for geo.lookupLayer() and geo.enrich():

bash
texspace pack-layer \
  -i delivery_zones.geojson \
  --name delivery_zones \
  --description "Bay Area express delivery zones" \
  --id-prop zone_id \
  --simplify 0.0005 \
  -o delivery_zones.txg

texspace pack-overlay — Pack CSV / TSV / GeoJSON Sites into Static TXGO#

Compile a store locator, warehouse catalog, or asset list into a static overlay archive for Texspace.open(..., { overlays: [...] }):

bash
texspace pack-overlay \
  -i stores.csv \
  --name acme_stores \
  --description "Global retail stores" \
  -o stores.txg

texspace pack-txg / pack-tz-txg / pack-wasm / pack-mobile#

Build custom serverless archives, air-gapped browser city packs, or offline mobile SQLite packs from local shards:

bash
# Pack SQLite shards into serverless TXG v2 archives
texspace pack-txg --from data/global --out data/txg_v2 --jobs 8

# Pack timezone database into static tz.txg
texspace pack-tz-txg --from data/global/tz.db --out data/txg_v2/tz.txg

# Pack a 100% offline browser WASM bundle (.txw.zst)
texspace pack-wasm --from data/global --id sf_city --name "San Francisco, CA" \
  --bbox 37.70,-122.52,37.82,-122.35 -o sf_city.txw.zst

# Pack offline iOS/Android mobile SQLite packs
texspace pack-mobile metro --from data/global --id sf_bay \
  --bbox 37.18,-122.55,38.05,-121.65 -o sf_bay.db
texspace pack-mobile world-base --from data/global -o world_base.db

Data Management & Live Sync Commands#

CommandPurpose
texspace pull --listList all available server shard presets (us_ca, us, eu, apac, americas, planet) and download sizes.
texspace pull <TARGET> -o <DIR> [--with-buildings] [--with-parcels] [--with-geoip] [--with-tz] [--with-all]Download pre-built SQLite shards & optional sidecars from Cloudflare R2 CDN.
texspace pull --mobile <PACKS|--near lat,lon> -o <DIR>Download compact mobile offline packs (world_base, sf_city, london, etc.).
texspace update --db <DIR> [--check] [--prune-delta]Incremental SHA-256 diff upgrade + atomic shard swap.
texspace sync-osm --db <DIR> --source minute|hour|day [--watch]Live OpenStreetMap .osc.gz replication into <db>/osm_delta.db.
texspace apply-osc --db <DIR> diff1.osc.gz ...Apply local .osc / .osc.gz changefiles offline.
texspace audit --db <DIR> [--check]Verify shard integrity, entity counts, and data-hygiene assertions.

Local Engine, Server & MCP Commands#

CommandExample
texspace querytexspace query --db data/global "2750 Middlefield Rd, Palo Alto, CA 94306" --profile delivery --compact
texspace structuredtexspace structured --db data/global --housenumber 4865 --street "Mission St" --postalcode 94112
texspace reversetexspace reverse --db data/global --lat 37.72047 --lon -122.43765 --limit 3
texspace autocompletetexspace autocomplete --db data/global "4865 Miss" --focus-lat 37.72 --focus-lon -122.44
texspace nearbytexspace nearby --db data/global "hospitals within 3km of SFO"
texspace geoiptexspace geoip --db data/global 8.8.8.8 2606:4700:4700::1111 --json
texspace timezonetexspace timezone --db data/global --lat 37.7749 --lon -122.4194 --json
texspace batchtexspace batch --db data/global --input in.csv --output out.csv --threads 0
texspace servetexspace serve --db data/global --port 4000 --osm-sync minute
texspace mcptexspace mcp --db data/global
texspace build*build, build-router, build-parcels, build-buildings, build-overlay, build-geoip, build-tz