CLI
Installation
The most convenient way to interact with our API is by using our cross-platform CLI:
curl -sL https://raw.githubusercontent.com/datasherlocks/sherlock/main/install.sh | sudo bash -s -- -b /usr/local/bin
Alternatively, if you prefer using Homebrew:
brew install datasherlocks/homebrew-tap/sherlock
API Token Setup
Before using the Datasherlocks CLI, you need to set up your API token. Visit the Organization settings page to create an API token for your client. Once you have created the token, set it as a new environment variable:
export DS_API_TOKEN=*******
You are now ready to use the Datasherlocks CLI to manage your agents and interact with the Datasherlocks platform.
Commands
The Datasherlocks CLI provides several commands to manage and query agents, as well as perform other tasks. Here are the available commands:
register
Use the register command to register a Datasherlocks agent with the platform. This command requires a configuration file and agent name.
Example:
sherlock register --config /path/to/config.yaml --name <AGENT_NAME>
ask
With the ask command, you can send a question to a Datasherlocks agent running on a specific host. You need to specify the question, agent ID, and optionally, the output format (JSON or table).
Example:
sherlock ask --question "How many users are active?" --id 123 --output table
list
The list command retrieves a list of Datasherlocks agents registered with the platform. It provides details such as agent ID, name, host, database, username, type, and remote URL.
Example:
sherlock list
serve
The serve command starts the Datasherlocks agent using the provided configuration file. It initializes the agent and allows it to communicate with the Datasherlocks platform. Please note that the serve command is intended for local testing only and is not recommended for production use.
Example (Local Testing):
sherlock serve -l --config /path/to/config.yaml
Example (Production Deployement)
sherlock serve --config /path/to/config.yaml
NOTE: For production deployments, we recommend following our AWS/Kubernetes deployment guide, which provides instructions for deploying the agent in a production environment.
Last updated