Files
orangecat/docs/development/CLI_ENTITY_CREATION.md
CatoandClaude Opus 5.5 b774f06de7 docs: correct drift in agent instructions, README and ops docs (#1348)
* docs: correct drift in agent instructions, README and ops docs

- Auto-merge sweep lives in bitbaum/fleet, not bitbaum/dotfiles; cd.yml is
  dispatch-only (handed off by ci.yml post-main), not a workflow_run listener
- Design-system docs match globals.css / tailwind.config.ts: warm accent
  #ff5c00, bg-bitcoinOrange (no bitcoin-orange utility), tiffany/orange are
  legacy; display typography is shipped
- .claude rules: real paths (src/lib/validation/, entityCrudHandler.ts,
  standardResponse.ts, withZod/withRateLimit/withRequestId, services/actors),
  real Button/Alert APIs, real rate limits, search via @bitbaum/searchkit,
  real payment modules, PostgREST instead of the POSTGRES_URL tunnel,
  lint-staged pre-commit, eslint.config.mjs
- README/AGENTS/REVIEW: Next 16 / TS 6 / Tailwind 4, pnpm, messaging is not
  E2E-encrypted yet, beta not Live, CD deploys, migrations apply on deploy
- docs/: deploy process, CI/CD, migrations guide, moved docs/ paths, stale
  CLI-entity and edge-function docs flagged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* style(docs): prettier on the docs touched by the drift fix

lint-staged would have run this; the commit was made without hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 12:07:09 +02:00

5.1 KiB

created_date, last_modified_date, last_modified_summary
created_date last_modified_date last_modified_summary
2025-12-27 2026-10-19 Flagged organization type and SATS fields as out of date

CLI Entity Creation

Out of date (noted 2026-10-19). This page and scripts/cli/create-entity.js still describe an organization type and *_sats / SATS fields. Neither exists: the entity types are ENTITY_TYPES in src/config/entity-registry.ts (companies are the group type, shown to people as "Organization"), amounts are BTC (price_btc), and SATS is not a currency code. Check the registry and src/lib/validation/ before relying on the examples below.

OrangeCat supports creating entities (products, services, organizations, etc.) from the command line, just like using the GUI.

Quick Start

# Create an organization (company)
pnpm run create-entity --type organization --name "BitBaum AG" --description "Swiss Bitcoin company" --type company

# Create a product
pnpm run create-entity --type product --title "Coffee Mug" --price_sats 25000 --currency SATS

# Create a service
pnpm run create-entity --type service --title "Bitcoin Consulting" --category Consulting --hourly_rate_sats 50000

Usage

pnpm run create-entity --type <entity_type> [--field value]...

Entity Types

  • organization - Organizations/companies (supports "create a profile of a company")
  • product - Products
  • service - Services
  • cause - Charitable causes
  • loan - Loan listings
  • project - Crowdfunding projects
  • asset - Assets
  • ai_assistant - AI assistants
  • circle - Circles

Examples

Creating an Organization (Company)

When you say "create a profile of a company", this is how it works:

pnpm run create-entity \
  --type organization \
  --name "My Company AG" \
  --description "A Bitcoin-focused company" \
  --type company \
  --governance_model hierarchical \
  --website_url https://example.com \
  --is_public true

Required fields for organizations:

  • name - Organization name
  • type - One of: dao, company, nonprofit, community, cooperative, foundation, collective, guild, syndicate, circle
  • governance_model - One of: hierarchical, flat, democratic, consensus, liquid_democracy, quadratic_voting, stake_weighted, reputation_based

Optional fields:

  • description - Organization description
  • slug - URL slug (auto-generated from name if not provided)
  • website_url - Company website
  • category - Organization category
  • tags - Array of tags (format: [tag1,tag2])
  • treasury_address - Bitcoin address for treasury
  • lightning_address - Lightning address
  • is_public - Public visibility (default: true)
  • requires_approval - Require approval for members (default: true)

Creating a Product

pnpm run create-entity \
  --type product \
  --title "Handmade Coffee Mug" \
  --description "Beautiful ceramic mug" \
  --price_sats 25000 \
  --currency SATS \
  --product_type physical \
  --category Handmade

Creating a Service

pnpm run create-entity \
  --type service \
  --title "Bitcoin Consulting" \
  --description "Expert Bitcoin consulting services" \
  --category Consulting \
  --hourly_rate_sats 50000 \
  --service_location_type remote

Creating a Cause

pnpm run create-entity \
  --type cause \
  --title "Education Scholarship Fund" \
  --description "Supporting students in need" \
  --cause_category Education \
  --goal_sats 5000000

Authentication

By default, the CLI uses the API endpoint which requires authentication. You can:

  1. Set auth token (if using service account):

    export ORANGECAT_AUTH_TOKEN="your-token"
    pnpm run create-entity --type organization --name "Test"
    
  2. Use the API directly with your session cookie (for browser-based auth)

  3. Use the GUI - The CLI works the same way as the OrangeCat web interface

Programmatic Usage

You can also use the utility programmatically:

const { createEntity } = require('./scripts/cli/create-entity');

// Create an organization
await createEntity('organization', {
  name: 'My Company',
  type: 'company',
  governance_model: 'hierarchical',
  description: 'A great company',
});

Integration with AI Assistants

When an AI assistant (like Claude) is asked to "create a profile of a company", it can:

  1. Parse the request to extract company details
  2. Call the CLI utility or API directly
  3. Create the organization with appropriate defaults
  4. Return the created organization URL

Example AI interaction:

User: "Create a profile of a company called BitBaum AG, a Swiss Bitcoin company"

AI: [Calls createEntity('organization', {
  name: 'BitBaum AG',
  type: 'company',
  description: 'Swiss Bitcoin company',
  governance_model: 'hierarchical'
})]

AI: "✅ Created BitBaum AG! View at: https://orangecat.ch/organizations/bitbaum-ag"

Notes

  • All entity creation follows the same validation rules as the GUI
  • Organizations automatically add the creator as a founder stakeholder
  • The CLI uses the same API endpoints as the web interface
  • Entity types and fields match the OrangeCat entity registry