Elasticsearch connection is configured via environment variables. Run node scripts/esql.js test to verify the
connection. If the test fails, suggest these setup options to the user, then stop. Do not try to explore further until a
successful connection test.
Elastic Cloud Serverless: After connecting, inspect
GET /. Ifbuild_flavoris"serverless", do not useversion.numberto decide which ES|QL features are allowed — Serverless tracks current GA and preview ES|QL, and the reported version follows the main-line / next-minor line (semver-only clients may see it as “latest”). Preferbuild_flavorfor detection and gating. For the full rules (including self-managed and snapshot builds), read Cluster Detection in SKILL.md and the Serverless callout in ES|QL Version History.
export ELASTICSEARCH_CLOUD_ID="deployment-name:base64encodedcloudid"
export ELASTICSEARCH_API_KEY="base64encodedapikey"export ELASTICSEARCH_URL="https://elasticsearch:9200"
export ELASTICSEARCH_API_KEY="base64encodedapikey"export ELASTICSEARCH_URL="https://elasticsearch:9200"
export ELASTICSEARCH_USERNAME="elastic"
export ELASTICSEARCH_PASSWORD="changeme"For local development and testing, use start-local to quickly spin up Elasticsearch and Kibana using Docker or Podman:
curl -fsSL https://elastic.co/start-local | shAfter installation completes, Elasticsearch runs at http://localhost:9200 and Kibana at http://localhost:5601. The
script generates a random password for the elastic user and an API key, both stored in the .env file inside the
created elastic-start-local folder.
To configure the environment variables for this skill, source the .env file and export the connection settings:
source elastic-start-local/.env
export ELASTICSEARCH_URL="$ES_LOCAL_URL"
export ELASTICSEARCH_API_KEY="$ES_LOCAL_API_KEY"Then run node scripts/esql.js test to verify the connection.
export ELASTICSEARCH_INSECURE="true"