AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Xmake Color Output

skill-xmake-io-xmake-skills-xmake-color-output · by xmake-io

Use when emitting colored/styled output from `xmake.lua` or custom tasks/plugins via `cprint` / `cprintf`, or when the user wants to disable colors (`XMAKE_COLORTERM=nocolor`, `--theme=plain`). Covers the `${...}` color tag syntax, all color names, truecolor, emoji, and the disable knobs.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-xmake-io-xmake-skills-xmake-color-output

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-xmake-io-xmake-skills-xmake-color-output)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Xmake Color Output? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

cprint, Color Tags & Disabling Color

cprint / cprintf are xmake's colored terminal printers. They look like print/printf but accept inline style tags:

cprint("${bright green}hello ${clear}xmake")

Available in any script-domain code: on_load, on_build, after_build, on_run, on_test, task bodies, external modules imported via import(). Not available in the description domain (top-level set_*/add_*) — use print there instead, and only for debugging.

Basic usage

cprint("hello")                       -- plain text, like print
cprint("${red}error")                 -- red text
cprint("${bright red}ERROR")          -- bold red
cprintf("%d errors\n", n)             -- printf-style
print("hello, %s", name)              -- plain print; no tags, no newline-less variant

Formatting uses string.format-style substitution. cprint adds a trailing newline; cprintf does not.

Tag syntax

Styles are wrapped in ${...} and apply to the rest of the line (or until ${clear}):

cprint("${red}hello ${clear}xmake")          -- only "hello " is red
cprint("${bright red underline onyellow}ALERT${clear}")

Multiple attributes are space-separated inside one ${...}.

Complete attribute list

Attributes:

| Tag | Effect | | --- | --- | | reset / clear / default | reset all style | | bright | bold / highlight | | dim | dark / faint | | underline | underline | | blink | blinking text | | reverse | swap fg/bg | | hidden | invisible text |

Foreground colors:

black  red  green  yellow  blue  magenta  cyan  white

Background colors (prefix on):

onblack  onred  ongreen  onyellow  onblue  onmagenta  oncyan  onwhite

Example:

cprint("${bright red underline onyellow}hello${clear}")
cprint("${dim cyan}note:${clear} did you mean ${bright yellow}--foo${clear}?")

24-bit true color

Since v2.1.7, if the terminal reports truecolor support xmake accepts RGB triples:

import("core.base.colors")
if colors.truecolor() then
    cprint("${255;0;0}red")                 -- foreground RGB
    cprint("${on;255;0;0}bg red${clear}")   -- background RGB
    cprint("${bright 255;0;0 underline}bold red underlined")
    cprint("${on;255;0;0 0;255;0}green-on-red${clear}")
end

Force-enable if your terminal is not auto-detected:

export XMAKE_COLORTERM=truecolor

Emoji

cprint("build ok ${beer}")
cprint("${ok_hand} done")

Falls back to nothing on terminals that do not support the emoji. See the emoji cheat sheet for all keys.

Disabling color output

Three knobs, from least to most invasive:

1. Per-invocation env var

XMAKE_COLORTERM=nocolor xmake

Other values: color8, color256, truecolor. nocolor strips all ANSI codes.

2. Persistent global

export XMAKE_COLORTERM=nocolor              # shell session

Or in CI:

env:
  XMAKE_COLORTERM: nocolor

3. Theme switch (covers color + emoji + progress style)

xmake g --theme=plain                       # no color, no emoji, no progress tricks

Use this on terminals that choke on either ANSI escapes or unicode (old Windows cmd, some pipes, some log collectors).

Revert:

xmake g --theme=default
# or
xmake g -c

See xmake-theme for the full theme list.

Choosing cprint / print / vprint

| Call | When to use | | --- | --- | | print(fmt, ...) | Plain informational messages | | cprint(fmt, ...) | Styled / colored output | | cprintf(fmt, ...) | Styled output without trailing newline | | printf(fmt, ...) | Plain output without trailing newline | | utils.vprint(fmt, ...) | Only print in -v verbose mode | | utils.cprint(fmt, ...) | Same as cprint but module-namespaced | | raise(fmt, ...) | Error — abort with a message (uses styling) |

Prefer cprint for user-facing info, vprint for debug traces that should hide under -v.

Pitfalls

  • cprint in description domain. Parsed multiple times — you'll see the message repeated. Move to on_load or a task hook.
  • Tags that stay "on". ${red} affects everything that follows on the same line. Always close with ${clear} if you only want part of the line colored.
  • Truecolor tags on an 8-color terminal. Xmake degrades cleanly to nearest-color on older terminals, but the result may look washed out — feature-detect with colors.truecolor().
  • Piping color into logs. cprint still emits ANSI when stdout is a pipe. Set XMAKE_COLORTERM=nocolor for log files, or use --theme=plain in CI.
  • Emoji on Windows. Legacy Windows cmd doesn't render them. Use plain theme there.
  • print has no format tags. Passing "${red}hello" to print just prints the literal ${red}. Must use cprint.

When to branch out

  • Picking a global theme / fixing garbled terminals → xmake-theme
  • All env vars incl. XMAKE_COLORTERMxmake-env-vars
  • Where scripts can call cprintxmake-scripting

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.