{"_self":{"principle":"Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.","widget":"article_bundle","feature":"bundle","name":"LLM article bundle","what":"Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution.","contains":"body, claims, sources, voxels, provenance, question graph, constitution, llm_manifest","slug":"oip-what-is-cli","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown"},"how_to_use":"Paste into any LLM. Read §SELF first. Write back via ingest or claim endpoints in llm_manifest.","write":null,"imessage":null,"router_tag":null,"proof_chain":[{"step":1,"claim":"Articles are voxel graphs of tiered claims, not prose blobs.","verify":"https://miscsubjects.com/api/articles/constitution"},{"step":2,"claim":"Claims link to hash-chained sources via source_ids.","verify":"https://miscsubjects.com/api/articles/oip-what-is-cli/sources"},{"step":3,"claim":"Ask reads topology; ingest/claim append to ledger.","verify":"https://miscsubjects.com/api/protocol"},{"step":4,"claim":"Models queue growth: populate → collaborate → repair → reflex.","verify":"https://miscsubjects.com/api/protocol/grow"},{"step":5,"claim":"Graph proves its own shape (reflex) and $/claim (yield).","verify":"https://miscsubjects.com/graph.html?layer=reflex"},{"step":6,"claim":"Full feature index + _explain on every API response.","verify":"https://miscsubjects.com/api/articles/system-map"}],"related_features":[{"id":"topology","name":"Article topology","what":"Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/topology"}},{"id":"voxels","name":"Voxel graph","what":"Claims as atoms, sources as edges (supported_by, posted_by). Per-claim provenance.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/voxels","write":"https://miscsubjects.com/api/protocol/claim"}},{"id":"ask","name":"Ask protocol","what":"Answer only from topology; creates question_node with gaps and ingest_hint.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/prompts","write":"https://miscsubjects.com/api/protocol/ask"}},{"id":"ingest","name":"Ingest protocol","what":"Parse pasted evidence → source ledger + claims + evidence_ingest node.","urls":{"write":"https://miscsubjects.com/api/protocol/ingest"}},{"id":"claim_post","name":"Claim post protocol","what":"Prompt-injection style POST — one claim voxel with who_claims + posted_by.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/voxels","write":"https://miscsubjects.com/api/protocol/claim"}},{"id":"llm_manifest","name":"LLM manifest","what":"Machine-readable read/write contract for external LLMs.","urls":{"read":"https://miscsubjects.com/api/articles/llm-manifest"}}],"system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown","not_medical_advice":true},"_explain":{"feature":"bundle","name":"LLM article bundle","what":"Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution.","why":"Every feature is auditable collective intelligence","how":"Paste into any LLM. Read §SELF first. Write back via ingest or claim endpoints in llm_manifest.","model":null,"verifies":null,"urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown"},"imessage":null,"router":null,"related":[{"id":"topology","what":"Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER."},{"id":"voxels","what":"Claims as atoms, sources as edges (supported_by, posted_by). Per-claim provenance."},{"id":"ask","what":"Answer only from topology; creates question_node with gaps and ingest_hint."},{"id":"ingest","what":"Parse pasted evidence → source ledger + claims + evidence_ingest node."},{"id":"claim_post","what":"Prompt-injection style POST — one claim voxel with who_claims + posted_by."},{"id":"llm_manifest","what":"Machine-readable read/write contract for external LLMs."}],"not_medical_advice":true},"bundle_version":1,"generated_at":"2026-07-04T22:32:35.220Z","slug":"oip-what-is-cli","title":"What Is the OIP CLI","url":"https://miscsubjects.com/a/oip-what-is-cli","register":"oip_protocol","tags":["oip","protocol"],"posted_at":"2026-07-04T18:31:27.314Z","updated_at":"2026-07-04T19:01:06.739Z","body":"# What Is the OIP CLI\n\n**The OIP CLI is a deterministic command-to-action interface that translates human intent into exact, auditable tool executions.** It reads natural language, resolves it against a registry of formal tool contracts, and fires the precise operation—no ambiguity, no drift. Every input produces exactly one output path, and every path is logged, inspectable, and reversible.\n\n**It is not a chatbot.** It is not a suggestion engine. It is a command plane.\n\n---\n\n## Why It Matters\n\nMost interfaces hide the machinery. Buttons obscure databases. Chat windows bury intent in prose. The result: actions that cannot be replayed, audited, or reasoned about.\n\nThe OIP CLI rejects this. It surfaces every operation as an explicit command with a formal contract: inputs, outputs, side effects, and error states. This matters because:\n\n- **Determinism**: The same command, under the same conditions, produces the same result. Every time.\n- **Auditability**: Every execution leaves a trace. You can replay it, inspect it, and prove it happened.\n- **Composability**: Commands chain. Output of one becomes input of the next. No glue code. No fragile parsers.\n- **Trust**: When a system runs on explicit contracts, you do not need to trust the implementation. You verify the contract.\n\nIn a world of opaque AI agents and black-box APIs, the OIP CLI is a glass box.\n\n---\n\n## How It Works\n\nThe CLI operates in four phases:\n\n### 1. Parse\nThe user enters a command. The CLI does not \"guess.\" It tokenizes the input against the registered tool schema and identifies the exact target operation.\n\nExample:\n```\n[USER]  fetch article oip-what-is-cli from /api/articles/oip-what-is-cli\n[PARSE]  → tool: ARTICLE_FETCH, args: {slug: \"oip-what-is-cli\"}\n```\nNo fuzzy matching. No \"did you mean.\" The command maps to one registered tool or it fails.\n\n### 2. Validate\nThe CLI checks every argument against the tool's contract: type, constraints, required vs. optional. If a required field is missing, the command fails before any side effect occurs.\n\nExample:\n```\n[VALIDATE]  slug: string, present → PASS\n[VALIDATE]  headers: object, x-terminal-key present → PASS\n[VALIDATE]  body: undefined, not required → SKIP\n```\n\n### 3. Execute\nThe CLI fires the resolved operation. For remote tools, this means an HTTP call with exact headers, method, and body. For local tools, it invokes the registered function. The execution is atomic: it either completes or aborts. No partial states.\n\nExample:\n```\n[EXECUTE]  GET /api/articles/oip-what-is-cli\n[EXECUTE]  → 200 OK, body: {title, slug, body, excerpt, tags}\n```\n\n### 4. Log\nEvery phase emits a structured event to the ledger. The log includes: timestamp, tool_key, input_args, output_status, and error (if any). This ledger is the audit trail. It is append-only. It is the proof.\n\n---\n\n## The Contract\n\nEvery tool in the OIP CLI is defined by a contract with these exact fields:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `tool_key` | string | Unique identifier. Immutable. |\n| `method` | string | HTTP method or local invocation pattern. |\n| `path` | string | Endpoint or function path. Parameterized with `{}`. |\n| `args` | array | Ordered list of argument names. Each must appear in the path or body. |\n| `body` | object | Schema for POST/PUT payloads. Keys must match `args`. |\n| `headers` | object | Required headers. Values are static or template strings. |\n| `auth` | string | Auth requirement: `none`, `terminal_key`, `api_key`. |\n| `side_effects` | boolean | Does this tool mutate state? |\n| `idempotent` | boolean | Can this tool be safely replayed? |\n| `preconditions` | array | Conditions that must be true before execution. |\n| `postconditions` | array | Conditions that must be true after execution. |\n| `error_map` | object | Mapping of HTTP status codes to recoverable vs. fatal. |\n\nA command is valid only if every `args` field is present in the input, every `preconditions` check passes, and every `headers` requirement is satisfied. Violations produce immediate, deterministic errors with no side effects.\n\n---\n\n## Real Examples\n\n### Example 1: Fetching an Article\n```\n[USER]   fetch article oip-what-is-cli from /api/articles/oip-what-is-cli\n[CLI]    → ARTICLE_FETCH\n[ARGS]   {slug: \"oip-what-is-cli\"}\n[CALL]   GET /api/articles/oip-what-is-cli\n[RESULT] 200 OK → {article object}\n```\nThis is a read operation. Idempotent. No side effects. Safe to replay.\n\n### Example 2: Creating a Ledger Entry\n```\n[USER]   create ledger entry for group grp_123 with type \"message\" and body \"hello\"\n[CLI]    → LEDGER_CREATE\n[ARGS]   {group_id: \"grp_123\", type: \"message\", body: \"hello\"}\n[CALL]   POST /api/ledger\n[BODY]   {group_id, type, body, timestamp}\n[RESULT] 201 Created → {entry_id: \"ent_456\"}\n```\nThis is a write operation. Not idempotent. The ledger appends. The entry_id is generated server-side.\n\n### Example 3: Updating a Directory Row\n```\n[USER]   update directory row ROUTER with content \"new prompt text\"\n[CLI]    → SET_ROW_CONTENT\n[ARGS]   {key: \"ROUTER\", content: \"new prompt text\"}\n[CALL]   PUT /api/directory/ROUTER\n[BODY]   {content}\n[RESULT] 200 OK → {updated: true, version: 2}\n```\nThis is a destructive update. The old content is overwritten. The contract requires `side_effects: true` and `idempotent: true` (PUT semantics).\n\n### Example 4: Running a Self-Test\n```\n[USER]   run self-test with 5 questions\n[CLI]    → SELFTEST_RUN\n[ARGS]   {count: 5}\n[CALL]   POST /api/selftest\n[BODY]   {count: 5}\n[RESULT] 200 OK → {run_id: \"st_789\", score: 4, passed: 4, failed: 1}\n```\nThis triggers a paced workflow. The CLI initiates; the server orchestrates. The result is a score, not an immediate state change.\n\n### Example 5: Dispatching a Local Command\n```\n[USER]   dispatch local command \"git log --oneline -5\"\n[CLI]    → LOCAL_EXEC\n[ARGS]   {cmd: \"git\", args: [\"log\", \"--oneline\", \"-5\"]}\n[CALL]   LOCAL_EXEC via bridge\n[RESULT] {stdout: \"abc1234 fix: ...\", stderr: \"\", exit_code: 0}\n```\nLocal execution crosses the boundary into the host machine. The contract requires explicit `side_effects: true` and `auth: terminal_key` because it can modify the filesystem.\n\n---\n\n## Common Mistakes\n\n**Mistake 1: Treating it like a conversation.**\nThe CLI is not a chatbot. \"Can you help me fetch...\" is not a command. It will fail. Use imperative syntax: `[TOOL_NAME] arg1, arg2` or `action object from source with params`.\n\n**Mistake 2: Omitting required headers.**\n`x-terminal-key` is not optional for most endpoints. If you omit it, the command fails before execution. No grace period. No fallback.\n\n**Mistake 3: Assuming fuzzy matching.**\n\"Get me the article about CLI\" does not resolve. The CLI requires exact slugs, exact keys, exact paths. Precision is the feature, not the bug.\n\n**Mistake 4: Ignoring side effects.**\nCalling a write operation twice executes it twice. The CLI does not deduplicate. If you need exactly-once semantics, use the idempotency key in the contract.\n\n**Mistake 5: Mixing tool tags with prose.**\nWriting `[ARTICLE_FETCH]` in a sentence does not execute it. The CLI parses tags in a specific format. Unescaped tags in prose are ignored. Use the exact syntax or the command fails.\n\n---\n\n## Connection to OIP\n\nThe Open Information Protocol is built on three principles: **openness**, **determinism**, and **auditability**. The CLI is the practical expression of all three.\n\n- **Open**: Every tool contract is public. Every endpoint is documented. There are no hidden capabilities, no shadow APIs. The registry is the truth.\n- **Deterministic**: The same input always maps to the same operation. No model drift. No context pollution. The CLI does not \"interpret.\" It resolves.\n- **Auditable**: Every execution is logged. Every log is inspectable. The ledger proves the system state at any moment. You can replay, verify, and dispute.\n\nThe CLI is not an accessory to OIP. It is the entry point. Without it, the protocol is a specification. With it, the protocol is alive, executable, and accountable. Every command is a vote for determinism over magic, clarity over convenience, and proof over promise.\n\n## Connection to the Grain Philosophy\n\nThis protocol is part of the [Open Inventory Protocol](/a/philosophy) — a living system of self-describing voxels that serves the Grain philosophy. The OIP is the interface. The philosophy is the core.\n","claims":[],"sources":[],"voxels":{"slug":"oip-what-is-cli","counts":{"voxels":0,"sources":0,"edges":0},"note":"slim bundle — full voxels at /api/articles/oip-what-is-cli/voxels"},"constitution":{"url":"https://miscsubjects.com/api/articles/constitution"},"provenance":[],"contributions":[],"topology":null,"slim":true,"ledger_totals":{"claims":0,"sources":0,"exported_claims":0,"exported_sources":0},"question_graph":{"slug":"oip-what-is-cli","questions":[],"evidence":[],"edges":[],"counts":{"questions":0,"evidence":0,"edges":0}},"verification":{"provenance":{"valid":true,"entries":0,"head":"genesis"},"sources":{"valid":true,"entries":0,"head":"genesis"}},"counts":{"claims":0,"sources":0,"provenance":0,"contributions":0,"questions":0,"evidence_ingests":0,"voxel_edges":0},"llm_manifest":{"version":"1","site":"https://miscsubjects.com","purpose":"Peptide evidence articles with hash-chained source ledgers, tiered claims, and a question graph. LLMs should READ bundles/URLs and WRITE back via ingest — never invent doses.","read":{"human_page":"https://miscsubjects.com/a/oip-what-is-cli","bundle_json":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle","bundle_markdown":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown","topology":"https://miscsubjects.com/api/articles/oip-what-is-cli/topology","question_graph":"https://miscsubjects.com/api/articles/oip-what-is-cli/question-graph","sources":"https://miscsubjects.com/api/articles/oip-what-is-cli/sources","provenance":"https://miscsubjects.com/api/articles/oip-what-is-cli/provenance","contributions":"https://miscsubjects.com/api/articles/oip-what-is-cli/contributions","graph_topology":"https://miscsubjects.com/api/articles/oip-what-is-cli/graph-topology?question={question}","voxels":"https://miscsubjects.com/api/articles/oip-what-is-cli/voxels","constitution":"https://miscsubjects.com/api/articles/constitution","ontology":"https://miscsubjects.com/api/articles/ontology","system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown","health":"https://miscsubjects.com/api/articles/oip-what-is-cli/health","repair":"POST https://miscsubjects.com/api/protocol/repair","list_articles":"https://miscsubjects.com/api/articles","graph_canvas":"https://miscsubjects.com/graph.html?slugs=oip-what-is-cli","graph_yield":"https://miscsubjects.com/api/graph?slugs=oip-what-is-cli&layer=yield","obsidian_vault":"https://miscsubjects.com/api/articles/obsidian-vault?slugs=oip-what-is-cli","graph_query":"https://miscsubjects.com/api/v1/query?from=oip-what-is-cli&kind=claim&where=tier=human"},"ask":{"description":"Answer only from topology; creates a question_node with gaps.","api":"POST https://miscsubjects.com/api/protocol/ask","body":{"slug":"{slug}","question":"string"},"imessage":"oip-what-is-cli|your question","router_tag":"[ARTICLE_ASK]oip-what-is-cli|question[/ARTICLE_ASK]","auth":"x-terminal-key header for API; iMessage/WhatsApp via miscsubjects build"},"ingest":{"description":"Parse pasted evidence → source ledger + claims + evidence_ingest node.","api":"POST https://miscsubjects.com/api/protocol/ingest","body":{"slug":"{slug}","evidence":"paste text","question_node_id":"optional qn_..."},"imessage":"ingest oip-what-is-cli|q:{node_id}|paste evidence","router_tag":"[ARTICLE_INGEST]oip-what-is-cli|evidence[/ARTICLE_INGEST]","tiers":["human","preclinical","anecdotal","mechanistic","speculative"]},"claim":{"description":"Prompt-injection style POST — one claim voxel with who_claims + posted_by provenance.","api":"POST https://miscsubjects.com/api/protocol/claim","body":{"slug":"{slug}","text":"one assertion","tier":"human|preclinical|anecdotal|mechanistic|speculative","who_claims":"study author, platform, or model id","source_ids":"optional [s1]"},"imessage":"claim oip-what-is-cli|tier|assertion — who claims it?","router_tag":"[ARTICLE_CLAIM]oip-what-is-cli|tier|assertion[/ARTICLE_CLAIM]","slots":["what_it_is","who_claims_what","what_is_known","what_is_unknown","mechanism","limitations","disclaimer"]},"tiers":{"human":0.8,"preclinical":0.5,"anecdotal":0.3,"mechanistic":0.3,"speculative":0.1},"invariants":["Self-explaining — every API JSON has _self; every paste widget has §SELF; root index at /api/articles/system-map","Append-only — revisions preserved at ?rev=n","Source chain verifies integrity, not truth","Answers must cite claim ids and source ids from topology","Not medical advice"],"constitution":{"version":1,"principle":"Articles are voxel graphs of claims — not prose blobs. Every assertion is a claim atom with tier, weight, source_ids, and posted_by provenance.","slots":[{"id":"what_it_is","required":true,"answers":"What is this peptide/stack/condition?"},{"id":"who_claims_what","required":true,"answers":"Who claims what — study authors, platforms, n=?"},{"id":"what_is_known","required":true,"answers":"What is known with tier labels (human/preclinical/anecdotal)"},{"id":"what_is_unknown","required":true,"answers":"What is NOT known — explicit gaps"},{"id":"mechanism","required":false,"answers":"Proposed mechanism (mechanistic tier only)"},{"id":"limitations","required":true,"answers":"Limits of evidence — no dose advice"},{"id":"disclaimer","required":true,"answers":"Not medical advice"}],"claim_rules":["One claim = one falsifiable assertion. No compound claims.","Every claim must declare tier: human|preclinical|anecdotal|mechanistic|speculative|system.","system tier = architecture/design axioms (not biological mechanism). Use for protocol self-definition.","Sourced claims must cite source_ids from the hash-chained ledger.","Unsourced claims must set source_status: unsourced and why_material.","posted_by is mandatory on every new claim (model id, human, or channel).","No medical advice, no doses, no 'you should take'.","Bad information is retracted (status:retracted), never deleted — retraction event stays on ledger.","Adversary challenges link via challenges[] / challenged_by[] — target may be downweighted.","Leaked secrets are scrubbed to [REDACTED:secret-leak] with scrub_events tombstone — honest audit trail."],"source_rules":["Every source is a voxel edge: type, url, exact quote, summary, found_by, accessed_at.","Sources hash-chain — prev/hash on append.","Anecdotal sources must name platform (reddit|x|youtube|imessage|user_entry)."],"ontology_rules":["Peptide articles (bpc-157, tb-500) are tree roots.","Condition articles (bpc-157-glp1-gut-damage) branch from peptides.","Stack articles (wolverine-stack-glp1) compose peptides — never duplicate peptide mechanism prose.","If an article has no parent embeds and is not a root peptide → sprawl candidate.","Misstep = duplicate scope with another slug; merge or reparent via embeds."],"post_protocol":{"claim":"POST /api/protocol/claim","source":"POST /api/protocol/sources","ingest":"POST /api/protocol/ingest","webhook":"POST /api/articles/<slug>/webhook {kind:claim|source}","imessage_claim":"claim {slug}|{tier}|your assertion — who claims it, source?","imessage_ingest":"ingest {slug}|evidence paste"}},"this_article":{"slug":"oip-what-is-cli","url":"https://miscsubjects.com/a/oip-what-is-cli","bundle_url":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown"}},"api_urls":{"bundle":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle","bundle_markdown":"https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown","topology":"https://miscsubjects.com/api/articles/oip-what-is-cli/topology","voxels":"https://miscsubjects.com/api/articles/oip-what-is-cli/voxels","constitution":"https://miscsubjects.com/api/articles/constitution","ontology":"https://miscsubjects.com/api/articles/ontology","question_graph":"https://miscsubjects.com/api/articles/oip-what-is-cli/question-graph","ask":"https://miscsubjects.com/api/protocol/ask","ingest":"https://miscsubjects.com/api/protocol/ingest","claim":"https://miscsubjects.com/api/protocol/claim","system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown"}}