Documentation menu

The CLI

getopen on npm: install the tracker with oa init, sign in with oa login, read stats from the terminal.

Install

terminal
npm i -g getopen   # installs the oa command
# or one-off, no install:
npx getopen <command>

oa init: install the tracker

Run it in your project folder. It detects the framework, asks for your tracking key, writes the snippet into the right file, prints which file it changed, and tells you what to do next. Idempotent: a project that already carries the snippet is left alone.

terminal
npx getopen init

# non-interactive (CI, scripts):
npx getopen init --key oa_pk_… --framework nextjs-app --yes

Detected frameworks: Next.js (App and Pages Router), React, Vue, Nuxt, SvelteKit, Remix, Astro, Gatsby, WordPress and plain HTML. The installation guides show what it writes, per framework.

Signing in and reading stats

terminal
oa login                 # OAuth device flow: a code, a browser approval
oa sites                 # the sites your account can read
oa stats --site my-site  # totals; add --from/--to as ISO instants
oa logout
  • Sign-in is the OAuth device flow: the CLI never sees your password, and the grant is revocable any time from Account, Connected apps.
  • Credentials live in ~/.config/oa/credentials.json, restricted to your user (0600), and the CLI says out loud if the filesystem refused the restriction.
  • The CLI is read-only by design: its scopes are site:read analytics:read realtime:read revenue:read, and nothing it can do mutates a site.

Pointing it elsewhere

OA_API_URL overrides the API base for self-hosted or staging deployments; --api does the same per invocation. JSON output for scripts: every read command takes --json.