> ## Documentation Index
> Fetch the complete documentation index at: https://opm.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# opm push

> Sign, scan, publish, register on-chain, write ENS records.

# opm push

The full publish pipeline: sign your package, scan with 3 AI agents, publish to npm, register on-chain, upload audit report, and write ENS text records.

## Usage

<CodeGroup>
  ```bash Basic theme={null}
  opm push
  ```

  ```bash With npm token theme={null}
  opm push --token <npm-token>
  ```

  ```bash With 2FA code theme={null}
  opm push --otp <code>
  ```
</CodeGroup>

## What Happens

<Steps>
  <Step title="Pack & sign">
    Creates tarball via `npm pack`, computes SHA-256 checksum, signs with ECDSA using `OPM_SIGNING_KEY`.
  </Step>

  <Step title="Resolve ENS">
    Resolves your wallet to an ENS name (Sepolia → Mainnet fallback).
  </Step>

  <Step title="AI scan">
    3 agents (Claude, Gemini, DeepSeek) analyze in parallel. Each submits a risk score on-chain.
  </Step>

  <Step title="Risk gate">
    Aggregate score ≥ 80 or CRITICAL → **publish blocked**.
  </Step>

  <Step title="Publish to npm">
    Publishes tarball to the npm registry.
  </Step>

  <Step title="Register on-chain">
    Calls `OPMRegistry.registerPackage()` with checksum, signature, ENS name.
  </Step>

  <Step title="Upload report">
    Formatted markdown report uploaded to Fileverse (IPFS-backed, encrypted).
  </Step>

  <Step title="Write ENS records">
    Sets `opm.version`, `opm.checksum`, `opm.fileverse`, `opm.risk_score`, and more on your ENS name. Creates package subname (e.g. `express.djpai.eth`) if you own the parent. Sets contenthash to Fileverse IPFS CID.
  </Step>
</Steps>

## Required Environment Variables

| Variable | Purpose |
| - | - |
| `OPM_SIGNING_KEY` | Ethereum private key for ECDSA signing |
| `OPENROUTER_API_KEY` or `OPENAI_API_KEY` | AI agent scanning |
| `AGENT_PRIVATE_KEY` | Agent wallet for on-chain score submission (needs Base Sepolia ETH) |

## Optional

| Variable | Purpose |
| - | - |
| `NPM_TOKEN` | npm automation token (alternative to `--token` flag) |
| `FILEVERSE_API_KEY` | Audit report uploads |

<Warning>
  Packages with **risk score ≥ 80** are blocked. The scan fails, npm publish is skipped, and no on-chain registration occurs.
</Warning>

## Output

Every transaction shows a clickable BaseScan link: score submissions, package registration, ENS record writes. Plus the Fileverse report URI and npm package URL.

<Note>
  See [ENS Text Records](/concepts/ens-records) for the full list of records written during push.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.