printf
Format strings with printf-style specifiers like %s, %d, %f. Returns JSON formatted output or plain text with --raw. Ideal for precise number formatting, padding, and type conversion.
Instructions
Format and print text using printf-style conversion specifiers (%s, %d, %f, etc.). Read-only, no side effects. Returns JSON with the formatted string by default; use --raw for plain output. Use for precise control over number formatting, padding, and type conversion. Not for simple echo without formatting — use 'echo'. See also 'echo'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write formatted text without a JSON envelope. | |
| values | No | Values used by format conversions. | |
| encoding | No | Output encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| format_string | Yes | Printf-style format string. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |