The MultiFlexi CLI is a powerful Symfony Console-based command line interface for comprehensive management of MultiFlexi resources. It provides full CRUD operations for all system entities and supports both text and JSON output formats for automation and scripting.
The CLI is included with MultiFlexi and available as:
# System-wide installation
multiflexi-cli <command> [action] [options]
# Local installation
./cli/multiflexi-cli <command> [action] [options]multiflexi-cli <command> [action] [options]Global Options:
-f, --format- Output format: text or json (default: text)-v, --verbose- Increase verbosity (use -vv or -vvv for more detail)--no-ansi- Disable colored output-h, --help- Display help for the command-V, --version- Display application version
Environment Configuration:
Use the -e or --environment option to specify a custom .env file:
multiflexi-cli -e /path/to/custom/.env command actionThe MultiFlexi CLI provides the following main commands:
- application - Manage applications (import/export/remove JSON, show configuration fields)
- company - Manage companies and their settings
- companyapp - Manage company-application relations
- job - Manage job execution and monitoring
- runtemplate - Manage run templates and scheduling
- user - User account management
- user:data-erasure - GDPR user data erasure management
- token - API token management
- credtype - Credential type operations
- encryption - Manage encryption keys
- queue - Job queue operations
- status - System status information (encryption, Zabbix, OpenTelemetry)
- telemetry:test - Test OpenTelemetry metrics export
- describe - List all available commands and their parameters
- prune - Prune logs and jobs, keeping only the latest N records (default: 1000)
- completion - Dump the shell completion script
Manage applications (list, get, create, update, delete, import/export/remove JSON, show configuration fields).
multiflexi-cli application <action> [options]Actions: - list: List all applications. - get: Get application details by ID, UUID, or name. - create: Create a new application (requires --name, --uuid). - update: Update an existing application (requires --id or --uuid). - delete: Delete an application (requires --id). - import-json: Import application from JSON file (requires --json). - export-json: Export application to JSON file (requires --id, --json). - remove-json: Remove application from JSON file (requires --json). - showconfig: Show defined configuration fields for application (requires --id or --uuid).
- Options:
--id Application ID --uuid Application UUID --name Name --description Description --topics Topics --executable Executable --ociimage OCI Image --requirements Requirements --homepage Homepage URL --json Path to JSON file for import/export/remove --appversion Application Version -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli application list
multiflexi-cli application get --id=1
multiflexi-cli application get --uuid=uuid-123
multiflexi-cli application get --name="App1"
multiflexi-cli application create --name="App1" --uuid="uuid-123"
multiflexi-cli application update --id=1 --name="App1 Updated"
multiflexi-cli application delete --id=1
multiflexi-cli application import-json --json=app.json
multiflexi-cli application export-json --id=1 --json=app.json
multiflexi-cli application showconfig --id=1Manage company-application relations (list, assign, unassign).
multiflexi-cli companyapp <action> [options]Actions: - list: List RunTemplates. Without filters all assignments are shown; optionally filter by --company_id and/or --app_id / --app_uuid. - assign: Assign an application to a company and create a default RunTemplate (requires --company_id and --app_id or --app_uuid). - unassign: Remove all RunTemplates and the company-app relation (requires --company_id and --app_id or --app_uuid).
Output columns for list:
- id – RunTemplate ID
- company_id, company_name, company_slug – company details
- app_id, app_name, app_uuid – application details
- Options:
--company_id Company ID (optional filter) --app_id Application ID (optional filter) --app_uuid Application UUID (optional filter; resolved to app_id) --limit Limit number of results for list action --offset Offset for list action (skip N results) --order Sort order for list action: A (ascending) or D (descending) --fields Comma-separated list of fields to display (sub-selects from output columns) -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli companyapp list
multiflexi-cli companyapp list --company_id=1
multiflexi-cli companyapp list --company_id=1 --app_id=2
multiflexi-cli companyapp list --company_id=1 --app_id=2 --limit=10 --offset=0 --order=D
multiflexi-cli companyapp list --format=json
multiflexi-cli companyapp assign --company_id=1 --app_id=2
multiflexi-cli companyapp assign --company_id=1 --app_uuid=uuid-123 --format=json
multiflexi-cli companyapp unassign --company_id=1 --app_id=2Credential type operations (list, get, update, import, import-json, export-json, remove-json, validate-json).
multiflexi-cli credtype <action> [options]Actions: - list: List all credential types. - get: Get credential type details by ID or UUID. - update: Update a credential type (requires --id or --uuid). - import: Import credential type from JSON file with validation (requires --file). - import-json: Import credential type from JSON file (alias for import, requires --file). - export-json: Export credential type to JSON file (requires --id or --uuid, --file). - remove-json: Remove credential type based on JSON file (requires --file). - validate-json: Validate credential type JSON file against schema (requires --file).
- Options:
--id Credential Type ID --uuid Credential Type UUID --name Name --file Path to JSON file for import/export/remove/validate operations -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli credtype list
multiflexi-cli credtype get --id=1
multiflexi-cli credtype get --uuid="d3d3ae58-d64a-4ab4-afb5-ba439ffc8587"
multiflexi-cli credtype update --id=1 --name="Updated API Key"
# JSON Operations
multiflexi-cli credtype import-json --file credential-type.json
multiflexi-cli credtype import-json --file credential-type.json --format json
multiflexi-cli credtype validate-json --file credential-type.json
multiflexi-cli credtype export-json --id=1 --file exported-credtype.json
# Schema validation before import
multiflexi-cli credtype validate-json --file new-credtype.json
multiflexi-cli credtype import-json --file new-credtype.jsonJSON Import Features:
- Schema Validation: All JSON files are validated against the MultiFlexi credential type schema before import
- Duplicate Detection: Prevents importing credential types with existing UUIDs
- Localization Support: Supports multi-language names and descriptions
- Field Definition Import: Automatically creates field definitions with proper types and validation
- Error Reporting: Detailed error messages for validation failures and import issues
Credential Type JSON Structure:
The JSON file must conform to the MultiFlexi credential type schema and include:
uuid: Unique identifier for the credential typecode: Short code for the credential typename: Name (can be localized object or string)description: Description (can be localized object or string)fields: Array of field definitions with keyword, name, type, description, and requirements
Example credential type JSON:
{
"uuid": "d3d3ae58-d64a-4ab4-afb5-ba439ffc8587",
"code": "ProbeAPI",
"name": {
"en": "Probe API Credentials",
"cs": "Přihlašovací údaje pro Probe API"
},
"description": {
"en": "Credential type for probe integrations.",
"cs": "Typ přihlašovacích údajů pro sondy."
},
"fields": [
{
"keyword": "PROBE_API_KEY",
"name": {
"en": "API Key",
"cs": "API klíč"
},
"type": "secret",
"description": {
"en": "API key for authentication.",
"cs": "API klíč pro autentizaci."
},
"required": true
}
]
}Manage companies (list, get, create, update, remove).
multiflexi-cli company <action> [options]Actions: - list: List all companies. - get: Get company details by ID. - create: Create a new company (requires --name). - update: Update an existing company (requires --id). - remove: Remove a company (requires --id).
- Options:
--id Company ID --name Company name --customer Customer --enabled Enabled (true/false) --settings Settings --logo Logo --ic IC --DatCreate Created date (date-time) --DatUpdate Updated date (date-time) --email Email --slug Company Slug -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli company list
multiflexi-cli company get --id=1
multiflexi-cli company create --name="Acme Corp" --customer="CustomerX"
multiflexi-cli company remove --id=1Manage jobs (list, get, create, update, delete).
multiflexi-cli job <action> [options]Actions: - list: List all jobs. - get: Get job details by ID. - create: Create a new job (requires --runtemplate_id and --scheduled). - update: Update an existing job (requires --id). - delete: Delete a job by its ID.
- Options:
--id Job ID --runtemplate_id RunTemplate ID --scheduled Scheduled datetime --executor Executor --schedule_type Schedule type --app_id App ID --limit Limit number of results for list action --offset Offset for list action (skip N results) --order Sort order for list action: A (ascending) or D (descending) --status Filter by job state:
failed,success,running,pendingfailed– completed with non-zero exit code (exitcode IS NOT NULL AND exitcode != 0)success– completed successfully (exitcode = 0)running– started but not yet finished (begin IS NOT NULL AND exitcode IS NULL)pending– scheduled but not yet started (begin IS NULL AND exitcode IS NULL)
--fields Comma-separated list of fields to display -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli job list
multiflexi-cli job list --limit=10 --order=D
multiflexi-cli job list --status=failed
multiflexi-cli job list --status=failed --format=json
multiflexi-cli job list --status=pending
multiflexi-cli job list --status=running
multiflexi-cli job:list --status=failed
multiflexi-cli job:list --status=pending --format=json
multiflexi-cli job get --id=123
multiflexi-cli job create --runtemplate_id=5 --scheduled="2024-07-01 12:00"
multiflexi-cli job update --id=123 --executor=Native
multiflexi-cli job delete --id=123Manage runtemplates (list, get, create, update, delete, schedule).
multiflexi-cli runtemplate <action> [options]Actions: - list: List all runtemplates. - get: Get runtemplate details by ID. - create: Create a new runtemplate (requires --name, --app_id, --company_id). - update: Update an existing runtemplate (requires --id). - delete: Delete a runtemplate (requires --id). - schedule: Schedule a runtemplate launch as a job (requires --id).
- Options:
--id RunTemplate ID --name Name --app_id App ID --company_id Company ID --interv Interval code --active Active --config Application config key=value (repeatable) --schedule_time Schedule time for launch (Y-m-d H:i:s or "now") --executor Executor to use for launch --env Environment override key=value (repeatable) -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli runtemplate create --name="Import Yesterday" --app_id=19 --company_id=1 --config=IMPORT_SCOPE=yesterday --config=ANOTHER_KEY=foo
multiflexi-cli runtemplate update --id=230 --config=IMPORT_SCOPE=yesterday --config=ANOTHER_KEY=foo
multiflexi-cli runtemplate get --id=230 --format=json
multiflexi-cli runtemplate create --name="Import" --app_id=6e2b2c2e-7c2a-4b1a-8e2d-123456789abc --company_id=1
multiflexi-cli runtemplate schedule --id=123 --schedule_time="2025-07-01 10:00:00" --executor=Native --env=FOO=bar --env=BAZ=quxManage users (list, get, create, update, delete).
multiflexi-cli user <action> [options]Actions: - list: List all users. - get: Get user details by ID. - create: Create a new user (requires --login and --email). - update: Update an existing user (requires --id). - delete: Delete a user (requires --id).
- Options:
--id User ID --login Login --firstname First name --lastname Last name --email Email --password Password (hashed) --plaintext Plaintext password --enabled Enabled (true/false) -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli user list
multiflexi-cli user get --id=1
multiflexi-cli user create --login="jsmith" --firstname="John" --lastname="Smith" --email="jsmith@example.com" --plaintext="secret"
multiflexi-cli user update --id=1 --email="john.smith@example.com"
multiflexi-cli user delete --id=1Manage GDPR user data erasure requests under Article 17 (Right to Erasure).
multiflexi-cli user:data-erasure <action> [options]Actions: - list: List deletion requests (optionally filtered by status). - create: Create a new deletion request for a user. - approve: Approve a pending deletion request (requires admin). - reject: Reject a pending deletion request (requires admin). - process: Process an approved deletion request. - audit: Show audit trail for a deletion request. - cleanup: Clean up old audit logs (7-year retention).
- Options:
--user-id Target user ID for the operation --user-login Target user login for the operation --request-id Deletion request ID --deletion-type Deletion type: soft, hard, anonymize (default: soft) --reason Reason for the deletion request --notes Review notes for approval/rejection --force Force operation without confirmation --export-audit Export audit trail to CSV file --status Filter requests by status: pending, approved, rejected, completed -f, --format Output format: text or json (default: text)
Deletion Types: - soft: Disable user account, anonymize personal data, preserve data structures - hard: Permanently delete user data and account (requires approval) - anonymize: Replace personal data with anonymized values, disable account
Examples:
# List all pending deletion requests
multiflexi-cli user:data-erasure list --status=pending
# Create a soft deletion request for user ID 123
multiflexi-cli user:data-erasure create --user-id=123 --deletion-type=soft --reason="User requested account deletion"
# Create a hard deletion request by user login
multiflexi-cli user:data-erasure create --user-login=jsmith --deletion-type=hard --reason="Legal compliance requirement"
# Approve a deletion request with review notes
multiflexi-cli user:data-erasure approve --request-id=456 --notes="Verified user identity and legal basis"
# Reject a deletion request
multiflexi-cli user:data-erasure reject --request-id=789 --reason="Insufficient documentation provided"
# Process an approved deletion request
multiflexi-cli user:data-erasure process --request-id=456
# Show audit trail and export to CSV
multiflexi-cli user:data-erasure audit --request-id=456 --export-audit=/tmp/audit_456.csv
# Clean up old audit logs (7-year retention)
multiflexi-cli user:data-erasure cleanupManage tokens (list, get, create, generate, update).
multiflexi-cli token <action> [options]Actions: - list: List all tokens. - get: Get token details by ID. - create: Create a new token (requires --user). - generate: Generate a new token value (requires --user). - update: Update an existing token (requires --id).
- Options:
--id Token ID --user User ID --token Token value -f, --format Output format: text or json (default: text)
Examples:
multiflexi-cli token list
multiflexi-cli token get --id=1
multiflexi-cli token create --user=2
multiflexi-cli token generate --user=2
multiflexi-cli token update --id=1 --token=NEWVALUEManage encryption keys for secure credential storage. MultiFlexi uses AES-256 encryption to protect sensitive data (passwords, API keys, tokens) in the database.
multiflexi-cli encryption <action> [options]Actions: - status: Show encryption system status (master key, active keys, key details) - init: Re-initialize encryption keys (generates new 256-bit key encrypted with master key)
- Options:
-f, --format Output format: text or json (default: text)
MultiFlexi encryption requires ENCRYPTION_MASTER_KEY to be configured in one of the following ways (checked in priority order):
- Environment variable:
ENCRYPTION_MASTER_KEY - Environment variable:
MULTIFLEXI_MASTER_KEY(backward compatibility) - Configuration file:
/etc/multiflexi/multiflexi.env
Automatic Setup: During installation of the multiflexi-common package, a master key is automatically generated and stored in /etc/multiflexi/multiflexi.env.
Manual Configuration:
# Generate a secure 256-bit key
openssl rand -base64 32
# Add to /etc/multiflexi/multiflexi.env
echo "ENCRYPTION_MASTER_KEY=<generated-key>" | sudo tee -a /etc/multiflexi/multiflexi.envImportant Security Notes:
- Backup
/etc/multiflexi/multiflexi.env- without the master key, encrypted credentials cannot be recovered - Never commit the master key to version control
- If the master key is lost, all encrypted credentials become permanently inaccessible
- The master key is used to encrypt database encryption keys (key wrapping)
Check the encryption system status:
multiflexi-cli encryption status
# JSON output for automation
multiflexi-cli encryption status -f jsonSample output:
Encryption Status
Master Key: configured
Total Keys: 3
Active Keys: 3
Keys:
+-------------+-------------+--------+---------------------+---------+
| Key Name | Algorithm | Status | Created | Rotated |
+-------------+-------------+--------+---------------------+---------+
| credentials | aes-256-gcm | active | 2025-10-30 09:00:00 | never |
| default | aes-256-gcm | active | 2025-10-29 10:00:00 | never |
| personal | aes-256-gcm | active | 2025-10-28 08:00:00 | never |
+-------------+-------------+--------+---------------------+---------+
JSON output includes:
{
"success": true,
"message": "Encryption status retrieved",
"data": {
"master_key": "configured",
"total_keys": 3,
"active_keys": 3,
"keys": [
{
"key_name": "credentials",
"algorithm": "aes-256-gcm",
"created_at": "2025-10-30 09:00:00",
"rotated_at": null,
"is_active": true
}
]
}
}Re-initialize encryption keys:
# Re-initialize encryption keys
multiflexi-cli encryption init
# Re-initialize with JSON output
multiflexi-cli encryption init -f jsonSample output:
Encryption key initialized successfully
Key name: credentials
Algorithm: aes-256-gcm
WARNING: All existing encrypted credentials are now invalid and must be re-entered
Warning: Re-initializing encryption keys will invalidate all previously encrypted credentials. All sensitive data must be re-entered after running this command. Use this command only during:
- Initial system setup
- After master key rotation
- Security incident response
- Explicit security policy requirements
Error Handling:
If ENCRYPTION_MASTER_KEY is not configured, the init command will fail:
ERROR: ENCRYPTION_MASTER_KEY is not configured. Set it in .env file or as environment variable.
Queue operations (list, truncate, fix). When no action is specified, shows comprehensive queue metrics overview including orphaned jobs count.
multiflexi-cli queue <action> [options]Actions: - list: Show all scheduled jobs in the queue with detailed information. - truncate: Remove all scheduled jobs from the queue. - fix: Perform diagnostics and fix orphaned jobs or queue inconsistencies. - (no action): Show queue overview with metrics and statistics.
- Options:
-f, --format Output format: text or json (default: text) --limit Limit number of results for list action --order Sort field: "after", "id" --direction Sort direction: "ASC", "DESC", "A", "D" (default: ASC) --fields Comma-separated list of fields to display
Queue List Features:
The queue list command displays comprehensive information about scheduled jobs:
- Schedule Type: Shows human-readable schedule types (daily, weekly, monthly, yearly, hourly, minutly, custom, disabled) converted from interval codes
- Waiting Time: Displays human-readable time remaining until job execution (e.g., "2h 45m", "25d 2h 45m", "overdue")
- Complete Job Details: RunTemplate name, Application name, Company information
- Flexible Ordering: Sort by scheduled time or ID in ascending/descending order
- Field Filtering: Display only specific columns using --fields option
Examples:
# Basic queue listing
multiflexi-cli queue list
# Show overview metrics
multiflexi-cli queue
# Order by scheduled time (earliest first)
multiflexi-cli queue list --order after --limit 10
# Order by scheduled time (latest first)
multiflexi-cli queue list --order after --direction DESC --limit 10
# Show only specific fields
multiflexi-cli queue list --fields "id,after,schedule_type,runtemplate_name" --limit 5
# JSON output for automation
multiflexi-cli queue list --format json --limit 20
# Truncate all jobs
multiflexi-cli queue truncate
# Fix orphaned jobs and queue inconsistencies
multiflexi-cli queue fixPrune logs and jobs, keeping only the latest N records (default: 1000).
multiflexi-cli prune [--logs] [--jobs] [--keep=N]- Options:
--logs Prune logs table --jobs Prune jobs table --keep Number of records to keep (default: 1000)
Examples:
multiflexi-cli prune --logs
multiflexi-cli prune --jobs --keep=500
multiflexi-cli prune --logs --jobs --keep=2000Dump the shell completion script for bash, zsh, or fish.
multiflexi-cli completion [shell]- Options:
--debug Tail the completion debug log
Examples:
multiflexi-cli completion bash
multiflexi-cli completion zsh
multiflexi-cli completion fishList all available commands and their parameters.
multiflexi-cli describeShow current MultiFlexi system status, including version, database, PHP, OS, resource usage, monitoring systems (Zabbix, OpenTelemetry), encryption, and service health.
multiflexi-cli status
multiflexi-cli status --format jsonSample output:
version-cli: dev-main
db-migration: RuntemplateCron
php: 8.4.11
os: Linux
memory: 4071888
companies: 4
apps: 22
runtemplates: 177
topics: 27
credentials: 129
credential types: 9
database: mysql Localhost via UNIX socket Uptime: 12711 Threads: 12 Questions: 2010 Slow queries: 0 Opens: 113 Open tables: 103 Queries per second avg: 0.158 11.8.2-MariaDB-1 from Debian
encryption: active (3 keys)
zabbix: multiflexi-server => zabbix.example.com
telemetry: enabled (multiflexi, http://otel-collector:4318, http/json)
executor: active
scheduler: inactive
timestamp: 2025-08-04T14:14:17+00:00
Field descriptions:
- version-cli: CLI version (branch or tag)
- db-migration: Latest database migration applied
- php: PHP version
- os: Operating system
- memory: Current PHP memory usage (bytes)
- companies: Number of companies in the system
- apps: Number of applications
- runtemplates: Number of runtemplates
- topics: Number of topics
- credentials: Number of credentials
- credential types: Number of credential types
- database: Database driver and connection info
- encryption: Encryption system status (see below)
- zabbix: Zabbix monitoring status (see below)
- telemetry: OpenTelemetry status (see below)
- executor: Status of the multiflexi-executor service
- scheduler: Status of the multiflexi-scheduler service
- timestamp: ISO 8601 timestamp of the status report
Encryption Status Values:
- disabled: Encryption is turned off (
DATA_ENCRYPTION_ENABLED=false) - active (N keys): Encryption is working with N active encryption keys
- broken (no master key):
ENCRYPTION_MASTER_KEYnot configured - broken (no active keys): Master key configured but no active keys in database
- broken (table missing):
encryption_keystable doesn't exist - unknown (error: ...): Database error occurred
Zabbix Status Values:
- disabled: Zabbix monitoring is not configured (no
ZABBIX_SERVER) - hostname => server: Monitoring active, e.g.
multiflexi-server => zabbix.example.com - Uses
ZABBIX_HOSTconfig or system hostname as monitored hostname
OpenTelemetry Status Values:
- disabled: OpenTelemetry is not enabled (
OTEL_ENABLED=falseor not set) - enabled (service, endpoint, protocol): Active configuration, e.g.
enabled (multiflexi, http://otel-collector:4318, http/json) - enabled (SDK not installed): Enabled but OpenTelemetry PHP SDK is not installed
Test OpenTelemetry metrics export functionality by sending test metrics to the configured OTLP endpoint.
multiflexi-cli telemetry:test
multiflexi-cli telemetry:test --endpoint http://custom:4318
multiflexi-cli telemetry:test --disable-gauges- Options:
-e, --endpoint Override OTLP endpoint URL --disable-gauges Disable observable gauges (test only counters/histograms)
This command:
- Checks if OpenTelemetry is enabled (
OTEL_ENABLED=true) - Displays current configuration (service name, endpoint, protocol)
- Initializes the OTel Metrics Exporter
- Sends test metrics: - Job start metric (job_id=99999) - Job end metrics (success and failure) - Observable gauges (jobs.running, applications.total, etc.)
- Flushes metrics to the OTLP endpoint
Example output:
Testing OpenTelemetry Metrics Export
Configuration:
Service Name: multiflexi
Endpoint: http://localhost:4318
Protocol: http/json
Initializing OTel Metrics Exporter...
✓ Exporter initialized successfully
Testing job start metric...
✓ Job start metric recorded
Testing job end metrics...
✓ Success metric (exitcode=0, duration=5.5s)
✓ Failure metric (exitcode=1, duration=2.3s)
Testing observable gauges (real-time metrics)...
✓ multiflexi.jobs.running
✓ multiflexi.applications.total
✓ multiflexi.companies.total
Flushing metrics to OTLP endpoint...
✓ Metrics flushed successfully
Test completed successfully!
Available metrics:
- Counters:
multiflexi.jobs.total,multiflexi.jobs.success,multiflexi.jobs.failed - Histogram:
multiflexi.job.duration(seconds) - Gauges:
multiflexi.jobs.running,multiflexi.applications.{total,enabled},multiflexi.companies.total,multiflexi.runtemplates.total
See the OpenTelemetry documentation for complete integration guide.