Skip to main content

CLI for the TripAI skill endpoint.

Project description

tripai_cli

A lightweight command-line client for the TripAI (携程问道) travel assistant.

Ask Ctrip's travel AI anything from your terminal — flights, hotels, trains, attractions — no browser, no app.

PyPI Python versions Apache-2.0 License

Overview · Features · Install · Usage · Security · License


Overview

tripai_cli is a thin wrapper around the TripAI skill powered by Ctrip (携程). It sends your natural-language query to the TripAI service and prints the raw JSON response to stdout — ideal for shell pipelines, scripting, or wiring into other agents.

Features

  • Natural Language Interface — Ask in plain English or Chinese.
  • Zero Dependencies — Pure Python standard library (urllib + json).
  • Comprehensive Travel Search — Hotels, flights, trains, attractions, trip planning, LBS-based recommendations.
  • Pipeline Friendly — Prints raw JSON to stdout; pipe into jq, downstream scripts, or other CLIs.
  • No API Key Required — Works out of the box (may be rate-limited).

Install

pip install tripai_cli

Requires Python 3.8+.

Usage

tripai --query "帮我推荐几个三亚的景点"

The command prints the raw JSON body returned by the server. Pipe it into jq to pretty-print or extract fields:

tripai --query "三亚攻略" | jq .

Options

tripai --query QUERY [--token TOKEN] [--timeout SECONDS]
  • --query — query text (required).
  • --token — API token (optional). Obtain one at www.ctrip.com/wendao/openclaw. If omitted or empty, the request is sent without authentication.
  • --timeout — request timeout in seconds (default: 60).

As a module

python -m tripai_cli --query "你好"

As a library

from tripai_cli import cli

body = cli.query("三亚有什么好玩的")
print(body)

Usage Examples

# 酒店预订
tripai --query "预订北京三里屯附近的酒店"

# 交通查询
tripai --query "查一下明天北京到上海的高铁票"

# 附近推荐
tripai --query "下午去故宫,附近有什么高分的老字号餐厅?"

# 亲子出行
tripai --query "想带孩子去三亚,推荐几个带水上乐园的亲子度假村"

# 机票比价
tripai --query "五一去哈尔滨,有便宜的机票吗?"

Security & Privacy

  • No credentials required — This CLI does not send an API token.
  • Third-Party Content — All responses are generated by Ctrip's service. Do not assume the content is always accurate or safe; use discretion.
  • Rate Limits — Anonymous requests may be rate-limited.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tripai_cli-0.1.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tripai_cli-0.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file tripai_cli-0.1.2.tar.gz.

File metadata

  • Download URL: tripai_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tripai_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e8caca45dea493fa673129ad200abea123d3c2d889d82f908debde5c6ebcf5ba
MD5 7a566d1beadcb46eaccbc1cef5a439c4
BLAKE2b-256 96d466780d7a58c4ca20005116ba4371d843c6866a1b80bec77bfc4ffab82e8e

See more details on using hashes here.

File details

Details for the file tripai_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tripai_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tripai_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd5a0d35fda48f0344142105be38f6b3f31c240eba4ff1331f7a61815a930299
MD5 9f9a75ff8231e501e721c2864617a618
BLAKE2b-256 d633dc1068e968746020346b455afc4686465a644db0f0d8e371bda9eefb262c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page