cloud-setup by elastic/agent-skills
npx skills add https://github.com/elastic/agent-skills --skill cloud-setup配置 Elastic Cloud 认证和偏好设置。所有其他 cloud/* 技能都依赖此设置。
设置进度:
- [ ] 步骤 1:验证 API 密钥
- [ ] 步骤 2:设置默认值
- [ ] 步骤 3:验证连接
检查 EC_API_KEY 是否已设置:
echo "${EC_API_KEY:?Not set}"
如果未设置,指导用户进行设置。切勿要求用户在聊天中粘贴 API 密钥 — 密钥不得出现在对话历史记录中。
指导用户:
.env 文件(推荐 — 适用于沙盒化的代理 shell):EC_API_KEY=your-api-key
所有 脚本都会自动从工作目录加载 — 无需手动获取。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
cloud/*.envexport EC_API_KEY="your-api-key"
终端导出的变量对于在独立 shell 会话中运行的沙盒化代理可能不可见。与代理一起工作时,建议使用 .env 文件。
提醒用户,将密钥存储在本地文件中对于开发是可以接受的,但对于生产或共享环境,应使用集中式密钥管理器(例如,HashiCorp Vault、AWS Secrets Manager、1Password CLI)以避免密钥分散。
导出基础 URL 和默认区域:
export EC_BASE_URL="https://api.elastic-cloud.com"
export EC_REGION="gcp-us-central1"
询问用户是否需要不同的区域。要列出可用区域:
curl -s -H "Authorization: ApiKey ${EC_API_KEY}" \
"${EC_BASE_URL}/api/v1/serverless/regions" | python3 -m json.tool
通过调用区域端点来确认 API 密钥有效:
curl -sf -H "Authorization: ApiKey ${EC_API_KEY}" \
"${EC_BASE_URL}/api/v1/serverless/regions" > /dev/null && echo "Authenticated." || echo "Authentication failed."
如果验证失败,请检查:
api.elastic-cloud.com 的网络连接User: set up my cloud environment
Agent: 检查您的终端中是否设置了 EC_API_KEY。如果没有,请在
https://cloud.elastic.co/account/keys 生成密钥并运行:
export EC_API_KEY="your-key"
然后确认,我将验证连接。
User: set up cloud with eu region
Agent: [运行设置,将 EC_REGION 设置为用户首选的欧盟区域]
gcp-us-central1 — 仅当用户请求不同区域时才更改。EC_API_KEY 时,其他云技能应参考此处。| 变量 | 必需 | 描述 |
|---|---|---|
EC_API_KEY | 是 | Elastic Cloud API 密钥 |
EC_BASE_URL | 否 | 云 API 基础 URL(默认:https://api.elastic-cloud.com) |
EC_REGION | 否 | 默认区域(默认:gcp-us-central1) |
| 问题 | 解决方法 |
|---|---|
401 Unauthorized | API 密钥无效或已过期 — 生成新密钥 |
connection refused | 检查到 api.elastic-cloud.com 的网络访问 |
每周安装数
129
仓库
GitHub 星标数
89
首次出现
10 天前
安全审计
安装于
cursor112
github-copilot99
opencode98
gemini-cli98
claude-code98
codex98
Configure Elastic Cloud authentication and preferences. All other cloud/* skills depend on this setup.
Setup Progress:
- [ ] Step 1: Verify API key
- [ ] Step 2: Set defaults
- [ ] Step 3: Validate connection
Check whether EC_API_KEY is already set:
echo "${EC_API_KEY:?Not set}"
If not set, instruct the user to set it. Never ask the user to paste an API key into the chat — secrets must not appear in conversation history.
Direct the user to:
.env file in the project root (recommended — works in sandboxed agent shells):EC_API_KEY=your-api-key
All cloud/* scripts auto-load .env from the working directory — no manual sourcing needed.
export EC_API_KEY="your-api-key"
Terminal exports might not be visible to sandboxed agents running in a separate shell session. Prefer the .env file when working with an agent.
Remind the user that storing secrets in local files is acceptable for development, but for production or shared environments, use a centralized secrets manager (for example, HashiCorp Vault, AWS Secrets Manager, 1Password CLI) to avoid secrets sprawl.
Export the base URL and default region:
export EC_BASE_URL="https://api.elastic-cloud.com"
export EC_REGION="gcp-us-central1"
Ask the user if they want a different region. To list available regions:
curl -s -H "Authorization: ApiKey ${EC_API_KEY}" \
"${EC_BASE_URL}/api/v1/serverless/regions" | python3 -m json.tool
Confirm the API key works by calling the regions endpoint:
curl -sf -H "Authorization: ApiKey ${EC_API_KEY}" \
"${EC_BASE_URL}/api/v1/serverless/regions" > /dev/null && echo "Authenticated." || echo "Authentication failed."
If validation fails, check:
api.elastic-cloud.comUser: set up my cloud environment
Agent: Check if EC_API_KEY is set in your terminal. If not, generate a key at
https://cloud.elastic.co/account/keys and run:
export EC_API_KEY="your-key"
Then confirm and I'll validate the connection.
User: set up cloud with eu region
Agent: [runs setup, sets EC_REGION to user's preferred EU region]
gcp-us-central1 — only change if the user requests a different region.EC_API_KEY is missing.| Variable | Required | Description |
|---|---|---|
EC_API_KEY | Yes | Elastic Cloud API key |
EC_BASE_URL | No | Cloud API base URL (default: https://api.elastic-cloud.com) |
EC_REGION | No | Default region (default: gcp-us-central1) |
| Problem | Fix |
|---|---|
401 Unauthorized | API key is invalid or expired — generate a new one |
connection refused | Check network access to api.elastic-cloud.com |
Weekly Installs
129
Repository
GitHub Stars
89
First Seen
10 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor112
github-copilot99
opencode98
gemini-cli98
claude-code98
codex98
Quarto 创作指南:从文档编写到项目迁移,掌握 Quarto 技术文档创作全流程
204 周安装
Claude快速阅读器 - 600+ WPM高速阅读AI回复,RSVP与Spritz ORP高亮技术
102 周安装
.NET和Python后端全局错误处理配置指南:异常中间件与自定义异常
211 周安装
ln-401-task-executor:AI驱动任务执行器,自动化代码实现与状态管理
212 周安装
Slack 代理开发指南:Chat SDK 与 Bolt for JavaScript 框架选择与部署教程
206 周安装
Claw 发布工具:ClawSec 技能自动化发布与版本管理工具
102 周安装