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

@okkishops/aireach-cli

v0.1.1

Published

AiReach protected-tool CLI wrapper.

Readme

@okkishops/aireach-cli

AiReach protected-tool CLI wrapper.

This package wraps the okki_ai_reach MCP scene behind a stable CLI boundary:

  • validates inputs against packaged scene schemas
  • resolves the target gateway environment (dev / prod)
  • injects a Bearer token
  • calls tools/call on the JSON-RPC gateway endpoint
  • prints stable JSON to stdout

Command surface

aireach-cli
├─ background
│  ├─ company-background-check
│  ├─ contacts-fetch
│  └─ contact-validity-check
└─ trade
   └─ search

Build

From the monorepo root:

cd skill-platform
bunx tsc -b packages/aireach-cli/tsconfig.json --pretty false

Build output:

  • packages/aireach-cli/dist/
  • packaged schemas under packages/aireach-cli/scenes/

One-step distributable release

From the package directory:

cd skill-platform/packages/aireach-cli
npm run bundle:release

Release output directory:

  • dist/release/aireach-cli-<version>/

Included release artifacts:

  • npm tarball for portable install
  • single-file JS bundle
  • current-host native binary
  • native target matrix under native-matrix/
  • manifest.json
  • SHA256SUMS
  • INSTALL.md

This is the recommended command when you need a distributable CLI drop rather than an intermediate build artifact.

Single-file JS bundle

From the package directory:

cd skill-platform/packages/aireach-cli
npm run bundle:single-file

Bundle output:

  • dist/aireach-cli.single.js

