Fortrip

Overview

Commands print compact text on stdout, or the response as one line of JSON with --json, and errors on stderr with a fixed exit code.

The exceptions: fortrip guide prints Markdown, fortrip mcp speaks MCP over stdin and stdout, and --help and --version print plain text.

Install

npm install -g fortrip

Or 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

CommandDescription
fortrip hotels searchSearch hotels
fortrip hotels getHotel details
fortrip hotels offersLive offers
fortrip hotels bookCreate order
fortrip orders getGet order
fortrip orders listList orders
fortrip orders cancelCancel order
fortrip orders payPay order
fortrip loginSign in
fortrip logoutSign out
fortrip whoamiShow account
fortrip guideAgent guide
fortrip mcpLocal MCP server

Options of the CLI itself:

FlagDescription
-h, --helpShow help for the command or group, or for the CLI when no command is given.
-v, --versionPrint the CLI version.
--jsonPrint the answer as its JSON on one line instead of text; an error prints its JSON envelope, on stderr.

Raw request body

hotels search, hotels offers 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 and the HTTP API bodies.

fortrip hotels search --body '{"destination":{"kind":"place_name","name":"Bangkok","countryCode":"TH"},"filters":{"stars":{"min":5}},"sort":"stars_desc"}'

Environment

VariableMeaning
FORTRIP_TOKENUse this access token instead of the saved sign-in, e.g. in a remote sandbox or on a CI run. An access token is short-lived, so it suits one sandbox session or one CI run; for longer, sign in.
FORTRIP_DISPLAY_CURRENCYDefault --display-currency for hotels search and hotels offers. It never changes what is charged.
FORTRIP_API_URLThe API's base URL (default https://api.fortrip.ai). It must be https, except for localhost, 127.0.0.1 and [::1], which may use plain http. It may end in a path prefix (http://localhost:3000/api/public), which every request path follows; a query or fragment is dropped.
FORTRIP_MCP_URLThe MCP server fortrip mcp bridges to (default https://mcp.fortrip.ai/), under the same URL rule. Your sign-in is sent to it, so it must be the MCP server of the API you use: on the origin of FORTRIP_API_URL, except that the default API goes with the default MCP server, api.fortrip.ai and mcp.fortrip.ai. When you set FORTRIP_API_URL to a local API, set FORTRIP_MCP_URL too; fortrip mcp exits 2 and says so when you don't.

Exit codes are listed in Errors & limits.

On this page