/xmake-skills:xmake-color-outputfrom xmake-skills
Emits colored/styled terminal output from xmake.lua using cprint/cprintf with inline color tags, truecolor, emoji, and color-disabling knobs.
Ships in xmake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
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.
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 ${...}.
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}?")
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
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.
Three knobs, from least to most invasive:
XMAKE_COLORTERM=nocolor xmake
Other values: color8, color256, truecolor. nocolor strips all ANSI codes.
export XMAKE_COLORTERM=nocolor # shell session
Or in CI:
env:
XMAKE_COLORTERM: nocolor
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.
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.
cprint in description domain. Parsed multiple times — you'll see the message repeated. Move to on_load or a task hook.${red} affects everything that follows on the same line. Always close with ${clear} if you only want part of the line colored.colors.truecolor().cprint still emits ANSI when stdout is a pipe. Set XMAKE_COLORTERM=nocolor for log files, or use --theme=plain in CI.plain theme there.print has no format tags. Passing "${red}hello" to print just prints the literal ${red}. Must use cprint.xmake-themeXMAKE_COLORTERM → xmake-env-varscprint → xmake-scriptingWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
58 skills in this plugin
/xmake-addon-developmentUse when writing an Xmake addon — the `addon.lua` manifest, the payload layout (plugins/rules/toolchains/modules/includes/templates), `@self` references, shipping package definitions with an addon, `add_globalmodules`, testing it locally, and publishing it to xmake-repo as an `addon` kind package./xmake-addonsUse when installing or using an Xmake addon — `xmake addon --install/--list/--remove/--upgrade/--search`, declaring `add_addons(...)` in a project, and referencing addon payloads with `@addon/<name>/<rule>`, `@addon.<name>.<module>` or `@self`. For writing and publishing one, see xmake-addon-development./xmake-async-jobsUse when running parallel / async work inside xmake scripts — `async.runjobs` for parallel job execution, `async.jobgraph` (DAG) for dependency-ordered jobs, `async.jobpool` (tree structure), `core.base.scheduler` coroutine scheduling, semaphores, and `on_build_files(..., {jobgraph = true})` in rules. For running external compile jobs faster, see `xmake-build-optimization`./xmake-basicsUse when the user is starting a new Xmake project, installing Xmake, or needs the minimal xmake.lua structure. Covers installation, `xmake create`, the project layout, and the smallest valid xmake.lua./xmake-build-cacheUse when configuring or debugging xmake's local build cache (built-in, replaces ccache) or the remote compile cache service (shared across machines via `xmake service --ccache`). Covers enabling/disabling, fallbacks to external ccache, remote cache server/client setup, and cache cleaning./xmake-build-optimizationUse when a project builds slowly and you want to make it faster — parallel jobs, unity build, precompiled headers, build cache, LTO, link-time improvements, binary package cache, and profiling with `XMAKE_PROFILE=perf:*`. Covers idiomatic xmake speedups and the order to try them.npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skillsOther plugins' skills for the same job