CommandBox stores information about each of the servers you've ever started inside
~/.CommandBox/servers.jsonso it can remember settings from one run to the next.
You can see an overview of your servers and what state they're in with the
If you have many servers, you can provide parameters to help filter the results from
# All servers containing the word "foo"
server list foo
# Running servers
server list --running
To list only the servers that have been started in a given directory, use the
server list --local
You can take a quick look at the what's been happening with the
server logcommand or use the
server statuscommand to see more detailed information including the arguments used previously to start/stop the server.
Servers are uniquely identified by their full path, but they also have a short name which defaults to the immediate folder containing their web root. The
start, etc commands can be run in the web root for a server, or in any working directory as long as you reference the server's short name.
Another handy shortcut is the
server cdcommand that will change the current working directory of the interactive shell to the web root of a named server.
server cd site1
server cd site2
Info Server name is the first parameter to all server commands and tab completion works too, making it as easy as possible for you.
You can get information about a server using the
server infocommand. Add the
--JSONflag to get the data back in a JSON format. The
propertyparameter will allow you to retrieve a single value for scripting mashups.
server info --JSON
server info property=serverHomeDirectory
server info property=consoleLogPath
If you want to wipe all configuration, logs, and WEB-INF files for a server, use the
server forgetcommand. This will also remove any administrator settings you may have saved including data sources, mail servers, and server mappings.
You can forget all your servers at once too if you want to start with a clean slate. This command will stop and forget all servers.
server stop --all --forget
You can easily forget all servers which have not been started for a certain period of time with the
server prunecommand. It accepts the number of days that need to have passed since a server was last started in order to prune it.
server prune days=30
# Skip the confirmation check
server prune --force
You can also get back just a JSON representation of servers matching the filter with the
--jsonflag. The JSON will be in the same format as the
server list --jsoncommand.
server prune 100 --json