Skip to content

Repository files navigation

Trip Optimizer Pro

Trip Optimizer Pro

If you love travel like I do, you know the pain: before every trip you're deep in Google, TripAdvisor, 小红书, 携程, reading strangers' tips, comparing restaurants, checking transit schedules. You easily spend days, sometimes weeks, on research. Travel is supposed to be leisure and relaxation, not a second job.

trip-optimizer autonomously optimizes travel plans using Andrej Karpathy's autoresearch pattern — an AI that researches, scores, and iteratively improves your itinerary.

支持 English中文(简体中文) -- 在初始化时选择语言,整个体验随之适配:提示语、生成的行程、研究搜索、评分系统全部使用您选择的语言。

Trip Optimizer Pro — ChatGPT Version (NEW)

When I released the CLI, many friends were excited to try it — then hit the first step: npm install. "Do I need to download something?" "What's a terminal?" These are smart, well-traveled people who use ChatGPT every day. They just live outside the bubble where CLI tools and API keys are second nature.

This is the AI diffusion problem: 95% of people outside the AI bubble have no idea what's going on in here. They've never heard of Claude Code. They don't know what an "agent" is. The gap between what's possible and what's accessible is enormous.

So I built a new interface. Same optimization engine — score, mutate, keep/revert — but wrapped in a ChatGPT conversation. No install. No API key. No terminal. You just talk to it.

Try it now: ChatGPT > Explore GPTs > search "Trip Optimizer Pro"

It asks you a few questions, generates a richly detailed plan, scores it honestly, then iteratively improves it. The plans are specific — named restaurants with signature dishes, sensory descriptions that make you want to book the flight, practical timing notes, not generic guidebook filler. Save your progress and come back across multiple sessions to keep optimizing.


CLI Version

Everything below is for the CLI version — for developers and power users who want full control, overnight batch runs, and 100+ optimization iterations.

Install

npm install -g trip-optimizer

Or run directly:

npx trip-optimizer

Quick Start

trip-optimizer init "Japan 2027"
cd japan-2027
trip-optimizer run              # agent mode (default, interactive Claude Code)
trip-optimizer run --standalone  # direct API calls
trip-optimizer run --headless    # agent mode, non-interactive
trip-optimizer dashboard --watch
trip-optimizer plan --pdf        # generate a formatted PDF itinerary

Commands

Core

Command Description
init <name> Create a new trip project
config Manage API keys and settings
profile View travel profile
score One-off absolute scoring
research [city] Research sprint
run Start optimization loop (agent mode)
run --standalone Optimization via direct API calls
run --headless Agent mode, non-interactive
status Show progress
dashboard Live optimization dashboard
chart ASCII score chart
plan Pretty-print travel plan
plan --json Output structured plan data
plan --pdf Generate a PDF document
debrief Post-trip feedback
history View past trips

Agent CLI

Commands designed for programmatic use by AI agents (e.g. via OpenClaw iMessage integration). All support --json for structured output with error codes and actionable hints.

Command Description
trip list List registered trips
trip show --trip <id> Show trip plan (use --day N to filter)
trip set-default --trip <id> Set the default trip
ask --trip <id> --question <q> Ask a natural-language question about the plan
propose --trip <id> --request <text> Propose a plan change (returns proposal for review)
proposals --trip <id> List proposals (use --status to filter)
apply --trip <id> --proposal <id> Apply a pending proposal (conflict detection via version ID)
reject --trip <id> --proposal <id> Reject a proposal
reoptimize --trip <id> --scope <s> Re-optimize a scoped portion (e.g. day:3, city:Tokyo)
migrate <path> Convert an existing plan.md to structured plan.json

Proposal lifecycle: propose generates a candidate plan and saves it as a pending proposal. Use proposals to inspect, then apply or reject. Applied changes bump the plan version; conflicts are detected automatically if the base version has changed.

Trip registry: Trips are registered globally in ~/.trip-optimizer/trips.json. Use --trip <id> to target a specific trip, or set a default with trip set-default.

How It Works

Travel CLI screenshot

Trip-optimizer follows the autoresearch pattern: it autonomously researches destinations, generates plan mutations, scores results, and keeps only improvements. Each optimization iteration proposes targeted changes -- swapping a restaurant, adjusting timing, adding a hidden-gem activity -- then evaluates whether the change improved the overall plan. Bad mutations are discarded; good ones accumulate.

Scoring uses a 3-pass pipeline. First, the plan is evaluated across seven weighted dimensions (experience, logistics, food, time management, budget, accommodation, and transit). Then an adversarial critic searches for concrete flaws -- unconfirmed bookings, chain restaurants, vague transit -- and applies penalties. Finally, a holistic adjustment reconciles the dimension scores with the critic's findings into a single composite score.

The system builds persistent memory across trips. After each trip, a debrief captures what worked and what didn't. These learnings are stored in learned.json and feed back into scoring rubrics and research priorities for future trips, so the optimizer gets smarter over time.

语言与本地化

init 的第一个问题是语言选择。选择 中文 后:

  • 所有命令行提示和消息以中文显示
  • 生成的行程、评分标准和计划均以简体中文撰写
  • 研究优先使用中文平台(小红书、大众点评、马蜂窝、携程),而非英文来源
  • 搜索关键词使用中文(本地人推荐、避雷指南、苍蝇馆子),同时辅以英文补充搜索
  • PDF 输出正确渲染中文内容

Custom Model Support

During init, you can optionally configure a custom LLM instead of the default Anthropic/Vertex provider. Any OpenAI-compatible API works -- Kimi (Moonshot), DeepSeek, and others. Custom models run in --standalone mode; agent mode always uses Claude Code.

Requirements

  • Node.js 22+
  • One of:
    • Anthropic API key (via trip-optimizer config or ANTHROPIC_API_KEY)
    • Google Cloud Vertex AI (CLAUDE_CODE_USE_VERTEX=1 + GOOGLE_CLOUD_PROJECT)
    • Custom OpenAI-compatible API (configured during init)

License

MIT

About

Autonomously optimize travel plans using the autoresearch pattern

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages