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:
cargo install texspaceServerless 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:
texspace txg --txg <PATH_OR_URL> --mode <MODE> [OPTIONS] [QUERY]| Flag | Default | Description |
|---|---|---|
--txg <SPEC> | required | Local directory, single .txg file, or https://... base URL (e.g. https://shards.texspace.dev/txg/v2). |
--mode <MODE> | search | search | 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> | 2000 | Radius 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. |
--spatial | false | Include S2/H3/Geohash/Plus Code encodings in --mode enrich. |
--geometry | false | Include compact GeoJSON polygon geometry in --mode layer / --mode enrich. |
--no-reverse, --no-timezone | false | Skip reverse or timezone lookup in --mode enrich. |
--limit <N> | 5 | Maximum results returned. |
--json | false | Emit raw pretty-printed JSON. |
Examples:
# 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():
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.txgtexspace 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: [...] }):
texspace pack-overlay \
-i stores.csv \
--name acme_stores \
--description "Global retail stores" \
-o stores.txgtexspace 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:
# 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.dbData Management & Live Sync Commands#
| Command | Purpose |
|---|---|
texspace pull --list | List 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#
| Command | Example |
|---|---|
texspace query | texspace query --db data/global "2750 Middlefield Rd, Palo Alto, CA 94306" --profile delivery --compact |
texspace structured | texspace structured --db data/global --housenumber 4865 --street "Mission St" --postalcode 94112 |
texspace reverse | texspace reverse --db data/global --lat 37.72047 --lon -122.43765 --limit 3 |
texspace autocomplete | texspace autocomplete --db data/global "4865 Miss" --focus-lat 37.72 --focus-lon -122.44 |
texspace nearby | texspace nearby --db data/global "hospitals within 3km of SFO" |
texspace geoip | texspace geoip --db data/global 8.8.8.8 2606:4700:4700::1111 --json |
texspace timezone | texspace timezone --db data/global --lat 37.7749 --lon -122.4194 --json |
texspace batch | texspace batch --db data/global --input in.csv --output out.csv --threads 0 |
texspace serve | texspace serve --db data/global --port 4000 --osm-sync minute |
texspace mcp | texspace mcp --db data/global |
texspace build* | build, build-router, build-parcels, build-buildings, build-overlay, build-geoip, build-tz |
Related References#
- HTTP REST API Reference — Every endpoint exposed by
texspace serve. - AI Agents & MCP Guide — Connecting
texspace mcpto Claude Desktop, Cursor, or Windsurf. - Hosting, Caching & Self-Hosting — Systemd, Docker, and live OSM replication setup.