The CLI for interacting with OpsLevel
- jq version 1.7
- OpsLevel API Token
- Generate token by clicking
Create API Tokenand providing a description - Export the API Token for cli access:
>export OPSLEVEL_API_TOKEN=<api_token>
- Generate token by clicking
brew install opslevel/tap/cli# Note: you can also run without `sudo` and move the binary yourself
curl -sLS https://raw.githubusercontent.com/OpsLevel/cli/main/install.sh | sudo shThe docker container is hosted on AWS Public ECR
# Create> opslevel create category Chaos
Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY8
# Get> opslevel get category Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY8
{
"id": "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY8",
"Name": "Chaos"
}
# List> opslevel list category
NAME ID Performance Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY1 Infrastructure Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY2 Observability Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY3 Reliability Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY4 Scalability Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY5 Security Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY6 Quality Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY7 Chaos Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY8 # Delete> opslevel delete category Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvOTY8We have the ability to generate autocompletion scripts for the shell's bash, zsh, fish and powershell. To generate
the completion script for macOS zsh:
opslevel completion zsh > /usr/local/share/zsh/site-functions/_opslevelMake sure you have zsh completion turned on by having the following as one of the first few lines in your .zshrc file
echo"autoload -U compinit; compinit">>~/.zshrc> opslevel list services -o json | jq '[.[] | if .tier.Alias == "tier_1" then {(.name) : (.tier.Alias)} else empty end]' [
{
"Catalog Service": "tier_1"
},
{
"Shopping Cart Service": "tier_1"
},
{
"Website Aggregator": "tier_1"
}
]