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

@reorc/datahubmax-cli

v0.1.2

Published

DataHubMax CLI for API Key authenticated data queries

Readme

DataHubMax CLI

DataHubMax CLI is a command-line data tool for Agents and power users. It lets an Agent authenticate with a DataHubMax API Key, query structured market data, and return JSON that can be summarized into customer-facing answers.

The CLI does not perform natural-language planning by itself. A user can ask their own Agent a question in natural language; the Agent decides which datahubmax command to run, parses the JSON result, and writes the final answer.

Capabilities

  • API Key login, status, logout, and doctor checks.
  • Supported-market discovery.
  • Keyword search across products, brands, categories, and ASIN candidates.
  • Product detail, trends, search terms, and variants.
  • Brand trends, products, and category distribution.
  • Category trends, top products, and top brands.
  • Current API Key usage lookup.
  • Stable JSON responses and clear error codes for Agent parsing.

Ask An Agent To Install

Send this prompt to your Agent:

Install DataHubMax CLI for me.

Steps:
1. Install @reorc/datahubmax-cli globally from the public npm registry.
2. Run datahubmax --help to verify the binary is available.
3. Run datahubmax auth status --json.
4. If your runtime supports skills, install the packaged datahubmax Agent Skill. First detect the current OS and shell.
5. On macOS/Linux shell:
   PACKAGE_DIR="$(npm root -g)/@reorc/datahubmax-cli"
   mkdir -p ~/.codex/skills ~/.claude/skills
   rm -rf ~/.codex/skills/datahubmax ~/.claude/skills/datahubmax
   cp -R "$PACKAGE_DIR/skills/datahubmax" ~/.codex/skills/datahubmax 2>/dev/null || true
   cp -R "$PACKAGE_DIR/skills/datahubmax" ~/.claude/skills/datahubmax 2>/dev/null || true
6. On Windows PowerShell, do not run the macOS/Linux commands above. Use:
   $packageDir = Join-Path (npm root -g) '@reorc/datahubmax-cli'
   $codexDir = Join-Path $env:USERPROFILE '.codex\skills\datahubmax'
   $claudeDir = Join-Path $env:USERPROFILE '.claude\skills\datahubmax'
   New-Item -ItemType Directory -Force (Split-Path $codexDir), (Split-Path $claudeDir) | Out-Null
   Remove-Item -Recurse -Force $codexDir, $claudeDir -ErrorAction SilentlyContinue
   Copy-Item -Recurse (Join-Path $packageDir 'skills\datahubmax') $codexDir
   Copy-Item -Recurse (Join-Path $packageDir 'skills\datahubmax') $claudeDir
7. Read the skill's SKILL.md and references before answering DataHubMax questions.
8. If skills are not supported, read AGENT-PROMPT.md from the installed package as the fallback prompt.
9. Do not run auth login yet. Wait for me to provide the DataHubMax API Key in a separate message.

Do not print the full API Key in logs or final responses.

After installation succeeds, send the DataHubMax API Key separately:

Use this DataHubMax API Key to login: <DATAHUBMAX_API_KEY>

Run:
  datahubmax auth login --api-key <DATAHUBMAX_API_KEY>
  datahubmax doctor --json
  datahubmax markets --json

Do not print the full API Key in logs or final responses.

Manual Install

Requirements:

  • Node.js 18 or newer
  • npm
  • A DataHubMax API Key

Install:

npm install -g @reorc/datahubmax-cli
datahubmax --help

Install a pinned version:

npm install -g @reorc/[email protected]

Upgrade:

npm update -g @reorc/datahubmax-cli

Auth

Login with a DataHubMax API Key:

datahubmax auth login --api-key dhm_xxx

If --base-url is not provided on first login, the CLI defaults to:

https://datahubmax.kamay.ai

Use --base-url <url> or DATAHUBMAX_BASE_URL for a test, local, or private environment:

datahubmax auth login --api-key dhm_xxx --base-url https://datahubmax.kamay.ai
DATAHUBMAX_BASE_URL=http://127.0.0.1:3000 datahubmax auth login --api-key dhm_xxx

auth login validates the API Key with DataHubMax before saving it locally. Invalid, disabled, unbound, or disabled-user keys fail immediately and do not overwrite the existing local config.

Check local auth status:

datahubmax auth status --json
datahubmax doctor --json

Logout removes the saved API Key from local config:

datahubmax auth logout

auth logout only removes the API Key saved in ~/.datahubmax/config.json. It does not unset DATAHUBMAX_API_KEY. If auth status --json still reports configured: true after logout, check whether authSource is env.

Auth precedence for API Keys:

  1. --api-key
  2. DATAHUBMAX_API_KEY
  3. ~/.datahubmax/config.json

The CLI never prints full API Keys in status or doctor output.

Agent Skill And Companion Prompt

The package includes a formal Agent Skill at skills/datahubmax/SKILL.md. Use it with Claude Code, Codex, or another skill-aware Agent to decide when to call datahubmax, which command to run, and how to answer from JSON.

The package also includes AGENT-PROMPT.md as a copyable fallback instruction for Agents that cannot install a skill directory.

Quickstart

List supported markets:

datahubmax markets --json

Run queries:

datahubmax search "anker charger" --market US --json
datahubmax product get B09XXXXXXX --market US --json
datahubmax product trends B09XXXXXXX --market US --json
datahubmax product search-terms B09XXXXXXX --market US --json
datahubmax product variants B09XXXXXXX --market US --json
datahubmax brand trends "Anker" --market US --json
datahubmax brand products "Anker" --market US --json
datahubmax brand categories "Anker" --market US --json
datahubmax category trends "Electronics" --market US --json
datahubmax category products "Electronics" --market US --json
datahubmax category brands "Electronics" --market US --json

Read current key usage:

datahubmax usage --days 14 --json

JSON Contract

All commands return JSON.

Successful responses use:

{ "success": true, "data": {} }

Query responses include data.market, data.result, and may include data.empty: true when the request completed but returned no matching rows.

Errors use:

{ "success": false, "error": { "code": "...", "message": "..." } }

Do not infer missing data. If empty: true, result: null, an empty array, NOT_FOUND, or INVALID_ASIN is returned, the Agent should explain that no usable data was found and ask for a better keyword, market, ASIN, brand, or category.

Raw Requests

The raw request escape hatch is read-only and limited to DataHubMax API paths:

datahubmax request get /api/datahubmax/markets --json

Requests outside /api/datahubmax/* are rejected by the CLI.

Supported Markets

The CLI uses the fixed DataHubMax market set:

US, CA, MX, BR, DE, GB, FR, ES, IT, JP

Troubleshooting

INVALID_API_KEY: the API Key does not exist or was typed incorrectly.

API_KEY_DISABLED: the API Key was disabled by an admin.

API_KEY_USER_REQUIRED: the API Key is not bound to an active user.

API_KEY_USER_DISABLED: the user bound to this API Key is disabled.

SCOPE_REQUIRED: the API Key does not have the required scope, for example query:read or usage:read.

INVALID_ASIN: the ASIN is missing or is not a 10-character alphanumeric value.

NOT_FOUND: the requested product, brand, or category data was not found.

LOGIN_FAILED: the base URL is unreachable or did not return a valid DataHubMax API response.

Uninstall

npm uninstall -g @reorc/datahubmax-cli
rm -rf ~/.datahubmax

Only remove ~/.datahubmax if you want to delete the saved API Key and base URL.