CLI reference
Commands, options, output and exit codes.
ocra init
Writes .ocra/config.json for the repository you are in (with --github, also .github/workflows/ocra.yml) and prints what is left to do. It calls no model or network service, never runs gh, and runs git only to find the repository's root (git rev-parse --show-toplevel).
ocra init # .ocra/config.json for the key in your environment
ocra init --github # also the GitHub workflow, safe for pull requests from forks
ocra init --github --same-repo-only
ocra init --provider anthropic # a provider whose key is not in this shell| Option | Meaning |
|---|---|
--github | Also write .github/workflows/ocra.yml, the fork recipe on pull_request_target: members' and collaborators' pull requests are reviewed on every push, others' each time a maintainer adds the ocra-review label; only the base branch is checked out, and nothing from the pull request runs |
--same-repo-only | With --github, the plain pull_request workflow instead. It skips pull requests from forks, which get no secrets there |
--provider <name> | gemini, anthropic, openai or openrouter, in place of the key found in the environment |
--force | Replace existing files. Without it, an existing file is kept, and ocra init says so |
The model. Without --provider, ocra init takes the first of GEMINI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY and OPENROUTER_API_KEY that is set, and names any other it found; OpenRouter is chosen only when no other key is there. It writes one model per tier:
| Provider | top | standard | light | Runtime |
|---|---|---|---|---|
gemini | google/gemini-3.1-pro-preview | google/gemini-3.5-flash | google/gemini-flash-lite-latest | opencode |
anthropic | anthropic/claude-opus-5-5 | anthropic/claude-sonnet-5-5 | anthropic/claude-haiku-4-5 | opencode |
openai | openai/gpt-6-sol | openai/gpt-6-sol | openai/gpt-6-luna | opencode |
openrouter | router/openrouter/free, OpenRouter's router over its free models | the same | the same | direct |
For OpenRouter it warns that quality varies, that free models are not for private code, and that without credits a large review may run out of daily requests.
The runtime. Only OpenRouter, tested live on the direct runtime, is set up on it: the configuration sets "runtime": "direct" and declares the endpoint at a price of 0, and the workflow passes opencode: false, so ocra installs in about 11 MB instead of 175 MB. The others stay on the default opencode runtime, with catalog models OpenCode prices itself; ocra init links to Choosing the runtime. When --github keeps an existing configuration that does not set direct, the workflow installs OpenCode.
For Gemini, the file is:
{
"$schema": "https://raw.githubusercontent.com/jma49/Open-CR-Agent/main/docs/schema/config.v1.json",
"models": {
"top": "google/gemini-3.1-pro-preview",
"standard": "google/gemini-3.5-flash",
"light": "google/gemini-flash-lite-latest"
}
}The key is never written; OpenCode reads it from GEMINI_API_KEY. Change the models like any configuration.
The workflow is the GitHub recipe with the key as a secret, --max-cost-usd 2 per review, opencode: false on the direct runtime, and the Action pinned to this release's commit (actions/checkout by commit too). ocra init --github then prints:
Wrote .ocra/config.json: Gemini models through GEMINI_API_KEY, on the OpenCode runtime.
OpenCode makes the install about 175 MB; to switch to the 11 MB direct runtime later, see https://github.com/jma49/Open-CR-Agent/blob/main/docs/manual/en/providers.mdx#choosing-the-runtime
Wrote .github/workflows/ocra.yml: pull requests from members are reviewed on every push, anyone else's once each time a maintainer adds the ocra-review label.
Next:
1. Store the key as a repository secret (gh asks for its value):
gh secret set GEMINI_API_KEY
2. Create the label that starts a review of an outside pull request:
gh label create ocra-review --description "Review this pull request with ocra"
3. Commit .ocra/config.json and .github/workflows/ocra.yml, and merge them into the default branch:
ocra reads its configuration from a pull request's base branch.In a private repository, remove persist-credentials: false, as the workflow's comment says. ocra init writes to the repository root from any subdirectory and never through a symbolic link. Outside a Git repository, or with no key and no --provider, it exits 2 and writes nothing.
ocra review
Reviews code changes in the current Git repository.
ocra review [options]| Option | Meaning |
|---|---|
| (none) | Review uncommitted changes: staged, unstaged and untracked files |
--from <ref> | Review --to since it diverged from <ref> (merge base) |
--to <ref> | End of the range; defaults to HEAD; requires --from |
--commit <sha> | Review a single commit against its parent |
--format text|json|sarif | Output format; default text. sarif writes SARIF 2.1.0 |
--output <file> | Write the result to a file instead of stdout. The file is replaced whole; a symbolic link at that path, or at a directory on the way inside the repository, is refused (exit 2, before any model call), and so is a path that exists but is not a regular file. So /dev/stdout, a named pipe and process substitution (>(…)) do not work: leave --output out to write to stdout |
--pr <number> | Review a GitHub pull request; see GitHub pull requests |
--repo <owner/name> | Repository of --pr (default: GITHUB_REPOSITORY or origin) |
--mr <iid> | Review a GitLab merge request; see GitLab merge requests |
--project <id|path> | Project of --mr (default: CI_PROJECT_ID or origin) |
--publish | With --pr or --mr: post the review to the pull or merge request |
--full | With --pr or --mr: review every file, not only what changed since the previous review |
--max-cost-usd <n> | Spend limit for the run. At 80%, review tasks still running stop, keeping what they found; their files count as not reviewed (exit 3), unless the task had already finished its review. Verification and judging use the rest; past it, remaining findings are not verified and cannot block. Tasks report spend about every 10 seconds, so a run can overshoot by that much per task plus its step in progress. Tasks run bundle by bundle, so a limited run finishes some files; with --pr the next review continues with the rest |
--plan | Free, no model call: show selected and excluded files, bundles, review tasks and each first prompt's size (with the plan call a task makes under --ultra or for a bundle of five or more files). Where a task's chain is known, estimate those prompts' input cost at the first model's price, per task and in total: a declared provider's price, input unpriced for a price of 0 or ocra Cloud, else input price unknown. Output, later turns, verification and judging are not estimated. Light-model grouping is skipped, so a large change shows one file per bundle (by directory past 20 files). With --pr or --mr it plans what the review would cover: only what changed since the previous review when it can tell, as the review does, and it says so (--full plans everything). No session log |
--import-sarif <file> | Add the results of an analyzer's SARIF 2.1.0 log (Semgrep, CodeQL and others) to the review; repeatable. See SARIF input. Not with --plan |
--ultra | Favor recall over cost; see Modes |
--reviewers <ids> | Run only these reviewers, comma-separated (for example security) |
--temperature <n> | Sampling temperature, 0 to 2; overrides sampling.temperature (Configuration) |
--seed <n> | Sampling seed where runtime and provider support one (not opencode); overrides sampling.seed |
--resume <run-id> | Retry an earlier run of this review without paying again for what it finished: its completed tasks are reused when their inputs are unchanged (same commits, configuration, prompts, ocra version and sampling), and only the rest run; a task that failed or was cut off before it finished (partly reviewed) runs again. Reads the session .ocra/sessions/<run-id>, and only what ocra on this machine wrote there: a session from another machine or user, or one that came with the change, is refused (exit 2), and lines added to it are ignored with a warning. A task that cannot be reused runs and a warning says how many. Reused tasks cost nothing, so a spend limit never keeps them out; they show reusedFrom in the JSON output, and the run's usage is only what it paid. Not with --plan |
--config <file> | Use this configuration file instead of .ocra/config.json (the base branch's with --pr or --mr); it applies with --no-repo-config too. See Configuration |
--no-repo-config | For code you do not trust: ignore .ocra/config.json and its plugins (with --pr, the base branch's too); models come from OCRA_MODEL_* or --config; memory, rules and AGENTS.md from the --from commit, or none |
-h, --help | Show help |
--commit cannot be combined with --from or --to.
Progress
Progress goes to stderr, so --format json on stdout stays machine-readable:
[ocra] Reviewing: Working tree changes
[ocra] 4 file(s) selected, 1 excluded · risk tier: lite
[ocra] 2 bundle(s) (grouped)
[ocra] 2 review task(s)
[ocra] correctness-1 started: auth session handling (2 file(s))
[ocra] correctness-1 reviewing with google/gemini-3.5-flash
[ocra] correctness-1 google/gemini-3.5-flash: 3 step(s), 3 tool call(s) (read_file 2, task_done 1), 19558 in / 118 out / 0 reasoning tokens, $0.0062
[ocra] correctness-1 completed in 5.9s · 0 finding(s)When a model is quiet for 30 seconds, ocra prints Model is thinking....
Exit codes
| Code | Meaning |
|---|---|
0 | Review finished; verdict approved, approved_with_comments or minor_issues |
1 | Verdict significant_concerns: at least one critical finding the verifier confirmed (unconfirmed ones give minor_issues and 0). The verdict is advice and can be influenced by the change under review; see How it works. With --pr, a maintainer's /ocra override for the head commit turns this into 0 (GitHub) |
2 | Usage, Git or configuration error, or no review task completed. The error line names its code, as in ocra [VCS_REF_UNKNOWN]: Unknown commit: nope (codes) |
3 | Review incomplete: a selected file was not reviewed (task failed, timed out, hit the spend or task limit, or no reviewer covers it) or only partly (its reviewer used all 30 steps, or stopped, before the done tool; the message says what to do), or a critical finding could not be verified. Wins over 1, so CI cannot pass an incomplete review |
130 | Interrupted with Ctrl-C or SIGTERM; the partial report is still printed and nothing is published |
JSON output
--format json prints the full report, the same shape as a session's report.json:
- change request, risk tier, verdict, summary;
- coverage per changed file: reviewed, failed, unreviewed (no task started), incomplete (task ended without the done tool;
ended:step_caporstopped_early), unchanged since the previous review, or excluded with a reason; for pull requests, incremental or full and why (scope); - bundles, task outcomes, reviewer/bundle pairs the matrix skipped;
refuted(findings verification dropped, with the reason),unverifiedCriticals(critical findings it failed to check),judgement(what the judge merged, dropped or recalibrated);- findings, and
rereview: earlier findings fixed, not reproduced, not re-checked, unchanged or dismissed, each with itsreviewerwhen recorded; remembered: findings a memory accepted, withsource(repositoryfor.ocra/memory.json,accountfor your ocra Cloud memory); a maintainer's override inchangeRequest.override;- token usage and cost;
spendLimitwith a spend limit (reached:reviewwhen review tasks stopped,totalwhen it all ran out); warnings.
The format is a contract ("version": 1): later releases only add optional fields and new values of a listed set, or change the version. Treat an unknown coverage status as not reviewed.
Each finding has fingerprint (stable across runs; ocra memory add takes a prefix), reviewer, category, severity, verification (confirmed, uncertain or unchecked), file, lines ({ start, end }, absent when not tied to lines), inDiff, status (new, or unfixed when reported before), title, body, optional suggestion, optional fix ({ startLine, endLine, replacement }, offered as a committable suggestion; no reviewer produces one yet), evidence, code (the quote), lowConfidence under --ultra, and provenance (its task, and model when known). Each task in tasks has its usage (tokens and cost; a finding costs what its task did) and, if it ended without the done tool, ended: its files count as partly reviewed.
The report's provenance records:
ocraVersion;promptHash: of the system prompts this configuration sends (reviewers and helper stages; never the change);configHash: of the effective configuration plus--reviewers,--ultraand--max-cost-usd; without sampling or secrets (keys are only named);sampling: thetemperatureandseedapplied, and innotAppliedthose that could not be;agents: per enabled reviewer and theverifier,judgeandhelperroles, itstier, chain inmodels(its own or its tier's),effortwhen set,applied(absent when it made no call), andnotAppliedsampling settings;rules: each path rule'spath,ruleandsource(repositoryfor.ocra/rules.json,shared,accountorplugin);accountSettings: the account settingsversion, when signed in.
The report's JSON Schema (draft 2020-12) is generated from the code and tested against it; reportJsonSchema() in @open-cr-agent/core returns it.
--plan JSON is versioned the same way and has its own JSON Schema: change request, risk tier, scope with a previous review (incremental with since, or full with reason, as in the report), selected and excluded files, bundles, tasks (estimated prompt size, models, effort when set, inputCost when the chain is known: model, the chain's first, and status priced with usd, unpriced or unknown), skipped pairs, groupingSkipped, promptTokens (total), inputCost when any task has one (usd over priced tasks and the count per status), warnings, settings (each key, value, absent for a default, and source), and accountSettings when read.
SARIF output
--format sarif writes the review as a SARIF 2.1.0 log, the format code scanning and security dashboards read. To upload it to GitHub, see Code scanning.
- Rules and results. One rule per reviewer category (
correctness,securityand so on) and one result per finding:- level from severity:
criticaliserror,warningiswarning,suggestionisnote; - message: the title, body and suggestion; region: the finding's lines;
partialFingerprintsholds its fingerprint (ocra/v1);- a finding's
fixgoes infixes, replacing its whole lines; - reviewer, severity, verification, status, task and, when known, model are properties.
- level from severity:
- Findings without lines apply to the whole file: no region.
- Carried-over findings. In a pull request, still-open findings from an earlier review in files this run did not review again are results under the rule
ocra-carried-over, markedunchangedand without lines. - Incomplete reviews. A review that exits
3is marked unsuccessful; the count of files not reviewed and the warnings are notifications; the verdict, risk tier, files not reviewed and cost are run properties.
Text from the change and models stays text: brackets and backslashes are escaped, braces doubled, and web addresses broken with a zero-width space. --plan cannot write SARIF.
SARIF input
ocra runs no analyzer: run Semgrep, CodeQL or another tool and pass its SARIF 2.1.0 log with --import-sarif <file> (repeatable; 20 MB each at most). Each run in the log becomes a task sarif-<tool>-<n>, with the tool as reviewer and no cost; its findings name it in provenance.task.
- Only results on the change are kept: on a reviewed file, on lines inside a diff hunk. The rest, and results without a file and lines, outside the repository or without a message, are counted in a warning. At most 200 results per run.
- Severity from the result's level, else the rule's default:
erroriscritical,warningiswarning,noteandnonearesuggestion. Title: the rule's short description, name or id. Body: the message, the rule's description, and the tool, version, rule and help link. - The quote decides the lines. The result's snippet, or the file's lines, is anchored like a reviewer's quote; one that no longer matches makes the finding file-level.
- Then it is a finding like any other: memory and dismissals apply, Verify checks it, the judge merges it with reviewers' duplicates, and it counts toward the verdict.
Tested with Semgrep 1.178.0's log; other tools' logs follow the same standard.
Sessions
Every review (not --plan) writes .ocra/sessions/<id>/events.jsonl (one event per line, as the run progresses) and report.json. The run id <id> is in the first progress line, the JSON report (runId), the summary comment (Coverage and cost) and the SARIF log (automationDetails.id, ocra/<id>). Each task attempt's event records in attempt the files the reviewer read, its searches and its final text (bounded), so you can tell a file never opened from one read without findings; none of it goes into the report. The directory has its own .gitignore.
Each line of events.jsonl ends with a seal: an HMAC keyed by a secret of yours that ocra makes on first use in ~/.config/ocra/session-key ($XDG_CONFIG_HOME/ocra/, or %APPDATA%\ocra\ on Windows), readable only by you. --resume reads only lines with a valid seal, so it resumes a session only on the machine and account that wrote it; deleting the key makes earlier sessions impossible to resume, nothing else. If ocra cannot make or read the key, a review warns and its session cannot be resumed; a key file it cannot read (another user's, say, after sudo ocra) is left as it is.
ocra metrics
Counts over the finished reviews in .ocra/sessions/, from each session's report.json; no model is called:
ocra metrics # a text table
ocra metrics --format json # for a dashboard or a script; carries "version": 1
ocra metrics --since 2026-10-01 # runs started at or after a date
ocra metrics --sessions /srv/ocra # another sessions directory, as on a CI runnerIt reports runs (by verdict; incomplete ones, which left a file unfinished or a critical finding unverified, as their exit code 3 says; sessions without a readable report), cost (total, per run, tokens), findings (reported, unique by fingerprint, by severity and verification), the fate of earlier findings (fixed: the code is gone later; dismissed by a reviewer; their ratio as acceptance rate), and the same per reviewer with tasks, failed tasks and cost. A task that --resume reused costs nothing in the run that reused it: its cost counts once, in the run that paid for it. A fixed or dismissed finding counts for the reviewer the earlier review recorded, else the first to report its fingerprint. Only version 1 reports count; the JSON output is a versioned contract like the report.
ocra --version
Prints the version.
ocra memory
Some findings are correct but accepted: the risk is handled elsewhere, or the team decided to live with it. Remember them so ocra stops reporting them:
ocra review # every finding shows an id, such as #1a2b3c4d
ocra memory add 1a2b3c4d --reason "Retries are capped by the gateway."
ocra memory listocra memory add finds the id in the newest session under .ocra/sessions/ (--session <dir> picks another) and writes .ocra/memory.json; commit it to share. A remembered finding (same reviewer, file and quoted code) is left out and counted, and reviewers see accepted findings for their files. Pull requests read the file from the base commit, so they cannot silence their own findings. An invalid file stops the review with an error.
Memory in your ocra Cloud account
When you are signed in, you can also remember a finding from ocra Cloud's page for a review ("Remember", with a reason). Before each review (local, --pr or --mr), ocra reads your account's entries for the repository (GET /api/memory, by the repository's hash) and applies them with .ocra/memory.json: a finding either lists is left out; one both list counts as the repository's. The report names each hidden finding's source (repository or account); the terminal prints N finding(s) hidden by your ocra Cloud memory, and a pull request's summary comment gives the count.
- Never read when signed out or with
OCRA_CLOUD=off;--no-uploaddoes not stop it (reading sends nothing about the review). - If it cannot be read, a warning says so and only the repository's file applies.
- It applies only while the account shares findings, since it is keyed by the hash under the account's salt; otherwise a review says once that only the repository's memory applies.
ocra memory addwrites only.ocra/memory.json.
ocra login, ocra logout, ocra whoami
In development. ocra Cloud (ADR-0024) lives at https://app.ocracloud.com; OCRA_CLOUD_URL names another server. Reviews work without a login, and with OCRA_CLOUD=off these commands refuse to run.
ocra login # shows a code and opens the browser to confirm it
ocra whoami # the signed-in GitHub account, and whether this machine sends findings
ocra logout # ends the session on the server and deletes it hereocra login uses the OAuth device flow (RFC 8628): it prints a code such as BCDF-GHJK, opens the server's confirmation page (--no-browser only prints the link; a page off the server in use, or not https or local http, is only printed), and waits for you to approve it in a browser signed in with GitHub. Approve only a code you just asked for. The session can call models with the server's stored keys and upload results, but cannot read those keys or change the account; revoke it on the server's sessions page.
The session is saved in ~/.config/ocra/credentials.json ($XDG_CONFIG_HOME/ocra/, or %APPDATA%\ocra\ on Windows), readable only by you.
- It and the salts beside it are written atomically (temporary file, then rename). A file without a session counts as signed out: a review warns once, naming it, and runs without ocra Cloud;
ocra logoutremoves it. - The access token lasts an hour; the refresh token changes on every use. Concurrent processes share the session: one renews at a time under
credentials.json.lock, the others wait for it (up to two and a half minutes, printingWaiting for another ocra process to renew the ocra Cloud session...after five seconds; a lock older than 90 seconds, or whose process on this machine has exited, was left by a process that died and is broken) and take what it saved.ocra loginandocra logouttake the same lock, and a renewal never saves over a session saved meanwhile. A 401 on a live token renews and retries once. - A refused renewal ends the session: a review warns
your ocra Cloud session ended: run ocra login;ocra whoamiexits 1. - If ocra Cloud is unreachable (network error, 5xx, 429), the session is kept; a review warns once and runs without your account's rules, limits (
maxCostUsdincluded), models and memory, and uploads nothing; a review naming anocra-model stops with an error, andocra whoamiexits 2. A 404 for account settings means none, without a warning. - If
ocra logincannot read your login after getting tokens, it saves the session and says the login is unknown.
Models through ocra Cloud. While signed in, ocra-<provider>/<model> goes through ocra Cloud with the key stored there for <provider> (an OpenAI-compatible chat endpoint the server lists):
{ "runtime": "direct", "models": { "standard": "ocra-openrouter/qwen/qwen3.8-27b:free" } }- Unpriced: the reported cost and
--max-cost-usddo not count them, with a warning. - Prompts and quoted code pass through ocra Cloud, which records each call's model, status, token counts and duration, never the bodies.
- A review naming no
ocra-model reads no session and never contacts ocra Cloud; a provider your configuration declares under anocra-name keeps its declaration. - Effort is sent the way ocra Cloud lists for the provider (
openai:reasoning_effort;openrouter:reasoning.effort),openaiwhen unlisted; an unknown style is ignored with a warning. An answer that is not a provider list stops the review. - On
"runtime": "direct", ocra renews the token five minutes before expiry for the whole run. If it cannot, it warns once and tries again, after one minute and then less often (at most every five minutes), past expiry too, until the run ends.opencodereads it once at start, so ocra gives it a token outlivingrunTimeoutMinutesplus ten minutes, and warns when the run may outlast any token: calls through ocra Cloud then fail after about an hour. It renews the saved token for that only when a new one would last longer, not when the saved one is nearly as new.
Account settings. When signed in, ocra review applies your account's settings under the configuration (Account settings). The account can also turn on ultra, as if --ultra were given; --ultra on the command line always applies. What the account filled in is printed (From your ocra Cloud settings: …). --plan reads them too and ends with a Settings list giving each setting's source: shared (an extended configuration), file, env (OCRA_MODEL_*, OCRA_EFFORT_*), account (ultra included), sources joined with + for combined lists (include, exclude, rules; for example shared+account; the account's exclude applies only when the configuration sets none), or default. If ocra Cloud is unreachable, a warning says so and the plan shows the configuration alone.
What a review uploads. After each review, a signed-in CLI sends counts: verdict, whether every file was reviewed, findings per severity, files, tasks, tokens, cost, time, source (local, GitHub, GitLab) and ocra version; per reviewer, tasks, failed tasks, findings by severity, cost (without tasks reused by --resume, which this run did not pay for) and earlier findings fixed or dismissed; findings confirmed, uncertain or unchecked; and earlier findings fixed or dismissed in all (counted for the recorded reviewer; one recorded before reviewers were counts only if this review still has its fingerprint). Unless your account shares findings, no path, title, fingerprint, finding text or code is sent.
- The repository is a salted SHA-256 of its normalized address
https://host/owner/repo(user, credentials, port, trailing/and.gitdropped, case folded, sogit@host:owner/repo.gitandssh://git@host:22/owner/repomatch). With--pror--mrit is the platform's repository; locally, origin's (a path remote as written; no origin, the directory). The server can group a repository's reviews without learning which it is. On a self-managed GitLab served under a path (https://host/gitlab/…) or serving SSH from another host, an SSH clone's address is not the merge request's, so local reviews of that clone count as another repository than--mrreviews; an HTTPS clone matches. - A remote in SSH form, or with a port or trailing
/, got a new hash once after 0.5.0 (which hashed the URL as written): earlier reviews and memory match only once recorded again. - The salt is random, in
upload-saltnext to the credentials, so each machine hashes differently. If your account shares findings, the salt is the account's, read at login and before each review and kept inaccount-salt(readable only by you), so all your machines agree. When a review needs this machine's salt but cannot readupload-salt(another user's, say, aftersudo ocra), or cannot make it (the directory is read-only), it leaves the file as it is, warns, and sends nothing to ocra Cloud. When it cannot keep the account's salt inaccount-salt, it warns and uses the salt it was just sent. --no-uploadskips one upload,OCRA_CLOUD=offturns ocra Cloud off, and a failed upload is only a warning.
Sharing findings. With "Send findings and the code they quote to ocra Cloud" on in your account's Settings (off by default), the upload also carries each finding's fingerprint, reviewer, severity, category, verification, file, line range, title, body, suggestion and quoted code, so the web can show the full review.
- Before sending, ocra replaces secret-looking tokens in the path, category, title, body, suggestion and code with
[redacted]and marks the finding redacted: PEM and PGP private key blocks, AWS key ids (AKIA…,ASIA…), GitHub tokens (ghp_,gho_,ghs_,ghu_,ghr_,github_pat_), GitLab tokens (glpat-),sk-keys (sk-ant-,sk-or-,sk-proj-too), Slack tokens (xoxb-and the like), Google API keys (AIza…), npm tokens (npm_…), Slack and Discord webhook URLs, a URL's password (postgres://user:…@), the password ofcurl -u user:…or--user user:…, and ofmysql -p…, the credential afterBearerorBasic, on the same line or the next (a plain word after them, as in prose, stays; written lowercase, as in an HTTP/2 header, they count only before a credential of 16 or more characters with a digit), and a value assigned to a name such aspassword,passphrase,secret,secret_key,tokenorapi_key: quoted (password = "…", also with its quotes escaped inside a JSON string), unquoted asNAME=…(.env, a flag, a query string) or at the end of a line (password: …in YAML), the lines of a YAML block scalar (password: |), or the argument after a flag such as--password …or--api-key "…"(not a path). An unquoted value of letters only (changeme,string), or one that reads as code (a call, a dotted name such asprocess.env.TOKEN,${…}, a line ending in,or;), is left alone; afterNAME=or a flag, a trailing;,,(or)after a flag) ends a shell command instead, so the value before it is still replaced. Also hex runs of 32+ characters (after a prefix such asdop_v1_too), and random-looking base64 runs of 32+ characters containing a digit (paths are left alone). It catches patterns, not every secret; the server runs the same pass again. - At most 200 findings and 256 KB of text, each field cut at 4 KB before it is redacted (marked truncated; a token the cut falls in is redacted whole). The terminal prints
Sent this review's counts and N finding(s) to ocra Cloud. - Findings go only when the server returns the account's salt, which it does only while the switch is on, and this machine agreed:
ocra loginrecords that inshare-findingsbeside the credentials (readable only by you) when it finds the switch on, and says so; a review that finds the switch off removes it. After turning the switch on, or off and on again, runocra loginagain on each machine; until then its reviews warn and send counts only. So ocra Cloud cannot turn sharing on by itself. If ocra Cloud is unreachable before the review, the review warns, hashes with the salt inaccount-salt(or this machine's), sends no findings and skips the account's memory. --no-uploadandOCRA_CLOUD=offstill send nothing.
ocra plugins
Allows, on this machine, the plugins your ocra Cloud settings name (Plugins from your ocra Cloud account). Nothing here contacts ocra Cloud; allow and deny run npm.
ocra plugins allow <name>@<version> # an exact version: shows the package, then installs it
ocra plugins deny <name> # removes it: it no longer loads
ocra plugins list # the allowed plugins, with their integrityallow runs npm view <name>@<version> --json and prints the package's name, version, publisher, maintainers and integrity, then npm install --ignore-scripts --no-audit --no-fund --save-exact --prefix <dir> <name>@<version> into ~/.config/ocra/plugins/ ($XDG_CONFIG_HOME/ocra/plugins/, or %APPDATA%\ocra\plugins\ on Windows). It records it in plugins.json there only if npm installed exactly that version with the registry's integrity. npm runs with an argument list, never a shell, using your npm configuration's registry and credentials. A name that is not an npm package name, or a version that is a range or a tag, is refused before npm runs (exit code 2).