StateJar docs

The statejar command

statejar login signs a terminal in to your account the way gh auth login does. You approve a code in the browser once, and a one-year developer key is stored on the machine, where the Python SDK and the StateJar plugins find it. Your password never passes through the terminal.

What it does

The stored key is used by the Python SDK (StateJar() with no key), and for recall and capture by the StateJar plugins for Claude Code, Codex, OpenCode, OpenClaw and Hermes Agent when their own key setting is empty. The key never appears in the browser, and the command prints only its last four characters.

Install

pip install statejar
statejar login
statejar whoami

The command comes with the Python package. PyPI serves version 0.6.0 (checked on 27 Oct 2026), which has login, whoami and logout. The memory commands (init, add, search, list, forget, export and status) come with version 0.7.0, which is not on PyPI yet. Until then, the Python SDK and the MCP server cover the same ground.

Set it up

OptionWhat it does
--no-browserPrints the link without opening a browser: for SSH sessions, containers and CI.
--device-nameThe name the approval page shows, and the key's label. The default is this machine's host name.
--base-urlThe API to sign in to. The default is STATEJAR_BASE_URL, then https://api.statejar.com/api/v1.

The code is valid for ten minutes; the command checks for your answer every few seconds. Where the key goes:

STATEJAR_API_KEY, when it is set, wins over the stored key, for the SDK and for whoami.

Check it works

  1. statejar whoami prints your address, the key's last four characters, its expiry and the API.
  2. The API keys page lists the key with the label statejar login: and the device's name.

A run against a local StateJar server: statejar login prints the link and waits, the code is approved on the site, and whoami names the account:

statejar login printing the link and its code, the approval arriving, then statejar whoami naming the account and the key's last four characters
Sign in from the terminal. statejar login prints the approval link with its code and waits. The code is approved on the site (the next recording), the terminal stores a key and prints its last four characters, and statejar whoami names the account. Recorded 27 Oct 2026 against a local StateJar server; the output is real, with pauses over 3 s cut to 3 s. Full sizeThe recording (.cast)
The approval page for the code the terminal printed, Approve pressed, and the key's last four characters shown
Approve the terminal's sign-in. The approval page for the code statejar login printed: the code and the device's name shown, Approve pressed, and the new key's last four characters and expiry. Recorded 27 Oct 2026 in Chromium, on this site built from the same code, against a local StateJar server: every frame is a screenshot of the real page; waits for the server are shortened. Full size

Remember and recall from the terminal

From version 0.7.0, which is not on PyPI yet, the command also reads and writes your memory:

CommandWhat it does
statejar add "My budget is ₹3,500."Stores the facts in a message and prints each one with the new handle.
statejar search "What is my budget?"Prints only the facts the question needs, the handle and the audit id of the disclosure.
statejar listEvery fact of the scope's current version.
statejar forget budgetRemoves a fact from the current state, as a new version; history keeps it.
statejar export --out memory.jsonEvery version of the scope with its handle, as JSON; without --out it prints it. The file is written with mode 0600.
statejar statusThe account, the key, the API and the scope's newest version.
statejar initSigns in when no key is found and saves a default scope.

--scope picks the scope (the default is STATEJAR_SCOPE, then the one init saved, then default). The run below used 0.7.0 built from StateJar's own repository, against a local server:

statejar add storing Meera's city, name and contact preference, then her budget, statejar search returning the budget with the handle and the audit id, and statejar list
Remember and recall from the terminal. statejar 0.7.0, not on PyPI yet: statejar add stores Meera's facts and prints each one with the new handle, statejar search prints only what the question needs with the handle and the audit id of the disclosure, and statejar list prints the scope's facts. Recorded 27 Oct 2026 against a local StateJar server; the output is real, with pauses over 3 s cut to 3 s. Full sizeThe recording (.cast)

What it sends

Troubleshooting

This page as Markdown: /docs/cli.md