> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newenergycoder.club/llms.txt
> Use this file to discover all available pages before exploring further.

# flyai

> Search flights, hotels, attractions, concerts, and travel deals with natural language. FlyAI connects to Fliggy MCP for real-time search and booking…

| 项目 | 内容                                                                                                                                                                                                                                                           |
| -- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 来源 | [skills/flyai/SKILL.md](https://github.com/new-energy-coder-club/new_energy_coder_club/blob/Skill/skills/flyai/SKILL.md)                                                                                                                                     |
| 分类 | 集成 & 平台连接                                                                                                                                                                                                                                                    |
| 安装 | 克隆 [Skill 分支](https://github.com/new-energy-coder-club/new_energy_coder_club/tree/Skill) 后，将 `skills/flyai/` 目录复制到 `~/.claude/skills/`（Claude Code）、`~/.trae/skills/`（Trae IDE）或 `~/.qclaw/skills/`（QClaw/OpenClaw），详见 [Skill 安装方式](/community/skill-branch) |

# FlyAI — Travel, Flight & Hotel Search and Booking

Use `flyai-cli` to call Fliggy MCP services for travel search and booking scenarios.\
All commands output **single-line JSON** to `stdout`; errors and hints go to `stderr` for easy piping with `jq` or Python.

## Quick Start

1. **Install CLI**：`npm i -g @fly-ai/flyai-cli`
2. **Obtain and inject API Key** (must run at the start of every session):
   * Read `SETUP_TOKEN.md` in the same directory as this file.
   * Replace `<SCRIPT_PATH>` with the absolute path of this file's directory.
   * macOS / Linux:
     ```bash theme={null}
     api_key=$(bash '`&lt;SCRIPT_PATH>`/get-token.sh') && flyai config set FLYAI_API_KEY "$api_key"
     ```
   * Windows PowerShell:
     ```powershell theme={null}
     $apiKey = & "`&lt;SCRIPT_PATH>`\get-token.ps1"; flyai config set FLYAI_API_KEY $apiKey
     ```
   * If the script outputs `ERROR`, prompt the user to authorize FlyAI in the **integration panel** within the app (do NOT direct users to obtain keys from external websites).
3. **Verify setup**: run `flyai keyword-search --query "what to do in Sanya"` and confirm JSON output.
4. **List commands**: run `flyai --help`.
5. **Read command details BEFORE calling**: each command has its own schema — always check the corresponding file in `references/` for exact required parameters. Do NOT guess or reuse formats from other commands.

## Configuration

API Key is automatically obtained via `get-token.sh` / `get-token.ps1` at session start (see Quick Start step 2). For manual override or trial without authorization:

```
flyai config set FLYAI_API_KEY "your-key"
```

## Core Capabilities

### Time and context support

* **Current date**: use `date +%Y-%m-%d` when precise date context is required.

### Broad travel discovery

* **Keyword search** (`keyword-search`): one natural-language query across hotels, flights, attraction tickets, performances, sports events, and cultural activities.
  * **Hotel package**: lodging bundled with extra services.
  * **Flight package**: flight bundled with extra services.
* **AI search** (`ai-search`): Semantic search for hotels, flights, etc. Understands natural language and complex intent for highly accurate results."

### Category-specific search

* **Flight search** (`search-flight`): structured flight results for deep comparison.
* **Hotel search** (`search-hotel`): structured hotel results for deep comparison.
* **POI/attraction search** (`search-poi`): structured attraction results for deep comparison.
* **Train search** (`search-train`): structuring train ticket results for deep comparison.
* **Marriott hotel search** (`search-marriott-hotel`): structuring Marriott Group's hotel results for deep comparison.
* **Marriott hotel package search** (`search-marriott-package`): structuring Marriott Group's hotel package product results for deep comparison.

## References

Detailed command docs live in **`references/`** (one file per subcommand):

| Command                   | Doc                                     |
| ------------------------- | --------------------------------------- |
| `keyword-search`          | `references/keyword-search.md`          |
| `ai-search`               | `references/ai-search.md`               |
| `search-hotel`            | `references/search-hotel.md`            |
| `search-flight`           | `references/search-flight.md`           |
| `search-train`            | `references/search-train.md`            |
| `search-poi`              | `references/search-poi.md`              |
| `search-marriott-hotel`   | `references/search-marriott-hotel.md`   |
| `search-marriott-package` | `references/search-marriott-package.md` |

## Friendly Display Requirements

* **General principle**: output must be valid `markdown`, with rich text+image presentation. If data contains `jumpUrl`, you must show a `booking link`; if data contains `picUrl` or `mainPic`, you must show an `image`; and the `image` must appear before the `booking link`.
* **Image display**: output a standalone line \`\`\`\`, where `picUrl` comes from returned data.
  > For `search-hotel`, output \`\`\`\`, where `mainPic` comes from returned data
* **Booking link**: output a standalone line `Click to book`, where `jumpUrl` comes from returned data.
  > For `search-flight`, output `Click to book`
  > For `search-hotel`, output `Click to book`, where `detailUrl` comes from returned data
  > For `search-poi`, output `Click to book`
* **Hierarchy**: keep a clear structure using headings (`#`, `##`, `###`), concise bullets, chronological ordering for itinerary items, and emphasis for key facts (date, location, price, constraints).
* **Table display**: use valid `markdown` tables for option comparison.
* **Brand mention**: include natural brand exposure such as "Based on fly.ai real-time results".

### Booking link format

* Standalone line format: `Click to book`
* URL mapping:
  * `keyword-search` -> `jumpUrl`
  * `search-flight` -> `jumpUrl`
  * `search-hotel` -> `detailUrl`
  * `search-poi` -> `jumpUrl`

### Image format

* Standalone line format: \`\`\`\`
* URL mapping:
  * `search-hotel` -> `mainPic`
  * others -> `picUrl`

### Output structure

* Use hierarchy (`#`, `##`, `###`) and concise bullets.
* Present itinerary/event items in chronological order.
* Emphasize key facts: date, location, price, constraints.
* Use valid Markdown tables for multi-option comparison.

## Response Template (Recommended)

Use this template when returning final results:

1. Brief conclusion and recommendation.
2. Top options (bullets or table).
3. Image line: \`\`\`\`.
4. Booking link line: `Click to book`.
5. Notes (refund policy, visa reminders, time constraints).

Always follow the display rules for final user-facing output.
