getopen
v0.4.0
Published
Open Analytics from the command line: install the tracking snippet with one command, then read your sites and stats from the terminal.
Maintainers
Readme
getopen
Open Analytics from the command line. One binary, zero dependencies, installs as oa.
npm i -g getopen # installs the oa command
# or one-off, nothing to install:
npx getopen initInstall the snippet
oa initRun it in your project folder. It detects the framework, asks for your tracking key, and writes the snippet where it belongs. Detected frameworks: Next.js (App and Pages Router), TanStack Start, React (Vite / CRA), Vue, Nuxt, SvelteKit, Remix, Astro, Gatsby, WordPress and plain HTML.
The edit is idempotent (running it twice reports "Already installed") and refuses with a named error rather than guessing when a file is not in a shape it can safely edit.
Read your data
oa login # connect this terminal to your account
oa sites # the sites you can read
oa stats --site my-site --json # stats, machine-readableEvery read command takes --json for machine-readable output and --api <url> (or OA_API_URL) to point at your own deployment. Self-hosting? The same commands work against your install.
Exit codes are stable and documented in oa --help.
What's new in 0.4.0
oa initdetects TanStack Start (React and Solid flavours) and writes the script entry into the root route'shead(). Contributed by @DeckardGer.
Links
- Docs: https://getopen.so/docs/cli
- Source and self-hosting: https://github.com/OpenLabs-so/openanalytics
MIT © Voprex Labs
