## §SELF — miscsubjects (paste without context)

**Principle:** Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.

**This widget:** `article_bundle` — **LLM article bundle**
Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution.
- **article slug:** `oip-what-is-cli`
- **contains:** body, claims, sources, voxels, provenance, question graph, constitution, llm_manifest
- **how to use:** Paste entire block into Grok/GPT/Gemini. Section §SELF explains the system.
- **read:** https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown

### Logical proof (verify each step)
1. Articles are voxel graphs of tiered claims, not prose blobs. → https://miscsubjects.com/api/articles/constitution
2. Claims link to hash-chained sources via source_ids. → https://miscsubjects.com/api/articles/oip-what-is-cli/sources
3. Ask reads topology; ingest/claim append to ledger. → https://miscsubjects.com/api/protocol
4. Models queue growth: populate → collaborate → repair → reflex. → https://miscsubjects.com/api/protocol/grow
5. Graph proves its own shape (reflex) and $/claim (yield). → https://miscsubjects.com/graph.html?layer=reflex
6. Full feature index + _explain on every API response. → https://miscsubjects.com/api/articles/system-map

### Related features (explains other parts of the system)
- **topology** — Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER. · https://miscsubjects.com/api/articles/oip-what-is-cli/topology
- **voxels** — Claims as atoms, sources as edges (supported_by, posted_by). Per-claim provenance. · https://miscsubjects.com/api/articles/oip-what-is-cli/voxels
- **ask** — Answer only from topology; creates question_node with gaps and ingest_hint. · https://miscsubjects.com/api/articles/oip-what-is-cli/prompts
- **ingest** — Parse pasted evidence → source ledger + claims + evidence_ingest node.
- **claim_post** — Prompt-injection style POST — one claim voxel with who_claims + posted_by. · https://miscsubjects.com/api/articles/oip-what-is-cli/voxels
- **llm_manifest** — Machine-readable read/write contract for external LLMs. · https://miscsubjects.com/api/articles/llm-manifest

### Full index
- JSON: https://miscsubjects.com/api/articles/system-map
- Markdown: https://miscsubjects.com/api/articles/system-map?format=markdown

*Not medical advice. Tier-honest. Cite claim/source ids.*

---

# miscsubjects article bundle

> Paste this entire block into Grok, GPT, or Gemini. They can READ the ledger below and RETURN evidence via ingest (see § LLM manifest).

## Article
- **slug:** `oip-what-is-cli`
- **title:** What Is the OIP CLI
- **url:** https://miscsubjects.com/a/oip-what-is-cli
- **register:** oip_protocol
- **updated:** 2026-07-04T19:01:06.739Z
- **tags:** oip, protocol

## Body

# What Is the OIP CLI

**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.

**It is not a chatbot.** It is not a suggestion engine. It is a command plane.

---

## Why It Matters

Most interfaces hide the machinery. Buttons obscure databases. Chat windows bury intent in prose. The result: actions that cannot be replayed, audited, or reasoned about.

The 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:

- **Determinism**: The same command, under the same conditions, produces the same result. Every time.
- **Auditability**: Every execution leaves a trace. You can replay it, inspect it, and prove it happened.
- **Composability**: Commands chain. Output of one becomes input of the next. No glue code. No fragile parsers.
- **Trust**: When a system runs on explicit contracts, you do not need to trust the implementation. You verify the contract.

In a world of opaque AI agents and black-box APIs, the OIP CLI is a glass box.

---

## How It Works

The CLI operates in four phases:

### 1. Parse
The user enters a command. The CLI does not "guess." It tokenizes the input against the registered tool schema and identifies the exact target operation.

Example:
```
[USER]  fetch article oip-what-is-cli from /api/articles/oip-what-is-cli
[PARSE]  → tool: ARTICLE_FETCH, args: {slug: "oip-what-is-cli"}
```
No fuzzy matching. No "did you mean." The command maps to one registered tool or it fails.

### 2. Validate
The 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.

Example:
```
[VALIDATE]  slug: string, present → PASS
[VALIDATE]  headers: object, x-terminal-key present → PASS
[VALIDATE]  body: undefined, not required → SKIP
```

### 3. Execute
The 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.

