CommandCodeAI / CommandCodeAI/command-code

[ Feature Request ] Richer UI options in mods (ANSI support, spinners, layout helpers)

未关闭
#591 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
没有语言数据
星标
4k
派生
350
PR 合并指标
30 天内没有已合并 PR

描述

Summary

When building interactive mods, we are limited to displaying raw text strings inside "cmd.ui.select()" and "cmd.ui.notify()". Creating structured layouts or showing background progress currently requires custom ASCII drawing or raw terminal printing, which is complex to keep aligned and does not support native-looking animations like spinners.

Expected Behavior

We would love to see the Mod Harness UI (cmd.ui) enriched with standard CLI primitives:

  1. ANSI Color Support: Allow titles inside selectors to parse standard color codes (e.g. using chalk or ANSI codes) to highlight choices or display clean warnings.
  2. Native Spinners: A simple loading indicator API for long-running processes (e.g., repository checks, configuration setups):
    const spinner = cmd.ui.spinner("Loading configuration...");
    await task();
    spinner.success("Done!");
    
    

3.Layout Primitives: Simple helper functions to display dividers or panels without having to manually calculate character lengths and borders in strings.

Providing these primitives natively would allow developers to build premium, consistent community mods that look and feel like built-in features of Command Code.

Actual Behavior

Installing standard Node/Bun packages like ora or @clack/prompts, but they require direct TTY controls which the harness sandbox does not permit.

Steps to reproduce the issue
  1. create a mod
Command Code Version

1.4.2

Operating System

macOS

Terminal/IDE

ghostty

Shell

command

Additional context

No response

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 Mod Harness API cmd.ui.select() 和 cmd.ui.notify(),然后检查阻止 ora 和 @clack/prompts 控制 TTY 的 sandbox 约束。完成的标准是为 ANSI 标题、原生 spinner 以及通过 cmd.ui 暴露的 divider 或 panel helper 定义并测试出一种方案。

由索引模型根据 Issue 内容生成。

评估

技术栈
bun, node.js, typescript
领域
cli, developer-experience
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。