hktitan/swiggy-cli
v0.2.4MIT
Swiggy for AI agents: skills for the official Swiggy MCP servers (Food, Instamart, Dineout — 51 tools, UPI/Swiggy Money payments) and for the swiggy-cli wrapper, plus the three MCP server connections.
Changelog
All notable changes to swiggy-cli are documented here. The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.4] - 2026-09-05
Fixed
- Shell: a line entered while a command was still running was dropped (the same bug the app had in 0.2.2); it is now queued and runs next. This was the cause of the intermittent Node 20 CI failures in
test/shell.test.ts(exitsent before the previous command finished, so the session never ended).
[0.2.3] - 2026-09-05
Changed
- README: the banner now sits under the install block; the banner image shows the
v0.2series instead of a fixed version. No code changes.
[0.2.2] - 2026-09-05
Fixed
- App: a line entered while a command was still running was silently dropped; it is now queued (shown as
next: …in the status line) and runs as soon as the current command finishes. Also removes a timing flake in the fake-terminal tests.
[0.2.1] - 2026-09-05
Added
swiggy app(aliasui) — a full-screen session, now the default whenswiggyruns with no arguments in a terminal. Alternate screen, synchronized (tear-free) frames, an output pane with the native views, ↑/↓ over the numbered rows of the last listing, Enter to do the obvious next thing (restaurant → menu, dish/product → add 1, Dineout restaurant → slots, slot → preparedbookline, order → details, address → set default), inline y/n confirmations, live output while a command runs, tab completion (shared prefix, then candidates), history,c/o/ashortcuts, PgUp/PgDn scrolling.src/lib/prompter.ts— one interface for interactive prompts (address picker, confirmations). Plain runs use thepromptslibrary;shellanswers on its own readline; the app answers in its status line / pane.- A status sink in
src/lib/ui.tsso a host can render progress itself. getLastList()insrc/lib/recent.ts(the last listing with its kind and server) andlastinrecent.json.- End-to-end tests that drive the app and the shell through fake terminals against the mock MCP server (
test/app.test.ts,test/shell.test.ts,test/helpers/fake-tty.ts).
Fixed
swiggy shellended after the first command whenever that command asked a question (typically the address picker): thepromptslibrary opened a second readline on stdin, reset raw mode and closed it, leaving nothing to keep the process alive. Sessions now own every prompt and never hand stdin to another reader.- The startup banner printed once per command inside a session (
SWIGGY_SHELL_ACTIVEis now set by the session). food nonsense/food menu --helpinside a session exited the process: commander's exit override is now applied to every subcommand.- Numbered rows were written to
recent.jsonwithout being awaited, so a command run immediately after a listing (only possible inside a session) could miss them.
Changed
- An address picked interactively is carried to the following commands (
recent.jsoncontext) until a default is set or--address-idis passed — a session without a default address asks once, not per command. - Tab completion in
shelland the app fills the shared prefix when several commands match.
0.2.0 - 2026-09-05
Catches up with everything Swiggy shipped on MCP between April and September 2026 (verified against https://mcp.swiggy.com/builders/docs/ on 2026-09-05) and makes the CLI pleasant for humans and reliable for agents.
Added
- Payments (Swiggy MCP July 2026): the shared Payment stage on every server —
payment-options,payment-status [--wait],confirm-order— and--pay cash|upi|upi:<app>|swiggypay [--wait]onfood checkout,instamart checkoutanddineout book.--waitshares the scan-or-tapbridgeUrl, pollscheck_payment_statuson Swiggy's cadence (never tight-loops the long-poll), applies the per-serverconfirm_ordercontract and exits 10 (PAYMENT_FAILED) on failed / cancelled / cart-changed / refund / timeout. Swiggy Money (announced for MCP 2026-09-04) is passed through as theSwiggyPaymethod group when the server offers it. - New verbs for tools added upstream: Food
create-address,delete-address,delivery-status; Instamartlist-coupons,apply-coupon,delivery-status; Dineoutcancel;report-erroron every server. - Native views and numbered references. Every Swiggy response has its own renderer built from the documented output schemas (restaurants, menu, dishes, food cart with bill, products with variations, Instamart cart, orders, order detail, tracking, dineout results/details/slots, booking, payment options, placed order, delivery status, coupons). Listings number their rows and remember them (
~/.swiggy/cache/recent.json), so the next command accepts2/#2instead of an id:food menu 1,food add 3 --qty 2,instamart add 1,dineout slots 1,dineout book 2 --guests 2,food order 1. Follow-up context (item → restaurant, slot →slotId/itemId/reservationTime, Dineout coordinates) is carried automatically. Progress lines use plain language ("Searching restaurants") instead of tool names. food add(alias ofadd-to-cart),instamart add(reads the cart and merges — upstreamupdate_cartreplaces),dineout book <#> --guests <n>(creates the booking cart itself for paid deals), positional queries (food search biryani), and aliasesdishes,coupons,coupon,clear,eta,usual,info,availability,reserve,place-order,order-now.llm-wiki/— an LLM-maintained research wiki (Karpathy's pattern): schema, index, log, raw sources and 30 pages recording every dated fact about Swiggy MCP, the contradictions inside Swiggy's docs, and open questions.swiggy docs [path] [--full]— fetch Swiggy Builders Club docs as Markdown (llms.txt, per-page.md).swiggy mcp-config --client claude|claude-code|cursor|vscode|windsurf|codex|plugin|generic.swiggy shell— interactive session with tab completion, persisted history and one warm MCP session (also the default whenswiggyruns with no arguments in a terminal).swiggy tools <server> --offline(bundled catalog) and catalog-drift reporting inswiggy doctor.- Profile fields
defaultAddressId,defaultLat,defaultLng; the CLI also remembers the coordinates Dineout returns soslots/cart/bookwork without flags. meta.rateLimit(fromX-RateLimit-*),meta.message(Swiggy's human message),meta.deprecation(_meta.swiggy.deprecation, when Swiggy starts emitting it) andmeta.paymentin the JSON envelope. New error codesRATE_LIMITED(exit 9) andPAYMENT_FAILED(exit 10).- Terminal polish borrowed from Grok Build's TUI: adaptive truecolor/256/16 palette with truecolor upgrade under tmux/SSH, OSC 8 hyperlinks, DEC 2026 synchronized-output status line with elapsed time, OSC 9;4 progress on Ghostty/WezTerm/iTerm2 3.6+/Windows Terminal, Markdown rendering of Swiggy messages, SIGINT cleanup.
- 14 Agent-Skills-spec skills under
skills/(8 for the CLI, 6 for the official MCP servers incl. a generated 51-tool parameter reference), an Agent Plugins 1.0.0 manifest (plugin.json,mcp.json), a Claude Code plugin + marketplace (.claude-plugin/,.mcp.json), andscripts/validate-skills.mjs. - Test suite: unit tests for the catalog, payments and envelope logic;
McpClientagainst a mock Streamable-HTTP server (sessions, expiry recovery, SSE, 401/419/429/-32001); black-box tests of the built binary. CI runs on Node 20/22/24.
Changed
- Every ergonomic command now sends the parameter names Swiggy documents (camelCase
addressId,restaurantId,orderId,cartItems[].menu_item_id,selectedAddressId+items[].spinId/skuId, Dineoutlatitude/longitude,slotId/itemId/reservationTime/guestCount, …). 0.1.x sent guessed snake_case names that the servers ignored, so most Layer A verbs never worked end-to-end. - Tool catalog: 35 → 51 tools (Food 20, Instamart 19, Dineout 12).
- Auth: RFC 9728 protected-resource + RFC 8414 discovery, dynamic client registration (no
--client-idneeded), scopemcp:tools mcp:resources mcp:prompts, browser auto-open (--no-browserto disable), callback timeout, JSON fallback on token exchange. One login now stores one token for all three servers instead of running three flows; a missing per-server entry borrows a valid token from another server. Expiry skew 60 s; hints explain that tokens last 5 days and refresh tokens are not issued yet. - MCP client: persists
Mcp-Session-Idper server across invocations and re-initializes once on HTTP 404 (session expiry); maps HTTP 419 and JSON-RPC-32001toAUTH_REQUIRED, HTTP 429 toRATE_LIMITEDwithRetry-After; sendsUser-Agent; SSE frames are matched by request id. - JSON envelope:
datais now the tool's own payload — the Swiggy{success,data,message}wrapper is unwrapped andsuccess:falsebecomesMCP_ERROR(exit 6) withreportLinkhints. Use--rawfor the previous shape. Error envelopes now carryhint. - Human renderer: picks the most useful list in a payload, prioritises id/name columns, truncates long cells, prints scalar fields below the table;
--plainuses the same column choice. - Usage errors thrown inside subcommands are rendered in the requested output mode (previously
--jsonwas ignored for them). instamart add-to-cartis nowset-cart(alias kept) because upstreamupdate_cartreplaces the cart;food add-to-carttakes--item-id <menu_item_id>and--items <json>for variants/addons;instamart trackrequires--lat/--lng(upstream requirement);dineout slotstakes--dateonly (guest count belongs tobook).swiggy auth initshows the sign-in URL as a clickable link and reports the token expiry.doctorno longer fails when you are simply not signed in; it also checks docs reachability and terminal capabilities.- Dependencies: dropped
chalk,ora,zod; upgradedcommander15,vitest5,tsx,@types/node. Version is read frompackage.json(the CLI reported 0.1.3 while the package was 0.1.4). filesnow shipsskills/, plugin manifests andassets/in the npm package.
Fixed
--jsonon subcommands not being honoured for usage errors.- Version mismatch between
--versionandpackage.json. - Spinner output leaking into stdout in some terminals (all status output is on stderr with synchronized writes).
notifications/initializedno longer leaves a dangling response body.
Removed
zod(unused),chalk,ora.
0.1.4 - 2026-04-30
- Hardened live end-to-end UX; version bump. (See git history for 0.1.0 – 0.1.4.)
0.1.0 - 2026-04-28
- Initial public scaffold targeting 35 tools across the three official Swiggy MCP servers; Layer A verbs, Layer B generic commands, JSON envelope, exit codes, OAuth + PKCE, profiles, doctor, wiki, AGENTS.md, skills, CI + tag release.