print

Learn how to display messages in the terminal.

This action outputs a message to the terminal with optional semantic styling and a title.

Use it to give feedback to the user at any point during the workflow.

Example

The following template prints a success message after setup:

template.json5
{  "$schema": "https://schema.croct.com/json/v1/template.json",  "title": "Setup confirmation",  "description": "Prints a setup confirmation message.",  "actions": [    {      "name": "print",      "semantics": "success",      "title": "All set",      "message": "The project is ready. Run `npm run dev` to start."    }  ]}

To apply this template, run:

npx croct@latest use template.json5

Properties

These are the supported properties:

name
string

The action identifier. Always print for this action.

message
string

The message to display.

The message supports basic markdown formatting:

SyntaxDescription
**text**Bold
*text*Italic
~~text~~Strikethrough
`text`Highlight
[text](url)Link
semantics(optional)
string

The visual style of the message.

ValueDescription
neutralDefault style for general messages.
infoInformational messages.
successConfirmation that an operation completed.
warningCautionary messages that need attention.
errorError messages indicating a problem.
Default:neutral
title(optional)
string

A short title for the message.

When set, the message is rendered inside a callout box with the title centered at the top. The title also supports markdown formatting.