npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@restoai/resto-datacli

v0.2.8

Published

`resto-datacli` is a deterministic command-line tool for restaurant reporting analysis workflows. It helps an agent sync report knowledge, discover reports and fields, validate explicit query plans, execute validated report API requests, and run determini

Readme

resto-datacli

resto-datacli is a deterministic command-line tool for restaurant reporting analysis workflows. It helps an agent sync report knowledge, discover reports and fields, validate explicit query plans, execute validated report API requests, and run deterministic snapshot transforms.

The boundary is deliberate: the agent decides what the user is asking for, which report or fields are relevant, and how evidence should be interpreted. The CLI and backend services do not infer user intent; they only operate on explicit commands, filters, fields, and plans.

Build, Test, Install

npm install
npm run build
npm test
npm run lint

The package exposes the resto binary from dist/cli.js. npm install from git and npm pack run the build through the prepare script while keeping dist/ ignored in git.

Documentation

Main Commands

  • resto auth login saves a local authentication profile for remote query execution.
  • resto auth status prints local authentication status without printing the token.
  • resto knowledge sync syncs local report knowledge from the configured source.
  • resto knowledge check compares the local package with the remote manifest without downloading artifacts.
  • resto knowledge status shows the current local knowledge package state.
  • resto report search and resto report inspect discover and inspect local report metadata.
  • resto report count, resto report list, and resto report resolve provide fast mapped-report shortcuts from page/menu/route knowledge. search and resolve include recommended, matchKind, and matchReasons when the evidence clearly distinguishes a canonical mapped report from same-title or variant reports.
  • resto field search discovers local report fields, optionally scoped by --report-id.
  • resto playbook list and resto playbook inspect read optional analysis references.
  • resto query validate validates an explicit JSON query plan against local knowledge.
  • resto query execute executes a validated plan and saves a query snapshot.
  • When report-cli-service returns aligned rawRows, snapshots retain them so transforms calculate from raw metrics while continuing to display labels from rows; responses without rawRows remain supported.
  • resto analysis topn ranks rows from an existing snapshot by an explicit metric.
  • resto analysis contribution compares current and baseline snapshots by dimension and metric.
  • resto install-skill registers the bundled resto-datacli skill with AI coding assistants, including a QoderWork-compatible copy under ~/.qoder/skills.

Auth

Interactive login prompts for the CLI auth gateway URL, corporation id, auth method, and secret values. Phone dynamic codes and passwords are hidden while you paste them:

resto auth login --interactive

Phone login uses the CLI auth gateway to send a dynamic verification code, then exchanges the phone number and code for a CLI-platform token:

resto auth login \
  --base-url https://cli.restosuite.cn \
  --plat cli \
  --corporation-id 302 \
  --phone-number <phone-number> \
  --dynamic-code <verification-code>

Password login follows the auth gateway login step flow, encrypts the password with the gateway-compatible RSA-OAEP/SHA-256 public key, and stores the returned token in the same local auth profile:

resto auth login \
  --base-url https://cli.restosuite.cn \
  --plat cli \
  --username <account> \
  --password <password>

--base-url is the CLI auth gateway host used for login and token acquisition. Interactive login defaults to the China production gateway https://cli.restosuite.cn; use https://cli.test.restosuite.ai explicitly for the test environment. --plat defaults to cli. Knowledge manifest sync/check, report query execution, and shop filter lookup go through report-cli-service; configure --report-cli-url or RESTO_REPORT_CLI_URL when using a non-default service endpoint. language-code and timezone default to zh_CN and Asia/Shanghai. For phone login, --phone-area-code defaults to +86 and --phone-region defaults to CN when omitted. If the gateway password flow requires an explicit tenant or flow step, pass --corporation-id, --login-flow-code, and optionally --login-step-name. For normal email/password login, --login-flow-code is not required; it is kept only as a troubleshooting escape hatch.

Query Backend

resto query execute sends query requests to report-cli-service:

resto query execute --plan ./plan.json

For local report CLI chain testing, start report-api and report-cli-service locally, then point the CLI at the local service:

resto query execute \
  --plan ./plan.json \
  --report-cli-url http://127.0.0.1:18081

The same service URL can be selected with an environment variable:

RESTO_REPORT_CLI_URL=http://127.0.0.1:18081 \
resto query execute --plan ./plan.json

resto shop search also sends shop filter requests to report-cli-service:

resto shop search zn线上店铺 \
  --report-id 888001 \
  --organization-type 1 \
  --org-type-list 1,2 \
  --report-cli-url http://127.0.0.1:18081

Fixture Mode

Fixture mode uses bundled local knowledge and does not require remote services or auth:

resto knowledge sync --fixture
resto knowledge status
resto knowledge check --fixture

Example query plans live in docs/examples. A typical golden-plan check is:

resto knowledge sync --fixture
resto query validate --plan docs/examples/dish-topn-plan.json

Evidence Expectations

Answers built with this CLI should cite the evidence used: report ID, selected fields, filter fields, explicit filter values and time range, currency when available, and the resultId returned by resto query execute. Snapshot transforms should also cite the source resultId, transform name, dimension, and metric. topn should cite its limit. contribution should cite its baseline resultId.

Customer-facing summaries should use Chinese field display names or aliases first. Field codes are internal evidence for query plans, validation, debugging, and engineering handoff; do not expose them by default in business-facing answers unless the user asks for technical details.

Playbooks are reference material, not automatic business conclusions. If a playbook is used, cite its name or ID and explain what was adapted.

Agent workflow guidance is maintained in .agents/skills/resto-datacli/SKILL.md. Verification notes and backend caveats are tracked under docs/verification, including docs/verification/phase1-mvp.md.