Travel search, powered by Fliggy — for AI coding agents
Quick Start · Commands · How It Works · Agent Integration · Troubleshooting
- Natural language in, JSON out — ask in plain English or Chinese, get structured single-line JSON on
stdout. - Direct Fliggy integration — calls the official Fliggy FlyAI MCP API for real-time hotel, flight, train, POI, and booking data.
- 8 dedicated search commands — from broad keyword/AI search to category-specific hotel, flight, train, POI, and Marriott queries.
- Bookable results — every result carries
jumpUrl/detailUrlfor one-click booking andpicUrl/mainPicfor rich display.
cd flyai-skill
npm installThis installs @fly-ai/flyai-cli (v1.0.16) and its dependencies into node_modules/.
Get a free API key from the Fliggy FlyAI Open Platform.
Windows (cmd / PowerShell):
set FLYAI_API_KEY=your_api_key_hereLinux / macOS:
export FLYAI_API_KEY=your_api_key_herenode scripts/flyai.mjs keyword-search --query "things to do in Tokyo"You should see a single-line JSON response with status: 0 and a data.itemList array.
All commands are invoked through the wrapper script. Before calling any command, read its corresponding file in references/ for exact required parameters — do not guess or reuse formats across commands.
| Command | Description | Required Parameter | Reference |
|---|---|---|---|
keyword-search |
Broad natural-language search across hotels, flights, tickets, events | --query |
references/keyword-search.md |
ai-search |
AI-powered semantic search with complex intent understanding | --query |
references/ai-search.md |
search-hotel |
Structured hotel search with filters (star, price, bed type, POI) | --dest-name |
references/search-hotel.md |
search-flight |
Structured flight search with date ranges, cabin class, sorting | --origin |
references/search-flight.md |
search-train |
Structured train ticket search with seat class, duration, sorting | --origin |
references/search-train.md |
search-poi |
POI / attraction search by city, level, category, keyword | --city-name |
references/search-poi.md |
search-marriott-hotel |
Marriott Group hotel search with brand and name filters | --dest-name |
references/search-marriott-hotel.md |
search-marriott-package |
Marriott hotel package (dining, spa, stay) search | --keyword |
references/search-marriott-package.md |
# Broad search
node scripts/flyai.mjs keyword-search --query "France visa"
# AI semantic search
node scripts/flyai.mjs ai-search --query "下周从上海去东京,优先直飞,帮我找性价比高的航班和酒店"
# Hotel search
node scripts/flyai.mjs search-hotel --dest-name "杭州" --poi-name "西湖" --check-in-date 2026-03-10 --check-out-date 2026-03-12
# Flight search
node scripts/flyai.mjs search-flight --origin "上海" --destination "东京" --dep-date 2026-03-20 --back-date 2026-03-25 --journey-type 1
# Train search
node scripts/flyai.mjs search-train --origin "北京" --destination "上海" --dep-date 2026-03-15 --seat-class-name "second class"
# POI search
node scripts/flyai.mjs search-poi --city-name "杭州" --keyword "西湖" --category "山湖田园"
# Marriott hotel
node scripts/flyai.mjs search-marriott-hotel --dest-name "上海" --hotel-brands "万豪酒店,喜来登" --check-in-date 2026-03-20 --check-out-date 2026-03-22
# Marriott package
node scripts/flyai.mjs search-marriott-package --keyword "JW万豪" --sort-type price_ascflowchart TD
A[Agent asks a travel question] --> B["node scripts/flyai.mjs <command> [args...]"]
B -->|wrapper resolves flyai-cli bin, spawns node| C["@fly-ai/flyai-cli (npm package, v1.0.16)"]
C -->|HTTP call with FLYAI_API_KEY| D["Fliggy FlyAI MCP API<br/>flyai.open.fliggy.com"]
D --> E[Single-line JSON on stdout]
E --> F[Agent parses & renders results]
- stdout: single-line JSON response (
status,message,data,systemMessage) - stderr: error messages and hints (prefixed
[flyai]) - Exit codes:
0success,2dependency/CLI resolution error,3API key missing,4CLI spawn failure
This is a Skill (not an MCP server). Agents invoke it by executing node scripts/flyai.mjs <command> [args...].
- Clone this repository (or copy the
SKILL.md,scripts/,references/,package.json, andpackage-lock.jsoninto your agent's skills directory). - Run
npm installinside the skill directory to install@fly-ai/flyai-cli. - Ensure the agent has permission to execute
nodeand read theSKILL.mdfrontmatter (which declaresruntime: nodeand intent patterns). - Set
FLYAI_API_KEYin the agent's environment.
The agent will then automatically route travel-related queries to the appropriate node scripts/flyai.mjs command based on the intent patterns and reference docs declared in SKILL.md.
The FLYAI_API_KEY environment variable is missing. Set it before running commands:
# Windows
set FLYAI_API_KEY=your_key# Linux/macOS
export FLYAI_API_KEY=your_keyGet a key at flyai.open.fliggy.com.
The @fly-ai/flyai-cli dependency is not installed. Run:
npm installinside the skill directory (the one containing package.json).
The installed flyai-cli package has an unexpected bin field. Reinstall:
rm -rf node_modules package-lock.json
npm installThis skill is derived from the open-source alibaba-flyai/flyai-skill and adapted for direct repository usage (npm install + node scripts/flyai.mjs) without the platform packaging layer.
All travel data is provided by Fliggy FlyAI.