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 [--timeout SECONDS]
  • --query — query text (required).
  • --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.1.tar.gz (7.5 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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tripai_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 7.5 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.1.tar.gz
Algorithm Hash digest
SHA256 be1455b9476338022334f98867cea29386483858904710414c75db1e94136650
MD5 6615d860f11dd136cbcdf3d44a8bec1d
BLAKE2b-256 3bf9652bd8047135ef2e3134d7b2a1f36ffd1a8e77c9f38d1b44635c7f801b80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tripai_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b96dc3374a9c1161dd7a0195185a2c4a961ce5ce060cd9fc99c0c8d4ad340ed8
MD5 fdb87f1cbea0f1c22e67cd177d359b7a
BLAKE2b-256 ff1ca1787212c87815e07315f0d82218794fe3e15006ddbe0715814cccaaba2d

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