fli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fli install and usage skill

Fli 安装与使用指南

Use this skill when the goal is to install Fli and use its CLI or MCP server correctly.
The primary path is:
  1. install with
    pipx install flights
  2. use
    fli
    for terminal searches
  3. use
    fli-mcp
    for Claude Desktop or other STDIO MCP clients
  4. use
    fli-mcp-http
    only when an HTTP MCP endpoint is specifically needed
Do not default to cloning the repository or using a source checkout. Only mention cloning the repo when the user explicitly wants to contribute to Fli itself.
当目标为安装Fli并正确使用其CLI或MCP服务器时,可参考本指南。
核心使用流程如下:
  1. 执行
    pipx install flights
    完成安装
  2. 使用
    fli
    命令在终端中搜索航班
  3. 为Claude Desktop或其他STDIO MCP客户端使用
    fli-mcp
  4. 仅当明确需要HTTP MCP端点时使用
    fli-mcp-http
不要默认推荐克隆仓库或使用源码检出版本,仅当用户明确表示要为Fli本身做贡献时,再提及克隆仓库的操作。

What Fli is

Fli 是什么

Fli is a Python package for accessing Google Flights data through direct API interaction.
It has three public surfaces:
  • CLI via
    fli
  • Python library via the
    fli
    package
  • MCP server via
    fli-mcp
    and
    fli-mcp-http
For this skill, focus on the CLI and MCP server first.
Fli是一个Python包,可通过直接的API交互获取Google Flights的数据。
它对外提供三类使用入口:
  • 通过
    fli
    命令使用CLI
  • 通过
    fli
    包调用Python库能力
  • 通过
    fli-mcp
    fli-mcp-http
    使用MCP服务器
本指南优先聚焦CLI和MCP服务器的使用说明。

Core install rule

核心安装规则

If the user wants to use Fli as a tool, recommend
pipx install flights
.
Why:
  • it is the documented recommended install path for CLI and MCP usage
  • it keeps the install isolated from other Python projects
  • it exposes
    fli
    ,
    fli-mcp
    , and
    fli-mcp-http
    on the user's PATH
Only fall back to
pip install flights
or
uvx
when:
  • pipx
    is unavailable
  • the user wants library-only usage
  • the user explicitly prefers another Python package manager
如果用户想将Fli作为工具使用,推荐使用
pipx install flights
安装。
原因如下:
  • 这是官方文档推荐的CLI和MCP使用场景安装路径
  • 可将安装环境与其他Python项目隔离
  • 会自动将
    fli
    fli-mcp
    fli-mcp-http
    加入用户的PATH中
仅在以下场景下可改用
pip install flights
uvx
安装:
  • 环境中没有
    pipx
  • 用户仅想使用其库能力
  • 用户明确偏好其他Python包管理器

Standard installation flow

标准安装流程

Preferred install

推荐安装方式

bash
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install flights
If
pipx
is already installed, skip directly to:
bash
pipx install flights
bash
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install flights
如果已经安装了
pipx
,可以直接执行:
bash
pipx install flights

Verify installation

验证安装

Run these checks after install:
bash
fli --help
fli-mcp --help
which fli-mcp
If the commands are not found after
pipx install flights
, have the user run:
bash
python3 -m pipx ensurepath
Then restart the terminal session.
安装完成后运行以下命令检查是否安装成功:
bash
fli --help
fli-mcp --help
which fli-mcp
如果执行
pipx install flights
后提示找不到命令,让用户运行:
bash
python3 -m pipx ensurepath
然后重启终端会话即可。

What the install provides

安装后可用命令

After
pipx install flights
, these commands should be available:
  • fli
    - main CLI for flight searches
  • fli-mcp
    - MCP server over STDIO
  • fli-mcp-http
    - MCP server over HTTP, defaulting to
    http://127.0.0.1:8000/mcp/
Important naming detail:
  • the package to install is
    flights
  • the commands to run are
    fli
    ,
    fli-mcp
    , and
    fli-mcp-http
