@campnetwork/cli
v0.1.1
Published
Command-line tool for managing licensed IP NFTs on [Camp Network](https://www.campnetwork.xyz). Browse, purchase, and interact with on-chain intellectual property — including git repositories protected by Origin's licensing layer.
Readme
Origin CLI
Command-line tool for managing licensed IP NFTs on Camp Network. Browse, purchase, and interact with on-chain intellectual property — including git repositories protected by Origin's licensing layer.
Installation
npm install -g @campnetwork/cliRequires Node.js 18+.
Quick Start
# Authenticate (opens browser for wallet signing)
origin login
# View an IP NFT
origin info <tokenId>
# Purchase access
origin buy <tokenId>
# Download content
origin get <tokenId>
# Clone a licensed git repository
origin clone <tokenId>Authentication
Origin CLI supports two authentication methods:
Browser-based (default)
origin loginOpens your browser where you connect your wallet and sign a SIWE message. The CLI picks up the credentials automatically once signing is complete.
Private key
origin login --private-key <key>
# or
ORIGIN_PRIVATE_KEY=<key> origin loginSigns the SIWE message directly without a browser. Useful for CI/CD and scripted environments.
Credentials are stored in ~/.origin/credentials. Log out with origin logout.
Commands
origin login
Authenticate with Camp Network Origin.
| Option | Description |
|---|---|
| --private-key <key> | Ethereum private key for direct SIWE signing |
origin logout
Remove stored credentials and unregister the git credential helper.
origin status
Show current authentication status (wallet address).
origin info <tokenId>
Display details about an IP NFT — name, creator, license type, price, and active subscriptions.
origin buy <tokenId>
Open the browser to purchase access to an IP NFT.
origin get <tokenId>
Download IP NFT content to disk, or output API data as JSON.
| Option | Description |
|---|---|
| -o, --output <dir> | Output directory (default: ./<tokenId>) |
| --private-key <key> | Private key for X402 payment signing |
| -p, --param <key=value> | Query parameters for API sources (repeatable) |
| -H, --header <key=value> | Custom headers for API sources (repeatable) |
| --json | Output API/data responses as JSON to stdout |
origin clone <tokenId>
Clone a licensed git repository. Requires an active subscription or triggers an X402 payment if configured.
origin pull
Pull latest changes in a licensed repository. Run from inside a cloned repo.
origin fetch
Fetch latest changes in a licensed repository. Run from inside a cloned repo.
Git Integration
When you run origin login, the CLI registers itself as a git credential helper. This means origin clone, origin pull, and origin fetch authenticate transparently — no manual token management needed.
For repositories using X402 payment-gated access, set ORIGIN_PRIVATE_KEY in your environment. The CLI will automatically sign payment permits when the server requires them.
MCP Server for AI Agents
The package includes an MCP server (origin-mcp) that lets AI agents search, inspect, and fetch licensed data from Origin — with automatic X402 micropayments when a private key is configured.
Tools
| Tool | Description | Auth required |
|---|---|---|
| origin_search | Search the marketplace by keyword | No |
| origin_info | Get detailed token metadata | No |
| origin_get | Fetch actual data from a token | Yes |
Configuration
Claude Code (.claude/settings.json):
{
"mcpServers": {
"origin": { "command": "origin-mcp" }
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"origin": { "command": "origin-mcp" }
}
}For automatic X402 payments in agent/CI contexts:
ORIGIN_PRIVATE_KEY=<key> origin-mcpEnvironment Variables
| Variable | Description |
|---|---|
| ORIGIN_PRIVATE_KEY | Private key for login and X402 payments |
| ORIGIN_NETWORK | mainnet (default) or testnet |
| ORIGIN_BACKEND_URL | Override backend API URL |
| ORIGIN_UI_URL | Override web UI URL |
| ORIGIN_CLIENT_ID | Override Origin client ID |
| ORIGIN_GIT_PROXY_HOST | Override git proxy host |
| ORIGIN_GIT_PROXY_URL | Override git proxy base URL |
Development
git clone <repo-url>
cd origin-cli
npm install
npm run dev # watch mode
npm run build # production buildThe CLI entry point is src/index.ts. Commands live in src/commands/ and shared utilities in src/lib/.
