The Klyra CLI provides a convenient way to interact with the Klyra API directly from your terminal. It’s useful for testing, scripting, batch processing, and CI/CD pipelines.
# Moderate text from a stringklyra moderate text "This is a text to moderate"# Moderate text from a fileklyra moderate text --file ./content.txt# Specify categories to checkklyra moderate text --file ./content.txt --categories toxic,harassment,spam# Set custom thresholdklyra moderate text --file ./content.txt --threshold 0.8
# Moderate an image from a fileklyra moderate image --file ./image.jpg# Moderate an image from a URLklyra moderate image --url https://example.com/image.jpg# Get detailed analysis with region detectionklyra moderate image --file ./image.jpg --detailed
# View current configurationklyra config list# Set a configuration valueklyra config set <key> <value># Get a configuration valueklyra config get <key># Reset to default configurationklyra config reset
# List all webhooksklyra webhooks list# Create a new webhookklyra webhooks create --url https://example.com/webhook --events moderation.completed,moderation.flagged# Delete a webhookklyra webhooks delete <webhook_id>
# Generate an encryption keyklyra trustless generate-key --output key.txt# Use trustless mode with a specified keyklyra moderate text "Sensitive content" --trustless --key-file ./key.txt# Use trustless mode with an environment variableexport KLYRA_TRUSTLESS_KEY=$(cat key.txt)klyra moderate text "Sensitive content" --trustless