Do not tell users to run
pipx install fli
.
执行
pipx install flights
后,以下命令将可用:
  • fli
    - 用于航班搜索的主CLI工具
  • fli-mcp
    - 基于STDIO的MCP服务器
  • fli-mcp-http
    - 基于HTTP的MCP服务器,默认地址为
    http://127.0.0.1:8000/mcp/
重要命名注意事项:
  • 需要安装的包名是
    flights
  • 需要运行的命令是
    fli
    fli-mcp
    fli-mcp-http
不要告诉用户运行
pipx install fli

CLI usage

CLI 使用说明

Basic flight search

基础航班搜索

Use:
bash
fli flights JFK LAX 2026-10-25
使用方式:
bash
fli flights JFK LAX 2026-10-25

Cheapest-date search

最低票价日期搜索

Use:
bash
fli dates JFK LAX --from 2026-01-01 --to 2026-01-31
使用方式:
bash
fli dates JFK LAX --from 2026-01-01 --to 2026-01-31

Common filters

常用筛选参数

Use filters like these when the user asks for them:
bash
fli flights JFK LHR 2026-10-25 \
  --time 6-20 \
  --airlines BA KL \
  --class BUSINESS \
  --stops NON_STOP \
  --sort DURATION
Supported language to map correctly:
  • cabin classes:
    ECONOMY
    ,
    PREMIUM_ECONOMY
    ,
    BUSINESS
    ,
    FIRST
  • stop filters:
    ANY
    ,
    NON_STOP
    ,
    ONE_STOP
    ,
    TWO_PLUS_STOPS
  • sort options:
    CHEAPEST
    ,
    DURATION
    ,
    DEPARTURE_TIME
    ,
    ARRIVAL_TIME
当用户有对应需求时可以使用以下筛选参数:
bash
fli flights JFK LHR 2026-10-25 \
  --time 6-20 \
  --airlines BA KL \
  --class BUSINESS \
  --stops NON_STOP \
  --sort DURATION
支持的参数映射如下:
  • 舱位等级:
    ECONOMY
    (经济舱)、
    PREMIUM_ECONOMY
    (超级经济舱)、
    BUSINESS
    (商务舱)、
    FIRST
    (头等舱)
  • 停留筛选:
    ANY
    (不限)、
    NON_STOP
    (直飞)、
    ONE_STOP
    (一次中转)、
    TWO_PLUS_STOPS
    (两次及以上中转)
  • 排序选项:
    CHEAPEST
    (价格最低)、
    DURATION
    (耗时最短)、
    DEPARTURE_TIME
    (出发时间)、
    ARRIVAL_TIME
    (到达时间)

CLI shorthand

CLI 快捷用法

Fli supports a convenience shorthand where a non-command invocation is treated as a flights search.
Example:
bash
fli JFK LAX 2026-05-15
This behaves like:
bash
fli flights JFK LAX 2026-05-15
Use the explicit
flights
subcommand in examples unless the user asks for shortcuts.
Fli支持便捷简写,不带子命令的调用会被视为航班搜索请求。
示例:
bash
fli JFK LAX 2026-05-15
其效果等同于:
bash
fli flights JFK LAX 2026-05-15
示例中优先使用显式的
flights
子命令,除非用户明确要求使用快捷方式。

MCP usage

MCP 使用说明

Default MCP mode

默认MCP模式

Use
fli-mcp
for Claude Desktop and other STDIO-based MCP clients.
bash
fli-mcp
This is the default recommendation for local assistant integration.
对于Claude Desktop和其他基于STDIO的MCP客户端,使用
fli-mcp
即可:
bash
fli-mcp
这是本地助手集成的默认推荐方案。

HTTP MCP mode

HTTP MCP模式

Use
fli-mcp-http
only when the user needs an HTTP endpoint.
bash
fli-mcp-http
By default, it serves at:
  • http://127.0.0.1:8000/mcp/
For HTTP integrations, the client should send:
  • Accept: application/json, text/event-stream
仅当用户需要HTTP端点时使用
fli-mcp-http
bash
fli-mcp-http
默认服务地址为:
  • http://127.0.0.1:8000/mcp/