Example:
```
[EXECUTE]  GET /api/articles/oip-what-is-cli
[EXECUTE]  → 200 OK, body: {title, slug, body, excerpt, tags}
```

### 4. Log
Every 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.

---

## The Contract

Every tool in the OIP CLI is defined by a contract with these exact fields:

| Field | Type | Description |
|-------|------|-------------|
| `tool_key` | string | Unique identifier. Immutable. |
| `method` | string | HTTP method or local invocation pattern. |
| `path` | string | Endpoint or function path. Parameterized with `{}`. |
| `args` | array | Ordered list of argument names. Each must appear in the path or body. |
| `body` | object | Schema for POST/PUT payloads. Keys must match `args`. |
| `headers` | object | Required headers. Values are static or template strings. |
| `auth` | string | Auth requirement: `none`, `terminal_key`, `api_key`. |
| `side_effects` | boolean | Does this tool mutate state? |
| `idempotent` | boolean | Can this tool be safely replayed? |
| `preconditions` | array | Conditions that must be true before execution. |
| `postconditions` | array | Conditions that must be true after execution. |
| `error_map` | object | Mapping of HTTP status codes to recoverable vs. fatal. |

A 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.

---

## Real Examples

### Example 1: Fetching an Article
```
[USER]   fetch article oip-what-is-cli from /api/articles/oip-what-is-cli
[CLI]    → ARTICLE_FETCH
[ARGS]   {slug: "oip-what-is-cli"}
[CALL]   GET /api/articles/oip-what-is-cli
[RESULT] 200 OK → {article object}
```
This is a read operation. Idempotent. No side effects. Safe to replay.

### Example 2: Creating a Ledger Entry
```
[USER]   create ledger entry for group grp_123 with type "message" and body "hello"
[CLI]    → LEDGER_CREATE
[ARGS]   {group_id: "grp_123", type: "message", body: "hello"}
[CALL]   POST /api/ledger
[BODY]   {group_id, type, body, timestamp}
[RESULT] 201 Created → {entry_id: "ent_456"}
```
This is a write operation. Not idempotent. The ledger appends. The entry_id is generated server-side.

### Example 3: Updating a Directory Row
```
[USER]   update directory row ROUTER with content "new prompt text"
[CLI]    → SET_ROW_CONTENT
[ARGS]   {key: "ROUTER", content: "new prompt text"}
[CALL]   PUT /api/directory/ROUTER
[BODY]   {content}
[RESULT] 200 OK → {updated: true, version: 2}
```
This is a destructive update. The old content is overwritten. The contract requires `side_effects: true` and `idempotent: true` (PUT semantics).

### Example 4: Running a Self-Test
```
[USER]   run self-test with 5 questions
[CLI]    → SELFTEST_RUN
[ARGS]   {count: 5}
[CALL]   POST /api/selftest
[BODY]   {count: 5}
[RESULT] 200 OK → {run_id: "st_789", score: 4, passed: 4, failed: 1}
```
This triggers a paced workflow. The CLI initiates; the server orchestrates. The result is a score, not an immediate state change.

### Example 5: Dispatching a Local Command
```
[USER]   dispatch local command "git log --oneline -5"
[CLI]    → LOCAL_EXEC
[ARGS]   {cmd: "git", args: ["log", "--oneline", "-5"]}
[CALL]   LOCAL_EXEC via bridge
[RESULT] {stdout: "abc1234 fix: ...", stderr: "", exit_code: 0}
```
Local 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.

---

## Common Mistakes

