mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 20:28:04 +01:00
- Fix currency defaults (SATS → CHF) across forms, configs, and API routes - Remove @ts-nocheck from socialService.ts and improve type safety - Replace console.log statements with proper logger utility in production code - Additional type safety improvements and code quality enhancements - Documentation updates for improved maintainability All changes follow DRY, SSOT, and separation of concerns principles.
4.6 KiB
4.6 KiB
created_date, last_modified_date, last_modified_summary
| created_date | last_modified_date | last_modified_summary |
|---|---|---|
| 2025-12-27 | 2025-12-27 | Documentation for CLI entity creation utility |
CLI Entity Creation
OrangeCat supports creating entities (products, services, organizations, etc.) from the command line, just like using the GUI.
Quick Start
# Create an organization (company)
npm run create-entity -- --type organization --name "BitBaum AG" --description "Swiss Bitcoin company" --type company
# Create a product
npm run create-entity -- --type product --title "Coffee Mug" --price_sats 25000 --currency SATS
# Create a service
npm run create-entity -- --type service --title "Bitcoin Consulting" --category Consulting --hourly_rate_sats 50000
Usage
npm run create-entity -- --type <entity_type> [--field value]...
Entity Types
organization- Organizations/companies (supports "create a profile of a company")product- Productsservice- Servicescause- Charitable causesloan- Loan listingsproject- Crowdfunding projectsasset- Assetsai_assistant- AI assistantscircle- Circles
Examples
Creating an Organization (Company)
When you say "create a profile of a company", this is how it works:
npm 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 nametype- One of: dao, company, nonprofit, community, cooperative, foundation, collective, guild, syndicate, circlegovernance_model- One of: hierarchical, flat, democratic, consensus, liquid_democracy, quadratic_voting, stake_weighted, reputation_based
Optional fields:
description- Organization descriptionslug- URL slug (auto-generated from name if not provided)website_url- Company websitecategory- Organization categorytags- Array of tags (format:[tag1,tag2])treasury_address- Bitcoin address for treasurylightning_address- Lightning addressis_public- Public visibility (default: true)requires_approval- Require approval for members (default: true)
Creating a Product
npm 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
npm 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
npm 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:
-
Set auth token (if using service account):
export ORANGECAT_AUTH_TOKEN="your-token" npm run create-entity -- --type organization --name "Test" -
Use the API directly with your session cookie (for browser-based auth)
-
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:
- Parse the request to extract company details
- Call the CLI utility or API directly
- Create the organization with appropriate defaults
- 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