Administer Geoserver using a CLI
CUGOS July 2013
• What is Geoserver Shell?
• Why does Geoserver need a CLI?
• What are we administering with CLI?
• How does it work?
• What does it look like in action?
What is it?
• Administer Geoserver from a command
line interface (CLI)
• Uses Geoserver Rest interface
• Based on Spring Shell
• Uses GeoServer Manager and GeoTools
• Written in Java
• Open Source MIT License
• Hosted on Github
Why a CLI?
• Web UI is a major feature
• Non developers can load data and styles
• CLI is quick, efﬁcient and scriptable
• Once a script is written it can be replayed
on other Geoservers (set up dev, then test,
• Download 0.1 release
• Put bin directory on path
• run gs-shell
• Requires Java
• Open source project from Spring Source
• Shell extracted from Spring Roo
• Spring Roo is a Java RAD tool for creating
• Interactive shell environment
• Tab completion for commands, arguments,
• History support (up and down arrows)
• Knows your commands and when you can
• Commands for each major Geoserver
• Methods in command construct a URL,
create a request body (xml, ﬁle) and make
an Http Request to Geoserver. The
Geoserver response is parsed and displayed
to the user
• Scripts contain the same commands entered
• History support saves session to geoservershell.log
$ gs-shell --cmdﬁle mycommands.gs
gs-shell> script --ﬁle naturalearth_countries.gs
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.