进行HTTP集成时,客户端需要发送以下请求头:
  • Accept: application/json, text/event-stream

Claude Desktop setup

Claude Desktop 配置

When the user wants Claude Desktop integration, recommend this config first:
json
{
  "mcpServers": {
    "fli": {
      "command": "fli-mcp",
      "args": []
    }
  }
}
Suggested config paths:
  • macOS:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:
    %APPDATA%\\Claude\\claude_desktop_config.json
  • Linux:
    ~/.config/Claude/claude_desktop_config.json
After editing the config:
  1. fully quit Claude Desktop
  2. relaunch it
  3. start a new conversation
  4. ask for a flight search
Good validation prompt:
Can you search for flights from JFK to LHR on 2026-03-15?
当用户需要集成Claude Desktop时,优先推荐以下配置:
json
{
  "mcpServers": {
    "fli": {
      "command": "fli-mcp",
      "args": []
    }
  }
}
推荐的配置文件路径:
  • macOS:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:
    %APPDATA%\\Claude\\claude_desktop_config.json
  • Linux:
    ~/.config/Claude/claude_desktop_config.json
编辑完配置后:
  1. 完全退出Claude Desktop
  2. 重新启动应用
  3. 开启新的对话
  4. 发起航班搜索请求
有效的验证提示词示例:
你能帮我搜索2026年3月15日从JFK到LHR的航班吗?

Optional MCP environment variables

可选MCP环境变量

If the user wants defaults, these environment variables are relevant:
  • FLI_MCP_DEFAULT_PASSENGERS
  • FLI_MCP_DEFAULT_CURRENCY
  • FLI_MCP_DEFAULT_CABIN_CLASS
  • FLI_MCP_DEFAULT_SORT_BY
  • FLI_MCP_DEFAULT_DEPARTURE_WINDOW
  • FLI_MCP_MAX_RESULTS
Example:
json
{
  "mcpServers": {
    "fli": {
      "command": "fli-mcp",
      "args": [],
      "env": {
        "FLI_MCP_DEFAULT_CURRENCY": "EUR",
        "FLI_MCP_DEFAULT_CABIN_CLASS": "BUSINESS",
        "FLI_MCP_MAX_RESULTS": "10"
      }
    }
  }
}
如果用户需要设置默认值,可以使用以下环境变量:
  • FLI_MCP_DEFAULT_PASSENGERS
  • FLI_MCP_DEFAULT_CURRENCY
  • FLI_MCP_DEFAULT_CABIN_CLASS
  • FLI_MCP_DEFAULT_SORT_BY
  • FLI_MCP_DEFAULT_DEPARTURE_WINDOW
  • FLI_MCP_MAX_RESULTS
示例:
json
{
  "mcpServers": {
    "fli": {
      "command": "fli-mcp",
      "args": [],
      "env": {
        "FLI_MCP_DEFAULT_CURRENCY": "EUR",
        "FLI_MCP_DEFAULT_CABIN_CLASS": "BUSINESS",
        "FLI_MCP_MAX_RESULTS": "10"
      }
    }
  }
}

How to guide users well

如何更好地引导用户

If the user asks to install Fli

如果用户要求安装Fli

Give them the
pipx install flights
path first.
优先提供
pipx install flights
的安装路径。

If the user asks how to use the command line tool

如果用户询问如何使用命令行工具

Show
fli flights ...
and
fli dates ...
examples first.
优先展示
fli flights ...
fli dates ...
的使用示例。

If the user asks how to connect Claude or another assistant

如果用户询问如何连接Claude或其他助手

Show
fli-mcp
and the Claude Desktop config first.
优先展示
fli-mcp
的用法和Claude Desktop的配置方案。

If the user asks for a web endpoint

如果用户需要Web端点

Then show
fli-mcp-http
and mention the
/mcp/
path and
Accept
header.
再展示
fli-mcp-http
的用法,并说明
/mcp/
路径和
Accept
请求头要求。

If the user asks how to contribute or hack on the codebase

如果用户询问如何贡献或修改代码库

