Skip to content

dwgx/SmartCLI / skills/cmd-art

cmd-art

Verified

Design and render terminal/CMD visual effects and ASCII art from a one-line request via the pluggable `fx` engine (30 effects, hot-swappable and themeable, plus scripted shows). Effects include donut, matrix rain, plasma, fire, a spinning 3D ball, a solar-system orrery, Game of Life, wireframe cube, 3D text banners, rainbow/lolcat gradient text, starfield, tunnel, fireworks, image-to-ASCII, and more. Use when the request is for a terminal animation, ANSI/CLI art, or a new console effect. Pure Python stdlib; truecolor.

fx/effects/flames.py

View on GitHub
"""Flames — noise-convection fire (knowledge -> effect).

A different fire from the cellular `fire` effect: this treats flame as rising
heat convection. A domain-warped fBm temperature field scrolls upward, is damped
by a vertical gradient (cooler toward the top), swayed by a small horizontal
wobble, and colored through the physical black-body ramp. See _noiselib.

Pure frame producer: (t, w, h) -> one frame string. No I/O, no ANSI modes.
"""
from __future__ import annotations

import math

from ..core import RESET, rgb
from ..base import Effect, FrameCtx, Param
from ..registry import register
from .._noiselib import domain_warp, black_body


def _flames_frame(t, width, height, speed, theme, use_theme):
    lines = []
    for row in range(height):
        # vertical position 0 (top) .. 1 (bottom); heat rises so bottom is hot.
        vy = row / max(1, height - 1)
        damp = vy * vy               # strong falloff toward the top -> flame tips
        out = []
        last = None
        for col in range(width):
            nx = col * 0.08 + 0.3 * math.sin(t * 1.3 + vy * 3.0)  # wobble/sway
            ny = vy * 1.6 - t * speed * 0.9                       # scroll upward
            f, _q, _r = domain_warp(nx, ny, t * 0.15)
            base = (f + 1.0) * 0.5
            base = 0.0 if base < 0 else (1.0 if base > 1 else base)  # warp overshoot
            temp = base * damp                                   # [0,1] × falloff
            if temp < 0.14:
                c = (0, 0, 0)                                    # below flame -> dark
            elif use_theme and theme is not None:
                c = theme.color_at(min(1.0, temp * 1.3))
            else:
                c = black_body(1200 + temp * 5200)               # physical fire ramp
            if c != last:
                out.append(rgb(*c, bg=True))
                last = c
            out.append(" ")
        lines.append("".join(out) + RESET)
    return "\n".join(lines)


@register
class Flames(Effect):
    name = "flames"
    aliases = ("firefield", "bonfire")
    description = "Noise-convection fire: rising domain-warped heat, black-body color."
    tags = ("field", "fire", "noise")
    preferred_theme = "fire"
    default_fps = 24.0
    params = (
        Param("speed", "float", 1.0, "how fast the flame rises", min=0.1, max=4.0),
        Param("palette", "str", "blackbody", "color source",
              choices=("blackbody", "theme")),
    )

    def render(self, ctx: FrameCtx) -> str:
        return _flames_frame(ctx.t, ctx.width, ctx.height, ctx.params["speed"],
                             ctx.theme, ctx.params["palette"] == "theme")
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall