Orishare

Quickstart

From signup to the first evaluated event with the CLI only, in a few minutes.

You need Node 22 and the orishare CLI (pnpm --filter @orishare/cli build in the monorepo, or the published package). Every command prints JSON with --json and exits with a fixed code: 0 ok, 1 API error, 2 usage, 3 authentication, 4 not found, 5 network.

1. Sign up

orishare --json signup --email [email protected] --org "Acme Audiobooks" --timezone America/New_York --save

--save stores the first personal access token in ~/.config/orishare/config.json (mode 0600) with the new sandbox as the default environment. The response lists both environments; note the sandbox id.

2. Create a secret key for your server

orishare --json keys create --environment env_… --name backend
export ORISHARE_TOKEN=osk_test_…   # printed once

Flags beat environment variables, which beat the profile: --token, ORISHARE_TOKEN, then the saved profile.

3. Publish a rule

Save this as purchase.json:

{
  "schema": "orishare.rule/v1",
  "trigger": { "event": "content.purchased" },
  "limits": [
    { "id": "per_content", "scope": ["customer", "event.properties.content_id"], "max": 1 }
  ],
  "actions": [{ "type": "points.award", "currency": "points", "amount": 100 }]
}
orishare --json rules create --file purchase.json --name purchase --publish
orishare --json rules simulate rule_… --event content.purchased --property content_id=book_1

Simulation runs the real engine against a synthetic event and writes nothing.

Or let the model draft it and review the result before anything is created:

orishare --json ai draft "Give 100 points the first time a customer buys a title"

Drafts are validated against your observed events, currencies and rewards; see AI drafting.

4. Send an event and read the state

orishare --json events send --name content.purchased --customer alice --property content_id=book_1 --sync
orishare --json customers state alice

The sync response carries effects (points.awarded, 100) and a trace naming the rule and its outcome. customers state shows balances, tiers, segments, counters, challenges and issuances. Send the same purchase again and the trace reports the per_content limit as exhausted.

5. Everything else

orishare api <method> <path> reaches any route in the API reference, for example orishare api get /rewards or orishare api post /webhook_endpoints --data @endpoint.json. Use orishare config pull > sandbox.json and orishare --env env_prod… config push --file sandbox.json to preview a promotion to production, then add --apply.

On this page