GeoServer CLI#

A powerful command-line tool for managing GeoServer via its REST API, built with Go.

Features#

  • Workspace Management: Create, list, get, and delete workspaces
  • Datastore Management: Full CRUD operations for GeoServer datastores
  • Style Management: Upload and manage SLD styles
  • Layer Publishing: Publish layers from PostGIS and file sources
  • Layer Configuration: Configure layer properties (styles, enabled, advertised)
  • QGIS Integration: Export connection files and project files for QGIS
  • Configuration Management: Flexible config system with environment variable support

Quick Start#

1
2
3
4
5
6
7
8
# Build the CLI
go build -o geoserver-cli ./cmd/geoserver-cli

# Initialize configuration
./geoserver-cli config init

# List workspaces
./geoserver-cli workspace list

Installation#

See the Installation Guide for detailed instructions.

Documentation Structure#

  • Getting Started: Installation, configuration, and quick start
  • Commands: Complete command reference
  • Guides: Step-by-step guides for common tasks
  • Reference: Configuration and environment variables

Example Usage#

Publish Layers from PostGIS#

1
2
3
4
5
# Publish all spatial tables
./geoserver-cli publish postgis --all -w my_workspace

# Publish specific tables
./geoserver-cli publish postgis --layers roads,buildings -w my_workspace

Export QGIS Project#

1
2
# Generate QGIS project file
./geoserver-cli qgis export project -w my_workspace -o layers.qgs

Manage Styles#

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

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

Contributing#

Contributions are welcome! See the Contributing Guide for details.

License#

See LICENSE file for details.