elasticsearch-cli
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Perform Elasticsearch operations using the Elasticsearch HTTP API via curl. Use for querying indices, documents, mappings, and cluster health.
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use the instance and rules below when constructing all Elasticsearch API commands.
- Distinctive: line 12
Update the table below with your Elasticsearch instance URLs and corresponding credential file paths:
- Distinctive: line 19
If the target instance is unclear, ask the user before running any command.
- Very specific: line 31
All API calls use curl with the API key read from the instance's credential file:
- Distinctive: line 93
NEVER target any Elasticsearch instance not listed in the instance table above.
- Distinctive: line 94
Update the instance table with your actual Elasticsearch URLs before using this skill.
- Distinctive: line 95
NEVER print, display, log, or store the contents of any credential file.
- Very specific: line 96
Always read the API key inline with $(cat <CREDENTIAL_FILE>) — never hardcode a credential value in a command.
- Very specific: line 97
Always pass -s (silent) to curl and pipe through jq for readable output.
- Very specific: line 98
NEVER run DELETE endpoints or _delete_by_query without explicit user instruction — these are irreversible.
- Distinctive: line 100
If the required credential file does not exist, inform the user and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Elasticsearch CLI Skill
Use the instance and rules below when constructing all Elasticsearch API commands.
Instances
Update the table below with your Elasticsearch instance URLs and corresponding credential file paths:
| Environment | Base URL | Credential File |
| Production | https://<your-es-prod-url> | ~/.elasticsearch/prod.token |
| Staging | https://<your-es-staging-url> | ~/.elasticsearch/staging.token |
If the target instance is unclear, ask the user before running any command.
Prerequisites (one-time setup by user)
Generate an Elasticsearch API key for each instance you intend to use and save it to the corresponding credential file (see instance table above). Never print or display credential values. Do not perform these steps yourself.
mkdir -p ~/.elasticsearch && echo "<your-api-key>" > <CREDENTIAL_FILE> && chmod 600 <CREDENTIAL_FILE>Command Format
All API calls use curl with the API key read from the instance's credential file:
curl -s -H "Authorization: ApiKey $(cat <CREDENTIAL_FILE>)" \
"<BASE_URL>/<endpoint>" | jq .Example (production):
curl -s -H "Authorization: ApiKey $(cat ~/.elasticsearch/prod.token)" \
"https://<your-es-prod-url>/_cluster/health" | jq .Available API Endpoints
Read-only (safe, no confirmation needed)
| Endpoint | Method | Description |
/_cluster/health | GET | Show cluster health status |
/_cat/indices?v | GET | List all indices with stats |
/_cat/nodes?v | GET | List cluster nodes |
/_cat/shards?v | GET | List shard allocation |
/<index>/_mapping | GET | Show field mappings for an index |
/<index>/_settings | GET | Show index settings |
/<index>/_search | GET/POST | Search documents (query in body) |
/<index>/_count | GET/POST | Count matching documents |
/<index>/_doc/<id> | GET | Get a document by ID |
/_cat/aliases?v | GET | List index aliases |
/_nodes/stats | GET | Show node-level statistics |
Example query
curl -s -H "Authorization: ApiKey $(cat <CREDENTIAL_FILE>)" \
-H "Content-Type: application/json" \
-X POST "<BASE_URL>/<index>/_search" \
-d '{"query": {"match": {"field": "value"}}, "size": 10}' | jq .Mutating operations (confirm with user before running)
| Endpoint | Method | Description |
/<index>/_doc/<id> | PUT/POST | Create or update a document |
/<index> | PUT | Create a new index |
/<index>/_mapping | PUT | Add fields to an index mapping |
/<index>/_settings | PUT | Update index settings |
/_aliases | POST | Update index aliases |
Never run — requires explicit human approval
| Endpoint | Method | Reason |
/<index> | DELETE | Irreversibly deletes the index and all its documents |
/<index>/_doc/<id> | DELETE | Irreversible document deletion |
/<index>/_delete_by_query | POST | Bulk-deletes documents matching a query — irreversible |
/_cluster/settings | PUT | Changes cluster-wide configuration |
/<index>/_close / /<index>/_open | POST | Changes index availability cluster-wide |
Rules
- NEVER target any Elasticsearch instance not listed in the instance table above. If a URL references a different host, stop and ask the user to confirm.
- Update the instance table with your actual Elasticsearch URLs before using this skill.
- NEVER print, display, log, or store the contents of any credential file.
- Always read the API key inline with
$(cat <CREDENTIAL_FILE>)— never hardcode a credential value in a command. - Always pass
-s(silent) tocurland pipe throughjqfor readable output. - NEVER run DELETE endpoints or
_delete_by_querywithout explicit user instruction — these are irreversible. - For search queries, always set a reasonable
sizelimit — an unbounded query on a large index can return excessive data. - If the required credential file does not exist, inform the user and stop. Do not attempt to find or guess the credential.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

