Small CLI application for interacting with an omnikeeper instance via GraphQL queries and mutations. Can be used to automate the configuration of an omnikeeper instance.
- (optional) credentials helper: https://github.com/docker/docker-credential-helpers
- one of the binary credential helpers in https://github.com/docker/docker-credential-helpers/releases, present in PATH
wget https://github.com/max-bytes/omnikeeper-client-cli/releases/latest/download/okql.rpm
# either:
sudo rpm -i okql.rpm
# or:
sudo yum localinstall okql.rpm
# or:
sudo alien -i okql.rpm
In terms of authentication, only the oauth flow "Resource Owner Password Credentials Grant" is supported. Other modes, such as the "Device Authorization Flow" are not (yet) supported. That means it is necessary to supply username+password of the user to authenticate.
For certain usecases like CICD pipelines, a docker image is provided that contains a runnable okql binary.
docker run ghcr.io/max-bytes/omnikeeper-client-cli:0.5.2 okql ...
Note: to run from source instead, replace okql
with go run cmd/main.go
Login (password via prompt):
okql -o https://10.0.0.43:45455 -u username
Login (password via parameter):
okql -o https://10.0.0.43:45455 -u username -p password
Run query from parameter:
okql -o https://10.0.0.43:45455 -q "query { activeTraits { id } }"
Run query from stdin:
cat <<'EOF' | okql -o https://10.0.0.43:45455 --stdin
query {
activeTraits {
id
}
}
EOF
Run query from file:
okql -o https://10.0.0.43:45455 --stdin < file.graphql
Only fetch token:
okql -o https://10.0.0.43:45455 -u username -p password -k -i