Permission-aware CLI for MsgCore - Universal messaging gateway.
Auto-generated from backend contracts - Do not edit manually
npm install -g @msgcore/cli# Configure CLI (stores in ~/.msgcore/config.json with secure permissions)
msgcore config set apiUrl https://api.msgcore.dev
msgcore config set apiKey msc_live_your_api_key_here
msgcore config set defaultProject my-project
# Verify configuration
msgcore config list
# Use CLI
msgcore messages send --target "platform-id:user:123" --text "Hello!"# Set environment variables (override config file)
export MSGCORE_API_URL="https://api.msgcore.dev"
export MSGCORE_API_KEY="msc_live_your_api_key_here"
export MSGCORE_DEFAULT_PROJECT="my-project"
# Use CLI
msgcore projects list --json- Environment variables (highest priority)
- Config file (~/.msgcore/config.json)
- Defaults
This allows you to:
- Use config file for daily work
- Override with env vars for CI/CD or testing
- Keep sensitive keys secure (file has 600 permissions)
- ✅ Permission-aware - Only shows commands you have access to
- ✅ Auto-generated - Always synced with backend API
- ✅ Type-safe - Built on @msgcore/sdk with full type safety
- ✅ Interactive - Helpful prompts and error messages
- ✅ JSON output - Perfect for scripting and automation
msgcore analysis entities list --helpmsgcore analysis entities get --helpanalysis models listanalysis profiles create --project my-project --name "Sentiment Analysis" --graphDefinition '{"nodes":[]}' --entitySchemaIds '["schema-1"]'analysis profiles list --project my-projectanalysis profiles get --project my-project --profileId abc123analysis runs create --project my-project --profileId abc123 --chatIds '["chat-1","chat-2"]'analysis runs stats --project my-projectanalysis runs list --project my-projectanalysis schemas create --project my-project --name Sentiment --extractionType llm_extraction --properties '{"score":"number","label":"string"}' --prompt "Analyze sentiment from -1 to 1"analysis schemas list --project my-projectanalysis schemas get --project my-project --schemaId abc123msgcore keys create --name "Bot Key" --scopes "messages:send,messages:read"msgcore keys listmsgcore keys revoke --keyId "key-123"msgcore auth signup --email admin@example.com --password Admin123 --name "Admin User"msgcore auth login --email admin@example.com --password Admin123msgcore auth accept-invite --token abc123... --name "John Doe" --password SecurePass123msgcore chats list --helpmsgcore chats get --helpmsgcore chats messages --helpmsgcore identities create --displayName "John Doe" --email "john@example.com" --aliases '[{"platformId":"platform-123","providerUserId":"discord-456","providerUserDisplay":"JohnD#1234"}]'msgcore identities listmsgcore identities search --q "john"msgcore members list my-projectmsgcore members add my-project --email user@example.com --role adminmsgcore members update my-project user-123 --role adminmsgcore messages listmsgcore messages statsmsgcore messages get --messageId "msg-123"msgcore platforms logs list my-projectmsgcore platforms logs get my-project platform-id-123msgcore platforms logs stats my-projectmsgcore platforms create --platform discord --name "Main Discord Bot" --credentials '{"token":"YOUR_DISCORD_BOT_TOKEN"}'msgcore platforms listmsgcore platforms get --id "platform-123"msgcore projects create --name "My Project"msgcore projects listmsgcore projects get my-projectmsgcore webhooks create --name "Production Webhook" --url "https://myapp.com/webhooks" --events "message.received,message.sent,message.failed"msgcore webhooks listmsgcore webhooks get --webhookId "webhook-123"# Set configuration values
msgcore config set apiUrl https://api.msgcore.dev
msgcore config set apiKey msc_live_your_api_key_here
msgcore config set defaultProject my-project
msgcore config set outputFormat json
# Get a specific value
msgcore config get apiKey
# Output: apiKey = ***
# List all configuration
msgcore config list
# Output:
# apiUrl = https://api.msgcore.dev
# apiKey = ***
# defaultProject = my-projectStored in ~/.msgcore/config.json with secure permissions (600):
{
"apiUrl": "https://api.msgcore.dev",
"apiKey": "msc_live_your_api_key_here",
"defaultProject": "my-project",
"outputFormat": "table"
}Security:
- File permissions:
600(owner read/write only) - Directory permissions:
700 - API keys are never logged or displayed in full
- Safe to use on shared systems
Environment variables have highest priority:
export MSGCORE_API_URL="https://api.msgcore.dev"
export MSGCORE_API_KEY="msc_live_your_api_key_here"
export MSGCORE_JWT_TOKEN="your-jwt-token" # Alternative to API key
export MSGCORE_DEFAULT_PROJECT="my-project"
export MSGCORE_OUTPUT_FORMAT="json" # or "table"Use cases:
- CI/CD pipelines (GitHub Actions, GitLab CI)
- Docker containers
- Temporary overrides for testing
- Multiple environments
┌─────────────────────────────────┐
│ 1. Environment Variables │ ← Highest priority
├─────────────────────────────────┤
│ 2. Config File (~/.msgcore/) │
├─────────────────────────────────┤
│ 3. Defaults │ ← Lowest priority
└─────────────────────────────────┘
The CLI supports --json flag for machine-readable output:
# Get projects as JSON
msgcore projects list --json | jq '.[] | .id'
# Send message and capture result
RESULT=$(msgcore messages send --target "id:user:123" --text "Hello" --json)
echo $RESULT | jq '.jobId'MIT