ASP源码
PHP源码
.NET源码
JSP源码
国家查询技能是为在 Openclaw Skills 环境中运行的 AI 智能体设计的强大实用工具。它提供了与 REST Countries API (v3.1) 的无缝接口,使智能体能够检索详细信息,如首都、人口统计、货币和官方语言,且无需任何身份验证或 API 密钥。
通过集成此技能,开发人员可以增强智能体以高精度处理地理查询的能力。该工具处理 API 请求和数据解析的复杂性,提供结构化、易于阅读的格式,智能体可以轻松解释并呈现给用户。无论是通过字母代码查找国家,还是列出特定区域内的所有国家,此技能都可作为任何具有地理感知能力的 AI 应用的可靠参考层。
下载入口:https://github.com/openclaw/skills/tree/main/skills/jeffaf/countries
从源直接安装技能的最快方式。
npx clawhub@latest install countries
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 countries。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
要在您的 Openclaw Skills 设置中使用此技能,请确保安装了以下系统依赖项:
sudo apt-get update
sudo apt-get install curl jq bc
脚本位于 {skill_folder}/countries。确保其具有执行权限:
chmod +x ./countries
该技能将地理数据组织成适合 LLM 使用的结构化格式。以下是主要的数据映射:
| 字段 | 格式 | 描述 |
|---|---|---|
| 代码 | Alpha-2 / Alpha-3 | 国际国家代码(例如:US, USA) |
| 人口 | 数字 (后缀) | 格式化的人口统计(例如:331M) |
| 地区 | 字符串 | 主要地理区域和子区域 |
| 地图 | URL | 指向该位置 Google 地图的直接链接 |
| 国旗 | 表情符号 | Unicode 国旗表示 |
name: countries
version: 1.0.0
description: "CLI for AI agents to lookup country info for their humans. Uses REST Countries API. No auth required."
homepage: https://restcountries.com
metadata:
openclaw:
emoji: "??"
requires:
bins: ["bash", "curl", "jq", "bc"]
tags: ["countries", "geography", "reference", "api", "cli"]
CLI for AI agents to lookup country info for their humans. "What's the capital of Mongolia?" — now your agent can answer.
Uses REST Countries API (v3.1). No account or API key needed.
"Tell me about Japan"
"What countries are in South America?"
"Which country has Tokyo as capital?"
"Info on country code DE"
| Action | Command |
|---|---|
| Search by name | countries search "query" |
| Get details | countries info |
| List by region | countries region |
| Search by capital | countries capital "city" |
| List all | countries all |
countries search "united states" # Find country by name
countries info US # Get full details by alpha-2 code
countries info USA # Also works with alpha-3
countries region europe # All European countries
countries capital tokyo # Find country by capital
countries all # List all countries (sorted)
Valid regions: africa, americas, asia, europe, oceania
Search/list output:
[US] United States — Washington D.C., Americas, Pop: 331M, ????
Info output:
?? Japan
Official: Japan
Code: JP / JPN / 392
Capital: Tokyo
Region: Asia — Eastern Asia
Population: 125.8M
Area: 377930 km2
Languages: Japanese
Currencies: Japanese yen (JPY)
Timezones: UTC+09:00
Borders: None (island/isolated)
Driving: left side
Flag: ????
??? Map: https://goo.gl/maps/...
Script location: {skill_folder}/countries (wrapper to scripts/countries)
When user asks about countries:
./countries search "name" to find country code./countries info for full details./countries region for regional lists./countries capital "city" to find by capitalCommon patterns:
Don't use for: Historical countries, disputed territories, non-sovereign regions.