**Mistake 1: Treating it like a conversation.**
The 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`.

**Mistake 2: Omitting required headers.**
`x-terminal-key` is not optional for most endpoints. If you omit it, the command fails before execution. No grace period. No fallback.

**Mistake 3: Assuming fuzzy matching.**
"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.

**Mistake 4: Ignoring side effects.**
Calling 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.

**Mistake 5: Mixing tool tags with prose.**
Writing `[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.

---

## Connection to OIP

The Open Information Protocol is built on three principles: **openness**, **determinism**, and **auditability**. The CLI is the practical expression of all three.

- **Open**: Every tool contract is public. Every endpoint is documented. There are no hidden capabilities, no shadow APIs. The registry is the truth.
- **Deterministic**: The same input always maps to the same operation. No model drift. No context pollution. The CLI does not "interpret." It resolves.
- **Auditable**: Every execution is logged. Every log is inspectable. The ledger proves the system state at any moment. You can replay, verify, and dispute.

The 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.

## Connection to the Grain Philosophy

This 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.


## Claims (0)


## Voxel graph (0 atoms · 0 edges)
- full graph: https://miscsubjects.com/api/articles/oip-what-is-cli/voxels

## Article constitution

- full: https://miscsubjects.com/api/articles/constitution

## Source ledger (0)
- chain valid: yes · head: `genesis`

## Provenance (0 model passes)
- chain valid: yes · head: `genesis`


## Question graph
- questions: 0 · evidence ingests: 0

## LLM manifest — how to communicate with this ledger

- system map: https://miscsubjects.com/api/articles/system-map?format=markdown
- topology (ranked): https://miscsubjects.com/api/articles/oip-what-is-cli/topology
- ingest: POST https://miscsubjects.com/api/protocol/ingest
- claim: POST https://miscsubjects.com/api/protocol/claim

### Quick actions for this article
- **Read live:** https://miscsubjects.com/api/articles/oip-what-is-cli/topology
- **Ask (API):** POST https://miscsubjects.com/api/protocol/ask `{"slug":"oip-what-is-cli","question":"..."}`
- **Ingest your findings:** POST https://miscsubjects.com/api/protocol/ingest or text `ingest oip-what-is-cli|your evidence`
- **Post one claim:** POST https://miscsubjects.com/api/protocol/claim or text `claim oip-what-is-cli|tier|assertion`
- **iMessage ask:** `oip-what-is-cli|your question`
- **System map:** https://miscsubjects.com/api/articles/system-map?format=markdown


---

## §SELF — miscsubjects (paste without context)

**Principle:** Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.

**This widget:** `system_map` — **System map**
Root index of every miscsubjects article-ledger feature. Start here if you have zero context.
- **article slug:** `oip-what-is-cli`
- **contains:** body, claims, sources, voxels, provenance, question graph, constitution, llm_manifest
- **how to use:** Root index of every miscsubjects article-ledger feature. Start here if you have zero context.
- **read:** https://miscsubjects.com/api/articles/system-map

### Logical proof (verify each step)
1. Articles are voxel graphs of tiered claims, not prose blobs. → https://miscsubjects.com/api/articles/constitution
2. Claims link to hash-chained sources via source_ids. → https://miscsubjects.com/api/articles/oip-what-is-cli/sources
3. Ask reads topology; ingest/claim append to ledger. → https://miscsubjects.com/api/protocol
4. Models queue growth: populate → collaborate → repair → reflex. → https://miscsubjects.com/api/protocol/grow
5. Graph proves its own shape (reflex) and $/claim (yield). → https://miscsubjects.com/graph.html?layer=reflex
6. Full feature index + _explain on every API response. → https://miscsubjects.com/api/articles/system-map

### Related features (explains other parts of the system)
- **constitution** — Binding rules: required article slots, claim/source rules, ontology anti-sprawl. · https://miscsubjects.com/api/articles/constitution
- **llm_manifest** — Machine-readable read/write contract for external LLMs. · https://miscsubjects.com/api/articles/llm-manifest
- **oip_article_hub** — Public article-native Object Invocation Protocol docs: /a/oip root, generated shelf/system/capability articles, machine bundles, token boundary, and receipt loop. · https://miscsubjects.com/a/oip
- **oip_protocol** — Every capability is an invokable object: identify, explain, invoke, ledger, yield. · https://miscsubjects.com/a/oip
- **bundle** — Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution. · https://miscsubjects.com/api/articles/oip-what-is-cli/bundle?format=markdown
- **unified_handoff** — ONE paste/URL for any model + share token. Same self-explaining pattern as article bundle, but whole build. · https://miscsubjects.com/api/handoff?format=markdown

### Full index
- JSON: https://miscsubjects.com/api/articles/system-map
- Markdown: https://miscsubjects.com/api/articles/system-map?format=markdown

*Not medical advice. Tier-honest. Cite claim/source ids.*