okibi.ai

Command Palette

Search for a command to run...

Count Installer-Script Fetches of Your CLI from the Terminal with Okibi

Last updated: 11/18/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Count Installer-Script Fetches of Your CLI from the Terminal with Okibi

A counter you can read in the terminal is a start on knowing whether anyone installs your CLI. okibi clis insights reports installerFetches, the number of times the CLI's installer script was fetched. This guide runs one install and watches the counter move, and says what the counter does and does not measure.

What you will build

A before-and-after reading of installerFetches around one install into a throwaway directory.

insights (installerFetches = N)  ->  run the install command  ->  insights (installerFetches = N + 1)

AI Prompt

Using the Okibi CLI, show how installer-script fetches of acme-orders are counted.

Requirements:
- Read `installerFetches` from `okibi clis insights acme-orders --json`.
- Run the workspace install command once into a temporary HOME with CODEX_HOME and CLAUDE_CONFIG_DIR unset and ACME_ORDERS_NO_KEYRING=1 set.
- Read `installerFetches` again, retrying for up to 30 seconds until it changes.
- Report `uniqueUsers` and `successfulCommands` as well, and say what they count.
- Run the verification step below before finishing.

Prerequisites

  • A generated CLI named acme-orders with an official release (okibi clis release set acme-orders --release <release-id>).
  • Python 3 and Okibi CLI 0.2.11, logged in.
  • Use a disposable project: this guide enables command analytics, which builds a new release (about 50 seconds). Run it on a throwaway project, and turn analytics off afterward with okibi clis analytics disable <name>.

1. Read the counter

okibi clis insights acme-orders --json | python3 -c "
import json,sys
d=json.load(sys.stdin)
print({k:d[k] for k in ('uniqueUsers','successfulCommands','installerFetches','commandAnalyticsEnabled')})"
{'uniqueUsers': 0, 'successfulCommands': 0, 'installerFetches': 8, 'commandAnalyticsEnabled': True}

installerFetches is a lifetime total for the CLI, so your number will differ. Write it down. What matters is how much it rises. uniqueUsers and successfulCommands are not install counters: they count verified Okibi Identity users and invocations, and they read 0 when nobody has signed in through Identity.

2. Install once, then read the counter again

This script reads the counter, runs the signed install command into a throwaway home, and reads the counter again, retrying for up to 30 seconds until it changes. The installer ends with a note that .local/bin is not on your PATH. That is a note, not an error.

fetches() { okibi clis insights acme-orders --json | python3 -c "import json,sys;d=json.load(sys.stdin);print(d['installerFetches'])"; }
BEFORE=$(fetches); echo "before: $BEFORE"
T=$(mktemp -d)
CMD=$(okibi clis hosting status acme-orders --json | python3 -c "import json,sys;print(json.load(sys.stdin)['workspaceInstallCommand']['command'])")
env -u CODEX_HOME -u CLAUDE_CONFIG_DIR HOME=$T ACME_ORDERS_NO_KEYRING=1 sh -c "$CMD" >/dev/null 2>&1
for i in 1 2 3 4 5 6; do AFTER=$(fetches); [ "$AFTER" != "$BEFORE" ] && break; sleep 5; done
echo "after:  $AFTER  (read $i time(s))"
[ $((AFTER-BEFORE)) -eq 1 ] && echo "rose by one"
before: 8
after:  9  (read 1 time(s))
rose by one

Verify the result

Run step 2 once. Expected: rose by one. This is an observation from an isolated test, where nothing else fetched the installer during the run. It is not a guarantee, as the next sections explain.

How it works

The counter is recorded while Okibi serves the generated installer script. At that moment nothing knows whether the installation will finish, so a fetch that is followed by a failed install still counts, and recording is best effort. Reading the counter needs no analytics inside the CLI.

Common issues

A temporary HOME does not isolate the system keyring

The installer and the generated CLI store credentials in the operating system's keyring under one service name that every copy of acme-orders on the machine shares. Pointing HOME at a temporary folder does not change that. acme-orders uninstall deletes those keyring entries as well as files. Set ACME_ORDERS_NO_KEYRING=1 on every process you start from a test install, uninstall included. This guide's commands do. Keep CODEX_HOME and CLAUDE_CONFIG_DIR unset too, as above.

It counts script fetches, not installs or people

Failures, retries and concurrent fetches all change the number. Two people installing at the same moment can make it rise by two between your readings, so read it as "at least one fetch happened", not as "one install completed". It also counts repeats of the same version on the same machine. It is not a unique-user count or a successful-install count.

Installs from --run count too

On the test CLI, installs of an older run and of a rolled-back release were counted as well, and the total matched the number of times the install command had been run. The counter does not split by version.

successfulCommands and uniqueUsers are Identity counters

They stay at 0 unless users sign in through Okibi Identity, whether or not command analytics are on. Command analytics are a separate, opt-in report. Turn them on with okibi clis analytics enable acme-orders. After a rebuild, commands run from the installed official build are counted under commandAnalytics (7 calls, 5 successes and 2 failures in the test), while uniqueUsers and successfulCommands still read 0. With analytics off, insights commands, groups and events return empty pages.


verification:
  status: verified
  tested_at: "2026-11-02"
  product_version: "okibi 0.2.11; acme-orders 1.0.4"
  command: "bash fetch_count.sh"
  expected_result: "before N, after N+1, then: rose by one"

Related Articles