Commands Reference#

Complete reference for all GeoServer CLI commands. Commands are organized by functionality.

Configuration#

Manage CLI configuration files and settings.

  • Configuration - Initialize, show, and validate configuration files

Workspaces#

Manage GeoServer workspaces - logical containers for organizing data.

  • Workspaces - List, get, create, and delete workspaces

Datastores#

Configure data source connections (PostGIS, Shapefiles, etc.).

  • Datastores - Manage datastores and connection parameters

Styles#

Manage styling for layers using SLD (Styled Layer Descriptor).

  • Styles - Create, update, and manage styles

Publishing#

Publish layers from various data sources to GeoServer.

Layers#

Configure and manage published layers.

  • Layers - Update layer configuration (styles, enabled, advertised)

Coverages#

Manage raster data and coverage stores.

  • Coverages - Manage coverage stores and raster layers (GeoTIFF, ImageMosaic, etc.)

QGIS Integration#

Generate QGIS connection files and projects for easy access to GeoServer layers.

Version#

Display version information.

  • Version - Show CLI version and build information

Quick Reference#

Common Workflows#

Initial Setup:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 1. Initialize configuration
./geoserver-cli config init

# 2. Create workspace
./geoserver-cli workspace create my_workspace

# 3. Create datastore
./geoserver-cli store create postgis -w my_workspace --params @pg_conn.json

# 4. Publish layers
./geoserver-cli publish postgis --all -w my_workspace

Style Management:

1
2
3
4
5
# Create style
./geoserver-cli style create my_style --sld @style.sld

# Apply to layer
./geoserver-cli layer update my_layer --default-style my_style

QGIS Export:

1
2
3
4
5
# Export connections
./geoserver-cli qgis export connections -w my_workspace -o connections.xml

# Export project
./geoserver-cli qgis export project -w my_workspace -o layers.qgs

Command Structure#

All commands follow a consistent structure:

1
./geoserver-cli <command> <subcommand> [flags] [arguments]

Global Flags#

Available on all commands:

  • --config, -c - Config file selector (file path or name)
  • --base-url - GeoServer REST base URL
  • --user - GeoServer username
  • --password - GeoServer password
  • --timeout - HTTP timeout (e.g., 10s, 1m)

Workspace Flag#

Many commands support workspace selection:

  • --workspace, -w - Workspace name (defaults to GEOSRVCLI_DEFAULT_WORKSPACE)

Getting Help#

For detailed help on any command:

1
2
./geoserver-cli <command> --help
./geoserver-cli <command> <subcommand> --help

Example:

1
2
./geoserver-cli workspace --help
./geoserver-cli publish postgis --help