rollinggo
v0.1.2
Published
RollingGo hotel search CLI for npm and npx.
Readme
rollinggo
rollinggo is a Node CLI package for hotel search, hotel detail lookup, and hotel tag discovery.
It is designed for:
- AI agents that operate a terminal and need stable, structured command interfaces
- engineers who want a scriptable hotel query tool from
npmornpx - local CLI usage with JSON output by default
The npm package name is rollinggo.
The executable command is also rollinggo.
What This Package Does
rollinggo currently exposes three subcommands:
search-hotels: search hotels using destination, date, occupancy, star range, distance, budget, and tag filtershotel-detail: fetch room and pricing detail for a specific hotelhotel-tags: fetch available hotel tag metadata
The CLI is intentionally non-interactive:
- no prompt mode
- no stdin natural-language parsing
- no hidden state between commands
Every query is expressed as one complete command.
This is intentional because AI agents are more reliable with:
- explicit subcommands
- explicit flags
- stable JSON on stdout
- deterministic exit codes
Package Name vs Command Name
There are two names involved:
- package name:
rollinggo - command name:
rollinggo
That is why temporary npx execution looks like this:
npx rollinggo --helpIf the package has been installed globally or linked into your environment, you can also use:
rollinggo --helpChoose a Run Mode
1. Temporary Run with npx
Use this when:
- you do not want to install the tool permanently
- an AI agent needs to run the command in a clean environment
- you are testing the published package quickly
npx rollinggo --helpExample:
npx rollinggo search-hotels --origin-query "Find family-friendly hotels near Tokyo Disneyland" --place "Tokyo Disneyland" --place-type "景点"2. Install Once and Use rollinggo Directly
Use this when:
- the machine will run the tool repeatedly
- an AI agent should call the shortest possible command
- you want
rollinggo ...to work directly from the shell
Install:
npm install -g rollinggoThen use:
rollinggo --help
rollinggo search-hotels --help3. Run from Local Source During Development
Use this when:
- you are working inside this repository
- you want to test local changes before publishing
npm install
npm run build
node dist/cli.js --help
node dist/cli.js search-hotels --help4. Simulate Published npx Usage from a Local Tarball
Use this when:
- you want to verify exactly what
npxwill execute after packaging - you want a realistic smoke test before publishing to npm
npm pack
npx --yes --package ./rollinggo-<version>.tgz rollinggo --helpAPI Key
The CLI resolves the API key in this order:
--api-keyROLLINGGO_API_KEY
Examples:
rollinggo hotel-tags --api-key mcp_your_keyexport ROLLINGGO_API_KEY=mcp_your_key
rollinggo hotel-tagsIf no API key is available, the command fails and writes the error to stderr.
Help and Parameter Discovery
If a user or AI agent does not know which parameters to use, inspect help first.
Top-level help:
rollinggo --helpCommand-specific help:
rollinggo search-hotels --help
rollinggo hotel-detail --help
rollinggo hotel-tags --helpThe help output is intended to answer:
- what the command does
- which flags are required
- accepted value formats such as
YYYY-MM-DDormin,max - supported enum-like values such as
--place-type - a minimal executable example
Recommended AI workflow:
- call
rollinggo --help - call
rollinggo <command> --help - build a structured command
- parse stdout as JSON unless
--format tableis explicitly requested onsearch-hotels
Output Contract
Default output behavior:
- stdout: result payload
- stderr: error messages only
- success output format: JSON by default
search-hotels additionally supports:
--format tableImportant:
tableis for human readingjsonis the stable machine-readable formathotel-detailandhotel-tagsonly supportjson
The CLI keeps bookingUrl fields in responses so booking links remain available to downstream callers.
Exit Codes
0: success1: HTTP request failure or network failure2: CLI validation error or invalid argument combination
Command Reference
search-hotels
Purpose:
- search hotels by destination
- apply structured filters
- return candidate hotels for comparison
Basic syntax:
rollinggo search-hotels --origin-query "<text>" --place "<destination>" --place-type "<type>"Required options:
--origin-queryUser's original natural-language requirement. This is forwarded for semantic understanding and ranking.--placeA single resolvable destination string such as a city, airport, hotel, point of interest, or full address.--place-typeMust match the semantics of--place.
Supported --place-type values:
城市机场景点火车站地铁站酒店区/县详细地址
When to use each common --place-type:
城市: city-level search such as Beijing, Tokyo, Seattle机场: airport-centered search such as Shanghai Pudong International Airport景点: point-of-interest search such as Tokyo Disneyland or Buckingham Palace酒店: hotel-centric search when the place itself is a hotel详细地址: exact address text when the destination is a full street address
Optional filters:
--country-codeISO 3166-1 alpha-2 country code such asCN,US,JP. Useful when place names are ambiguous.--sizeMaximum number of returned hotel results. Recommended range:5to20. Default:5.--check-in-dateCheck-in date inYYYY-MM-DD.--stay-nightsStay length in nights. Integer>= 1.--adult-countAdults per room. Integer>= 1.--distance-in-meterDistance cap in meters. Most useful when--place-typeis a POI-style place such as景点.--star-ratingsStar range inmin,maxformat. Each value must be from0.0to5.0and use0.5increments.--preferred-tagSoft preference tag. Repeat this flag for multiple values.--required-tagHard filter tag. Hotels should match these tags.--excluded-tagExclusion tag. Matching hotels should be filtered out.--preferred-brandSoft brand preference. Repeat this flag for multiple values.--max-price-per-nightMaximum nightly price in CNY.--min-room-sizeMinimum room size in square meters.--formatjsonortable. Default isjson.
Examples:
Search hotels in a city:
rollinggo search-hotels --origin-query "Find high-rated hotels in Seattle" --place "Seattle" --place-type "城市"Search near a point of interest:
rollinggo search-hotels --origin-query "Find family-friendly hotels near Tokyo Disneyland" --place "Tokyo Disneyland" --place-type "景点" --check-in-date 2026-04-01 --stay-nights 2Search with star range and budget:
rollinggo search-hotels --origin-query "Luxury hotels near Buckingham Palace" --place "Buckingham Palace" --place-type "景点" --star-ratings 4.5,5.0 --max-price-per-night 2500Search with repeated tags:
rollinggo search-hotels --origin-query "Family hotels with breakfast and pool" --place "Shanghai Disney Resort" --place-type "景点" --preferred-tag "family friendly" --required-tag "breakfast included" --required-tag "pool"Human-readable table output:
rollinggo search-hotels --origin-query "Hotels in Tokyo" --place "Tokyo" --place-type "城市" --format tableNotes:
- Use
jsonfor AI or script integration. - Use
tableonly when a human is reading the terminal. --star-ratingsmust look like4.0,5.0, not4-5.
hotel-detail
Purpose:
- fetch detail and pricing for one hotel
- inspect room-level or rate-level information after a hotel has already been identified
Basic syntax:
rollinggo hotel-detail --hotel-id <id>Identifier rules:
- you must provide exactly one of
--hotel-idor--name - do not pass both
--hotel-idis preferred whenever available
Why --hotel-id is preferred:
- it is exact
- it avoids fuzzy name matching ambiguity
- it is the natural follow-up after
search-hotels
Options:
--hotel-idUnique hotel ID.--nameHotel name used for fuzzy matching when an ID is unavailable.--check-in-dateCheck-in date inYYYY-MM-DD.--check-out-dateCheck-out date inYYYY-MM-DDand must be later than--check-in-date.--adult-countAdults per room. Integer>= 1.--child-countChildren per room. Integer>= 0. Must match the number of--child-agevalues.--child-ageOne child age per flag occurrence. Example:--child-age 3 --child-age 5.--room-countNumber of rooms. Integer>= 1.--country-codeISO 3166-1 alpha-2 code for locale selection. Defaults toCNwhen locale is sent.--currencyISO 4217 currency code such asCNYorUSD. Defaults toCNYwhen locale is sent.
Examples:
Query by hotel ID:
rollinggo hotel-detail --hotel-id 123456 --check-in-date 2026-04-01 --check-out-date 2026-04-03Query by hotel name:
rollinggo hotel-detail --name "The Ritz-Carlton Tokyo" --check-in-date 2026-04-01 --check-out-date 2026-04-03Query with occupancy detail:
rollinggo hotel-detail --hotel-id 123456 --check-in-date 2026-04-01 --check-out-date 2026-04-03 --adult-count 2 --child-count 2 --child-age 4 --child-age 7 --room-count 1Notes:
- If
--child-count 2is passed, then exactly two--child-ageflags must also be passed. hotel-detailsupports JSON output only.
hotel-tags
Purpose:
- fetch the hotel tag vocabulary or metadata used by the search layer
- inspect available tags before constructing tag-based hotel search filters
Syntax:
rollinggo hotel-tagsExamples:
rollinggo hotel-tagsrollinggo hotel-tags --api-key mcp_your_keyNotes:
- output format is JSON only
- this command is useful for AI systems that want to inspect available tagging concepts before composing
search-hotelsfilters
End-to-End Example Workflows
Workflow 1: Search First, Then Fetch Detail
- search for candidate hotels:
rollinggo search-hotels --origin-query "Find luxury hotels near Tokyo Station" --place "Tokyo Station" --place-type "火车站"pick a hotel from the JSON output, for example by
hotelIdfetch detail:
rollinggo hotel-detail --hotel-id 123456 --check-in-date 2026-04-01 --check-out-date 2026-04-03Workflow 2: AI Agent That Does Not Know Parameters Yet
- inspect command list:
rollinggo --help- inspect target command:
rollinggo search-hotels --helpbuild the structured command
parse stdout as JSON
Workflow 3: Human-Friendly Manual Exploration
- run a table search:
rollinggo search-hotels --origin-query "Hotels in Seoul" --place "Seoul" --place-type "城市" --format table- rerun the chosen result in JSON mode for scripting or further processing
AI Agent Recommendations
If an AI agent is calling this CLI, prefer the following rules:
- always use explicit subcommands
- always prefer JSON output unless a human explicitly asks for a table
- call
--helpbefore executing a command if parameter meaning is uncertain - prefer
--hotel-idover--namewhen both are available - use
search-hotelsfirst, thenhotel-detail - keep one shell command per task
Good AI pattern:
rollinggo search-hotels --origin-query "Find business hotels near Pudong Airport" --place "Shanghai Pudong International Airport" --place-type "机场" --check-in-date 2026-04-01 --stay-nights 1 --format jsonLess reliable pattern:
- vague natural-language stdin
- mixed human explanation in stdout
- partial arguments with implied defaults that the agent never checked
Common Mistakes
Mistake: Passing Both --hotel-id and --name
Do not do this:
rollinggo hotel-detail --hotel-id 123456 --name "Hotel Name"Use exactly one identifier.
Mistake: Wrong --star-ratings Format
Do not use:
--star-ratings 4-5Use:
--star-ratings 4.0,5.0Mistake: --child-count Does Not Match --child-age
Do not do this:
rollinggo hotel-detail --hotel-id 123456 --child-count 2 --child-age 5If --child-count 2, you need two --child-age flags.
Troubleshooting
rollinggo: command not found
Possible reasons:
- the package is not installed globally
- the terminal cannot find global npm binaries
Try:
npx rollinggo --helpOr install globally:
npm install -g rollinggo
rollinggo --helpAPI key missing
If the command reports a missing API key:
- pass
--api-key - or set
ROLLINGGO_API_KEY
Example:
rollinggo hotel-tags --api-key mcp_your_keyTable format used on unsupported commands
--format table only works on search-hotels.
Use JSON for:
hotel-detailhotel-tags
Validation errors
If you get a validation error:
- run the same command with
--help - verify date format
- verify star range format
- verify identifier rules
- verify repeated flag counts such as
--child-age
No results or no room plans
Important distinction:
- the CLI command itself can succeed while the business result is empty for the chosen hotel, date, or filters
Recommended next steps:
- loosen search filters
- increase
--size - remove over-restrictive tags
- verify
--place-type - try another date range
- try another hotel from the search results
Development
Run from local source:
npm install
npm run build
node dist/cli.js --helpRun tests:
npm testSimulate packaged npx usage:
npm pack
npx --yes --package ./rollinggo-<version>.tgz rollinggo --helpPublish
Publish to npm:
npm publishSummary
If you remember only three things, remember these:
- use
npx rollinggo ...for temporary execution andnpm install -g rollinggofor repeated use - use
rollinggo <subcommand> --helpwhenever you are unsure about parameters - use JSON output for AI and automation