Properties verified in this repository:

  • preserves the CLI shebang
  • runs directly after chmod +x
  • resolves schema/help from embedded scenes (embedded://scenes/...)
  • can execute a real live gateway request without a sibling scenes/ directory

Single-file native binary

From the package directory:

cd skill-platform/packages/aireach-cli
npm run bundle:native

Native output:

  • dist/aireach-cli.native

Properties verified on the current host:

  • Bun 1.3.4 --compile produced a standalone executable
  • current host artifact is Mach-O 64-bit executable arm64
  • runs directly after copying to a temp directory with no sibling package files
  • resolves schema/help from embedded scenes (embedded://scenes/...)
  • can execute a real live gateway request as a standalone binary

Go native target matrix

From the package directory:

cd skill-platform/packages/aireach-cli
npm run build:go:matrix

Default verified compile targets on the current host:

  • darwin-arm64 -> dist/go/aireach-cli-darwin-arm64
  • darwin-x64 -> dist/go/aireach-cli-darwin-x64
  • linux-x64 -> dist/go/aireach-cli-linux-x64
  • linux-arm64 -> dist/go/aireach-cli-linux-arm64
  • windows-x64 -> dist/go/aireach-cli-windows-x64.exe
  • windows-ia32 -> dist/go/aireach-cli-windows-ia32.exe

Manifest output:

  • dist/go/manifest.json

Override targets with a comma-separated env var:

AIREACH_GO_TARGETS='darwin-arm64,windows-x64,windows-ia32' npm run build:go:matrix

Notes:

  • Go matrix artifacts are copied into separate platform packages by npm run build:platforms
  • the npm bin entry uses a Node launcher at dist/bin/aireach-cli.js, which picks a matching optional platform package when present and falls back to dist/index.js
  • Go release binaries are much smaller than Bun --compile binaries and are the preferred npm platform package payload
  • dist/aireach-cli.native remains the simplest current-host Bun output when you only need one binary

Platform packages

From the package directory:

cd skill-platform/packages/aireach-cli
npm run build:platforms

This creates platform package directories under:

  • dist/platform-packages/darwin-arm64/ -> @okkishops/aireach-cli-darwin-arm64
  • dist/platform-packages/darwin-x64/ -> @okkishops/aireach-cli-darwin-x64
  • dist/platform-packages/linux-x64/ -> @okkishops/aireach-cli-linux-x64
  • dist/platform-packages/linux-arm64/ -> @okkishops/aireach-cli-linux-arm64
  • dist/platform-packages/windows-x64/ -> @okkishops/aireach-cli-windows-x64
  • dist/platform-packages/windows-ia32/ -> @okkishops/aireach-cli-windows-ia32

Windows 32-bit is named windows-ia32 because Node reports that architecture as process.arch === "ia32" and npm uses cpu: ["ia32"].

Each platform package declares os and cpu so npm installs only the package matching the user's environment when it is pulled as an optional dependency of @okkishops/aireach-cli.

Pack for distribution

From the package directory:

cd skill-platform/packages/aireach-cli
npm pack

This produces a tarball such as:

  • okkishops-aireach-cli-0.1.0.tgz

The main tarball contains only:

  • dist/ JS fallback and launcher files
  • scenes/
  • package.json
  • README.md

It does not contain dist/go/** or dist/native/**; native binaries are distributed through optional platform packages.

Install from tarball

mkdir /tmp/aireach-cli-smoke && cd /tmp/aireach-cli-smoke
npm init -y
npm install /path/to/okkishops-aireach-cli-0.1.0.tgz

Binary path after install:

./node_modules/.bin/aireach-cli --help

Authentication model

aireach-cli implements its own OAuth PAT login flow; social-cli is not required.

Login/status/logout:

aireach-cli auth login
aireach-cli auth status
aireach-cli auth logout

auth login opens the OAuth PAT page, listens on a localhost callback, exchanges the callback delivery code, and writes the PAT to:

~/.okki-agent/social-media/settings.json -> oauth.pat_token

The settings format is intentionally compatible with existing local PAT state, but aireach-cli does not execute or depend on social-cli.

Token resolution order for business calls:

  1. --bearer-token
  2. AIREACH_BEARER_TOKEN
  3. AIREACH_PAT_TOKEN
  4. AIREACH_SOCIAL_CLI_PAT_TOKEN
  5. --bearer-token-file
  6. AIREACH_BEARER_TOKEN_FILE
  7. ~/.okki-agent/social-media/settings.json -> oauth.pat_token

Notes:

  • PAT and access token are both sent as:
    • Authorization: Bearer <token>
  • AIREACH_PAT_TOKEN and AIREACH_SOCIAL_CLI_PAT_TOKEN can be used when you want to inject a PAT directly from the environment instead of reading local settings
  • AIREACH_SETTINGS_PATH can point auth commands and token loading at a custom settings file; AIREACH_SOCIAL_CLI_SETTINGS_PATH remains as a compatibility alias
  • AIREACH_GATEWAY_ENV=dev|prod can force the environment
  • if AIREACH_GATEWAY_ENV is not set, the CLI infers env from AIREACH_JSONRPC_URL
  • .dev.xiaoman.cn resolves to dev; everything else defaults to prod

Examples

Help

aireach-cli --help
aireach-cli trade search --help

Dry run with flags (trade search)

./node_modules/.bin/aireach-cli trade search \
  --keyword chair \
  --search-type PRODUCT \
  --data-country-code US \
  --data-type IMPDAT \
  --page 1 \
  --size 2 \
  --sort-field DATE \
  --sort-type DESC \
  --dry-run

Real trade search with default prod gateway

./node_modules/.bin/aireach-cli trade search \
  --keyword chair \
  --search-type PRODUCT \
  --data-country-code US \
  --data-type IMPDAT \
  --page 1 \
  --size 2 \
  --sort-field DATE \
  --sort-type DESC

Real trade search with explicit dev gateway override

AIREACH_JSONRPC_URL='https://oauth-gateway.dev.xiaoman.cn/mcp/aireach/jsonrpc/accio_work_aireach' \
./node_modules/.bin/aireach-cli trade search \
  --keyword chair \
  --search-type PRODUCT \
  --data-country-code US \
  --data-type IMPDAT \
  --page 1 \
  --size 2 \
  --sort-field DATE \
  --sort-type DESC

Real trade search with JSON input

AIREACH_JSONRPC_URL='https://oauth-gateway.dev.xiaoman.cn/mcp/aireach/jsonrpc/accio_work_aireach' \
./node_modules/.bin/aireach-cli trade search \
  --input '{"keyword":"chair","search_type":"PRODUCT","data_country_codes":["US"],"data_type":"IMPDAT","page":1,"size":2,"sort_field":"DATE","sort_type":"DESC"}'

Real call with explicit bearer token file

AIREACH_JSONRPC_URL='https://oauth-gateway.dev.xiaoman.cn/mcp/aireach/jsonrpc/accio_work_aireach' \
./node_modules/.bin/aireach-cli trade search \
  --bearer-token-file /tmp/openclaw-device-token.json \
  --input '{"keyword":"chair","search_type":"PRODUCT","data_country_codes":["US"],"data_type":"IMPDAT","page":1,"size":2,"sort_field":"DATE","sort_type":"DESC"}'

Verified status

Verified against the live dev gateway:

  • trade search
  • background contacts-fetch
  • background contact-validity-check
  • background company-background-check ✅ on cache-hit fast path
  • background company-background-check non-cache slow path reaches real upstream createTask, but current probe hit an upstream timeout in okki_leads_service

Exit semantics

  • success: stdout JSON with success: true
  • validation / auth / transport failure: stderr JSON with success: false

Example failure shape:

{
  "success": false,
  "error": "input schema validation failed: $.operation is required"
}

Distribution note

This package now supports three verified shapes:

  • npm tarball distribution with a cross-platform Node bin launcher at dist/bin/aireach-cli.js
  • self-contained single-file JS bundle at dist/aireach-cli.single.js
  • standalone native binary at dist/aireach-cli.native on the current host

Important boundary:

  • npm tarballs remain the primary portable package distribution
  • the main @okkishops/aireach-cli tarball excludes dist/go/** and dist/native/** and depends on platform native packages via optionalDependencies
  • if a platform package is unavailable or skipped, the launcher falls back to the JS CLI entrypoint at dist/index.js
  • dist/aireach-cli.single.js and dist/aireach-cli.native are local build artifacts and are excluded from the tarball payload
  • dist/aireach-cli.native is host/architecture-specific, not a universal binary