Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0day-network/zerocode-cli
ZeroCode CLI for building and publishing modular Web3 components
A comprehensive Node.js/TypeScript CLI for bundling React components and publishing them to the URT protocol.
For development with the local CLI from source:
# From the zerocode-cli directory
cd packages/zerocode-cli
npm install
npm run build
npm link
# Now you can use 'zc' globally
zc --help
To unlink later:
npm unlink -g zerocode-cli
npm install -g zerocode-cli
zc --help
Make sure you have the following services running locally:
http://localhost:4000Clone and setup the CLI (development mode)
# From the monorepo root
cd packages/zerocode-cli
npm install
npm run build
# Link for global access (optional)
npm link
Initialize a new project
# Create a new directory for your components
mkdir my-zerocode-project
cd my-zerocode-project
# Option 1: Using global CLI (if npm linked)
zc init --dev --git --ui
# Option 2: Direct CLI execution (from source)
npx tsx ../../packages/zerocode-cli/bin/cli.ts init --dev --git --ui
# Option 3: Basic init without flags
zc init
Available flags:
--dev: Generate package.json with local CLI references for monorepo development--git: Initialize git repository and create initial commit--ui: Generate additional UI components (input, textarea, select, etc.)--force: Overwrite existing configuration filesConfigure environment variables
# Edit the generated .env file
nano .env
Set the required variables:
# Generate a new wallet or use existing one
PRIVATE_KEY=0x1234567890abcdef...
# Deploy a URT contract (see step 4) and set its address
URT_ADDRESS=0xYourURTContractAddress
# Local services
P2P_URL=http://localhost:8787
CHAIN_ID=31337 # For local Anvil
RPC_URL=http://localhost:8545
# Registry address from core deployment
REGISTRY_ADDRESS=0xRegistryContractAddress
# Model IDs are pre-configured with defaults
Deploy URT contract (if needed)
# From the core directory
cd ../../core
npm install
npm run build
# Start local blockchain (if not already running)
npx hardhat node
# or
anvil
# Deploy contracts (in another terminal)
npx hardhat run scripts/00_deploy_local.ts --network localhost
# Copy the URT address from deployment output to your .env
Start p2p-0storage (if not already running)
# From the p2p-0storage directory
cd ../../p2p-0storage
npm install
npm start
# Should be running on http://localhost:8787
Configure the CLI project
# Back to your project directory
cd my-zerocode-project
# Update zerocode.yaml with your addresses
nano zerocode.yaml
Update the publisher and registry addresses:
publisher: "0xYourSignerAddress" # Address derived from PRIVATE_KEY
registry: "0xYourRegistryAddress" # From core deployment
Check system health
npx tsx ../../packages/zerocode-cli/bin/cli.ts health
This command will verify:
Build components
# Build all components
npx tsx ../../packages/zerocode-cli/bin/cli.ts build --all
# Or build specific component
npx tsx ../../packages/zerocode-cli/bin/cli.ts build --component Hero
Validate manifests
npx tsx ../../packages/zerocode-cli/bin/cli.ts validate --all
Development workflow
# Start development mode (auto-rebuild on changes)
npx tsx ../../packages/zerocode-cli/bin/cli.ts dev
# In another terminal, test commit (offchain)
npx tsx ../../packages/zerocode-cli/bin/cli.ts commit --all
# Test publish (onchain) - requires funded wallet
npx tsx ../../packages/zerocode-cli/bin/cli.ts publish --all
zc dev to automatically rebuild on file changeszc whoami to verify configurationzc health to diagnose issuesCLI not found: Use full path npx tsx ../../packages/zerocode-cli/bin/cli.ts instead of zc
URT authentication failed: Verify URT_ADDRESS and PRIVATE_KEY match deployed contract
P2P-0storage unreachable: Make sure p2p-0storage is running on port 8787
Transaction failed: Ensure your wallet has sufficient ETH for gas
Build errors: Check that your React components follow the expected structure
For production use, install the CLI from npm:
npm install -g zerocode-cli
zc init
# Follow the same steps as development mode
zc initInitialize a new zerocode project with example components and configuration.
Options:
-f, --force: Overwrite existing configurationzc buildBundle components into single-file ESM modules and generate manifests.
Options:
-c, --component <name>: Build specific component-a, --all: Build all componentszc validateValidate component manifests against JSON schemas.
Options:
-c, --component <name>: Validate specific component-a, --all: Validate all componentszc commitCommit components to offchain storage (p2p-0storage).
Options:
-c, --component <name>: Commit specific component-a, --all: Commit all componentszc publishPublish components onchain to URT protocol contracts.
Options:
-c, --component <name>: Publish specific component-a, --all: Publish all componentszc devStart development mode with file watching and automatic rebuilds.
Options:
-c, --component <name>: Watch specific component (default: all)zc whoamiDisplay current wallet address, URT configuration, and authentication status.
zc loginConfigure wallet for onchain operations.
Options:
--new: Generate a new wallet--key <privateKey>: Use existing private keyzc healthCheck system health and configuration status. Verifies:
The CLI is configured via zerocode.yaml:
name: "zerocode-modules"
publisher: "0xYourAddress"
chainId: 8453 # Base mainnet
rpcUrl: "https://mainnet.base.org"
registry: "0xRegistryAddress"
storage:
driver: "p2p-0storage"
baseUrl: "http://localhost:8787"
build:
outdir: "./dist"
format: "esm"
target: "es2022"
minify: true
external:
- react
- react-dom
resolveAliases:
"@/components": "./src/components"
"@/lib": "./src/lib"
components:
- name: "Hero"
entry: "./src/components/Hero/index.tsx"
version: "0.1.0"
description: "Hero section component"
# ... component configuration
Create a .env file with:
# ===== AUTHENTICATION =====
# Private key for your URT (Universal Responsibility Token)
PRIVATE_KEY=your_private_key_here
# Your URT contract address (each module is published from its own URT)
URT_ADDRESS=0xYourURTContract
# ===== P2P STORAGE =====
# P2P-0storage API endpoint for offchain storage
P2P_URL=http://localhost:8787
# Optional: IPFS API if p2p-0storage uses IPFS backend
IPFS_API_URL=http://127.0.0.1:5001
# ===== BLOCKCHAIN =====
# Chain ID (8453 = Base mainnet, 84532 = Base Sepolia)
CHAIN_ID=8453
# RPC endpoint for blockchain interactions
RPC_URL=https://mainnet.base.org
# URT Registry contract address (from core protocol deployment)
REGISTRY_ADDRESS=0xRegistryContract
The CLI uses URT-based authentication for all operations:
isValidSignature) for authenticationcallContract functionMake sure your PRIVATE_KEY corresponds to the admin of the URT_ADDRESS contract.
After initialization:
your-project/
├── zerocode.yaml # CLI configuration
├── .env # Environment variables
├── src/
│ └── components/
│ ├── Hero/
│ │ ├── index.tsx
│ │ └── props.schema.ts
│ └── Button/
│ └── index.tsx
└── dist/ # Build output
├── Hero/
│ ├── index.js
│ ├── build.manifest.json
│ ├── publish.manifest.json
│ ├── commit.result.json
│ └── publish.result.json
└── Button/
└── ...
npm run build
npm run dev
The CLI integrates with:
callContractisValidSignature (EIP-1271)callContract functionMIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@0day-network/mod-rendererEnvironment{
"local_name": "@0day-network/mod-renderer",
"alias": false,
"peer_metadata": null
} | 0.1.0 | runtime |
@0day-network/lit-gatekeeperEnvironment{
"local_name": "@0day-network/lit-gatekeeper",
"alias": false,
"peer_metadata": null
} | 0.1.1 | runtime |
@commander-js/extra-typingsEnvironment{
"local_name": "@commander-js/extra-typings",
"alias": false,
"peer_metadata": null
} | ^12.1.0 | runtime |
@lens-chain/storage-clientEnvironment{
"local_name": "@lens-chain/storage-client",
"alias": false,
"peer_metadata": null
} | ^1.0.6 | runtime |
ajvEnvironment{
"local_name": "ajv",
"alias": false,
"peer_metadata": null
} | ^8.12.0 | runtime |
ajv-formatsEnvironment{
"local_name": "ajv-formats",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | runtime |
chalkEnvironment{
"local_name": "chalk",
"alias": false,
"peer_metadata": null
} | ^5.3.0 | runtime |
chokidarEnvironment{
"local_name": "chokidar",
"alias": false,
"peer_metadata": null
} | ^3.5.0 | runtime |
commanderEnvironment{
"local_name": "commander",
"alias": false,
"peer_metadata": null
} | ^12.1.0 | runtime |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^16.0.0 | runtime |
esbuildEnvironment{
"local_name": "esbuild",
"alias": false,
"peer_metadata": null
} | ^0.19.0 | runtime |
inquirerEnvironment{
"local_name": "inquirer",
"alias": false,
"peer_metadata": null
} | ^9.2.0 | runtime |
js-yamlEnvironment{
"local_name": "js-yaml",
"alias": false,
"peer_metadata": null
} | ^4.1.0 | runtime |
oraEnvironment{
"local_name": "ora",
"alias": false,
"peer_metadata": null
} | ^7.0.0 | runtime |
viemEnvironment{
"local_name": "viem",
"alias": false,
"peer_metadata": null
} | ^2.7.0 | runtime |
zodEnvironment{
"local_name": "zod",
"alias": false,
"peer_metadata": null
} | ^3.22.0 | runtime |
@types/inquirerEnvironment{
"local_name": "@types/inquirer",
"alias": false,
"peer_metadata": null
} | ^9.0.0 | development |
@types/js-yamlEnvironment{
"local_name": "@types/js-yaml",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^20.0.0 | development |
@typescript-eslint/eslint-pluginEnvironment{
"local_name": "@typescript-eslint/eslint-plugin",
"alias": false,
"peer_metadata": null
} | ^6.0.0 | development |
@typescript-eslint/parserEnvironment{
"local_name": "@typescript-eslint/parser",
"alias": false,
"peer_metadata": null
} | ^6.0.0 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^8.0.0 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | development |
puppeteerEnvironment{
"local_name": "puppeteer",
"alias": false,
"peer_metadata": null
} | ^24.23.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
vitestEnvironment{
"local_name": "vitest",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | development |
Source distribution
{
"integrity": "sha512-4i6DDLIGZeLV1MdF7RIIIgMtlZPicxImXCMlaEvOg/RN6gWc8W5xlQ6aZ/m2EIcSLqDNsznVyQ5grKAMX2aD2w==",
"shasum": "e02a34a8f283624c9057756a835a7b4e66ef8027",
"tarball": "https://registry.npmjs.org/@0day-network/zerocode-cli/-/zerocode-cli-1.0.23.tgz",
"fileCount": 234,
"unpackedSize": 832681,
"signatures": [
{
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
"sig": "MEUCIEsD/Q9QGEp5KoIzqUcrZ2Z4YCiCwCiDp9OJQbfvoBl/AiEAthSOSYmeMDjqabpEh5eL1x+9rtgFZgfLb7xnlhZe1ls="
}
]
}Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:07ae8bdb85b88cb0dcad11d82fde15ae74ed6ef50c19d7d6ea7918e9dd87db70