That is outside the primary scope of this skill. Only then discuss cloning the repository and using development commands.
这超出了本指南的核心范围,仅在这种场景下讨论克隆仓库和使用开发命令的相关内容。

Common mistakes to prevent

需要避免的常见错误

  • telling users to clone the repository when they only want the tool
  • telling users to install
    fli
    instead of
    flights
  • focusing on the Python API when the user asked for CLI or MCP setup
  • giving HTTP MCP instructions when STDIO MCP is enough
  • forgetting to tell Claude Desktop users to fully restart the app
  • omitting the PATH fix when
    pipx
    installs successfully but commands are not found
  • 当用户仅需要使用工具时,引导用户克隆仓库
  • 引导用户安装
    fli
    而不是
    flights
  • 当用户需要CLI或MCP配置时,反而聚焦Python API的说明
  • 当STDIO MCP足够满足需求时,提供HTTP MCP的使用说明
  • 忘记提醒Claude Desktop用户需要完全重启应用
  • pipx
    安装成功但找不到命令时,遗漏PATH修复的步骤

Troubleshooting

故障排查

fli
or
fli-mcp
not found

找不到
fli
fli-mcp
命令

Try:
bash
python3 -m pipx ensurepath
Then restart the terminal.
尝试执行:
bash
python3 -m pipx ensurepath
然后重启终端。

Python version problems

Python版本问题

Fli requires Python 3.10 or newer.
Check with:
bash
python3 --version
Fli要求Python 3.10或更高版本。
可通过以下命令检查版本:
bash
python3 --version

Claude Desktop does not show the tools

Claude Desktop不显示工具

Check these in order:
  1. fli-mcp --help
    works in a terminal
  2. the Claude Desktop config file path is correct
  3. the JSON is valid
  4. Claude Desktop was fully quit and reopened
按以下顺序逐一排查:
  1. 在终端中运行
    fli-mcp --help
    确认可用
  2. 确认Claude Desktop配置文件路径正确
  3. 确认JSON格式有效
  4. 确认Claude Desktop已完全退出并重新启动

Rate limiting or temporary failures

限流或临时故障

Fli includes automatic rate limiting and retries, but live Google Flights requests can still fail temporarily.
If a query fails:
  • retry after a short delay
  • reduce repeated back-to-back searches
  • do not assume the CLI or MCP setup is broken just because one upstream request failed
Fli内置了自动限流和重试机制,但实时的Google Flights请求仍可能临时失败。
如果查询失败:
  • 等待一小段时间后重试
  • 减少连续重复搜索的频率
  • 不要仅因为一次上游请求失败就判定CLI或MCP配置有问题

Public docs

官方文档

Use these docs for product-facing guidance:
  • introduction:
    https://punitarani-fli.mintlify.app/introduction
  • installation:
    https://punitarani-fli.mintlify.app/installation
  • MCP setup:
    https://punitarani-fli.mintlify.app/mcp/setup
  • docs index:
    https://punitarani-fli.mintlify.app/llms.txt
Use product docs for examples and onboarding. Use the actual installed command names when writing instructions.
面向用户的指导可参考以下官方文档:
  • 介绍:
    https://punitarani-fli.mintlify.app/introduction
  • 安装:
    https://punitarani-fli.mintlify.app/installation
  • MCP配置:
    https://punitarani-fli.mintlify.app/mcp/setup
  • 文档索引:
    https://punitarani-fli.mintlify.app/llms.txt
示例和引导可参考官方文档,编写操作指引时请使用实际安装后的命令名称。

Summary

总结

The default recommendation is
pipx install flights
. After that, use
fli
for terminal searches,
fli-mcp
for Claude Desktop and other STDIO MCP clients, and
fli-mcp-http
only when an HTTP MCP endpoint is specifically needed.
默认推荐安装方式为
pipx install flights
。安装完成后,使用
fli
在终端搜索航班,为Claude Desktop和其他STDIO MCP客户端使用
fli-mcp
,仅当明确需要HTTP MCP端点时使用
fli-mcp-http