Introduction
Overview
Commands print JSON on stdout and errors as JSON on stderr, with a fixed exit code. The exceptions: guide prints Markdown, mcp speaks MCP over stdin and stdout, and --help and --version print plain text.
Install
npm install -g fortripOr run any command with npx fortrip. Needs Node.js 22 or newer. Sign in once with fortrip login; you stay signed in until fortrip logout. See Installation.
Commands
| Command | Description |
|---|---|
fortrip hotels search | Search hotels |
fortrip hotels get | Hotel details |
fortrip hotels rates | Live rates |
fortrip hotels book | Create booking |
fortrip login | Sign in |
fortrip logout | Sign out |
fortrip whoami | Show account |
fortrip guide | Agent guide |
fortrip mcp | Local MCP server |
Options of the CLI itself:
-h, --help | Show help for the command or group, or for the CLI when no command is given. |
-v, --version | Print the CLI version. |
Raw request body
hotels search, hotels rates and hotels book also take --body with a JSON object, or --body @file.json. Flags override its fields. Field names and limits are the same as the MCP tool inputs.
fortrip hotels search --body '{"query":"Bangkok","checkIn":"YYYY-MM-DD","checkOut":"YYYY-MM-DD","starMin":5}'Environment
FORTRIP_TOKEN | Use this access token instead of the saved sign-in, e.g. in a remote sandbox or on a CI run. An access token lasts at most 24 hours, so it suits one sandbox session or one CI run, not standing CI. |
FORTRIP_CURRENCY | Default --currency for hotels search and hotels rates. |
FORTRIP_API_URL | API base URL. Default https://fortrip.ai; plain http only for localhost. |
Exit codes are listed in Errors & limits.