Skip to content
getgeolens.com

CLI & Manifests

The GeoLens CLI (geolens) is the fastest way to get data into an instance from a terminal or CI pipeline. It wraps the Python SDK to publish single files, scan directories, export STAC metadata, and apply declarative manifests (geolens.yaml) that describe a whole catalog.

Terminal window
pip install geolens-cli # installs the `geolens` command
# or, for an isolated tool install:
pipx install geolens-cli

Verify the install:

Terminal window
geolens --version
geolens --help

Log in to an instance and store credentials. The instance URL is the API base — include the /api suffix:

Terminal window
geolens login http://localhost:8080/api
# prompts for username and password (admin / admin on a fresh install)

By default the bearer token is stored in your operating system keyring. Pass --no-keyring to fall back to a credentials.toml file instead (useful on headless hosts without a keyring service):

Terminal window
geolens login https://geolens.example.com/api --no-keyring

You can also store a token or API key non-interactively — handy for scripts:

Terminal window
geolens login https://geolens.example.com/api --token "$JWT"
geolens login https://geolens.example.com/api --api-key "$GEOLENS_API_KEY"

Check who you are, or clear credentials:

Terminal window
geolens whoami # prints the active user and instance
geolens logout # removes stored credentials for the active instance

geolens publish uploads one local vector or raster file and runs the full ingest flow (upload → preview → commit), then prints the new dataset’s URL:

Terminal window
geolens publish ./city-parks.geojson --name "City Parks"
geolens publish ./elevation.tif --name "Elevation" --description "10m DEM"

By default the command waits for ingestion to resolve the dataset id. Use --no-wait to return immediately with a job-search URL instead:

Terminal window
geolens publish ./big-raster.tif --no-wait

geolens scan walks a directory and reports what would be ingested — a dry run with no upload. Use it to preview a bulk import:

Terminal window
geolens scan ./gis-exports
geolens scan ./gis-exports --include-ext .gpkg,.tif --max-depth 2
geolens scan ./gis-exports --json # machine-readable output

For multi-dataset catalogs that you want to version and re-apply, describe your sources in a geolens.yaml manifest and apply it declaratively.

Terminal window
geolens init # scaffold ./geolens.yaml
geolens validate geolens.yaml # local schema check — no API call
geolens apply geolens.yaml # validate + apply via the GeoLens API
geolens apply geolens.yaml --dry-run # preview apply outcomes without writes

Each dataset carries a stable key, so re-applying an edited manifest updates the matching datasets instead of creating duplicates.

The top level requires manifest_version: "1", a catalog block, and a non-empty datasets array.

catalog — required title; optional description, organization, and a contact object (name, email, url).

datasets[]

FieldRequiredNotes
keyYesStable identity for idempotent apply. Lowercase a–z 0–9 . _ -, up to 128 chars.
titleYesHuman-readable dataset title.
descriptionNoLonger description.
sourcesYesOne or more source objects (below).
metadataNoTags, CRS, license, bbox (below).
publicationYesPublication intent (below).

sources[]

FieldRequiredNotes
typeYesOne of vector, raster_cog, vrt.
uriYesRelative path, https://, or s3:// / gs:// / az:// / abfs:// URI.
formatNoDriver hint, e.g. geojson, gpkg.
layerNoLayer name for multi-layer sources.
title / descriptionNoPer-source overrides.

metadata (all optional) — tags (string array), organization, crs (EPSG:NNNN), license, attribution, bbox ([minx, miny, maxx, maxy] in WGS84).

publication — required intent, one of draft, ready, internal, published.

manifest_version: "1"
catalog:
title: Regional Open Data
description: Public datasets published by the Regional Data Office.
organization: Regional Open Data Office
datasets:
- key: regional-trails
title: Regional trails
description: Recreational trail network.
sources:
- type: vector
uri: https://data.example.com/trails.geojson
format: geojson
metadata:
tags: [trails, recreation]
crs: EPSG:4326
license: CC-BY-4.0
attribution: Regional Open Data Office
bbox: [-78.0, 38.0, -76.5, 39.5]
publication:
intent: ready

Export STAC API 1.0 item metadata for a raster dataset (vector datasets are rejected with a clear message):

Terminal window
geolens export stac <dataset_id> # pretty JSON to stdout
geolens export stac <dataset_id> -o item.json # write to a file
geolens export stac <dataset_id> --compact # single line, for piping to jq

The CLI is built for pipelines — authenticate via environment variables, validate locally, then apply. Every command accepts --json for machine-readable output and returns a non-zero exit code on failure.

Terminal window
export GEOLENS_INSTANCE=https://geolens.example.com/api
export GEOLENS_TOKEN=${{ secrets.GEOLENS_TOKEN }}
geolens validate geolens.yaml # fails the build on schema errors
geolens apply geolens.yaml --json # apply and emit a JSON report

These apply to every command:

FlagEffect
--instance <url>Override the active instance for this command.
--jsonMachine-readable JSON output.
-v, --verboseDebug logging to stderr.
-q, --quietSuppress non-error output.
--versionPrint the CLI version and exit.