Manage your Servers.com bare metal servers, cloud servers, and infrastructure directly from the terminal.
srvctl wraps the Servers.com Public API into a fast, scriptable command-line interface built in Go.
brew tap serverscom/serverscom
brew install srvctldocker pull ghcr.io/serverscom/srvctl:latest
docker run --rm -it ghcr.io/serverscom/srvctl:latest --helpDownload the latest release for your OS and architecture from the Releases page.
Create a context with your Servers.com API token:
$ srvctl login default
Enter API token: *****
Successfully logged in with context "default"
Context "default" set as defaultThe config file is stored at $XDG_CONFIG_HOME/srvctl/config.yaml, if XDG_CONFIG_HOME exists.
Otherwise it will rely on $HOME/.config/srvctl/config.yaml.
You can override this with the SRVCTL_CONFIG_PATH environment variable.
srvctl supports multiple contexts, allowing you to manage several Servers.com accounts or API endpoints from a single installation:
globalConfig: {}
defaultContext: default
contexts:
- name: default
endpoint: https://api.servers.com/v1
token: <YOUR_API_TOKEN>
config: {}
- name: different-context
endpoint: https://api.servers.com/v2
token: <2ND_API_TOKEN>
config: {
proxy: "",
http-timeout: 30,
verbose: true, /* (true|false) */
output: "json" /* (text|json|yaml) */
}You can adjust the context later on:
# changing the context name
srvctl context update <context-name> --name=<new-name>
# setting context to act as default
srvctl context update <context-name> --default
# delete specific context
srvctl context delete <context-name>srvctl can generate completion scripts for bash, zsh, fish, and powershell.
Quick check (current shell only):
source <(srvctl completion bash) # or: zsh / fishPermanent install — bash:
# Linux
srvctl completion bash | sudo tee /etc/bash_completion.d/srvctl >/dev/null
# macOS (with Homebrew's bash-completion)
srvctl completion bash > "$(brew --prefix)/etc/bash_completion.d/srvctl"Requires the bash-completion package. Start a new shell after install.
Permanent install — zsh:
# Ensure compinit is enabled in ~/.zshrc:
# autoload -U compinit && compinit
srvctl completion zsh > "${fpath[1]}/_srvctl"Permanent install — fish:
srvctl completion fish > ~/.config/fish/completions/srvctl.fishFor full details on any shell, run srvctl completion <shell> --help.
Documentation is accessible via man or via --help flag, for example:
# man option
$ man srvctl-hosts-ds-list
# help option, short command help
$ srvctl hosts ds list --helpMan pages are based on the documentation info located in /docs directory.
Contributions are welcome! Please open an issue or submit a pull request.
srvctl is released under the Apache 2.0 License.