Console calls

Console calls

The ufo:rpc:process command executes an RPC request without HTTP: handy for cron, scripts and debugging. Single and batch requests are supported, and token verification is the same as for HTTP.

php bin/console ufo:rpc:process '{"jsonrpc": "2.0", "id": 1, "method": "ping"}' --ufo-rpc-token=<token>

Arguments and options

Argument / option Description
json Request JSON; - reads from stdin; @env reads from the UFO_RPC_REQUEST variable
--<token_name> Token. The option name is security.token_name in lowercase (Ufo-RPC-Token → --ufo-rpc-token); required when protected_api: true
--api-group API group, general by default
--ver API version, v1 by default

If the token option is not passed, the token is taken from the UFO_RPC_TOKEN environment variable.

Do not expose the token and data

Command-line arguments are visible in the process list. Pass the request via stdin and the token via an environment variable:

echo '{"jsonrpc":"2.0","id":1,"method":"Report.build","params":{"month":"2026-09"}}' \
  | UFO_RPC_TOKEN=<token> php bin/console ufo:rpc:process - --api-group=internal

The response is printed to stdout in JSON-RPC format. The bundle uses the same command for batch child processes and detached notifications.