CommandCodeAI / CommandCodeAI/command-code

ModApi gap: mods cannot read or write the live input field (blocks ghost-text / prefill / Space-to-accept)

オープン
#658 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
言語のデータがありません
スター
4k
フォーク
350
PR マージ指標
30日以内にマージされた PR はありません

説明

ModApi gap: mods cannot read or write the live input field

Summary

The ModApi gives mods no way to read the current text in the input field or set/prefill it. transformInput only intercepts submitted text — it never sees what's being typed, and there's no cmd.ui.setInputText-style API. This blocks a whole class of UX (ghost-text suggestions, inline completion, input prefill) that pi-prompt-suggester and similar tools rely on.

Context

I built a prompt-suggester mod (https://github.com/burningportra/cmd-prompt-suggester) that aims to suggest the user's next prompt after each response — the pi-prompt-suggester UX. The core interaction I cannot implement:

  1. Show a suggestion as ghost text inside the input box — impossible; rendering is line-based only (cmd.ui.notify / cmd.ui.setStatus / cmd.ui.widget, and widget is explicitly "not wired into the TUI yet").
  2. Prefill the input field so the user can edit before sending — impossible; no input-write API.
  3. Press Space to accept the suggestion into the field — impossible; transformInput fires on submit, not on keystroke, so I can't fill the field or bind a key.
What I had to ship instead
  • Suggestion rendered as a 💡 next: notice (line-based).
  • Accept via /j slash command or typing 1 — because there's no way to inject text into the field.

This works, but it's a strict downgrade from pi's UX (ghost text + Space-to-accept), and it's the single most-requested feature for this kind of mod.

Proposed API (open to alternatives)
  • cmd.ui.getInputText(): string — read the current input field contents.
  • cmd.ui.setInputText(text: string): void — replace/prefill the input field.
  • Optionally a keybinding hook (hooks.onKeypress) so mods can respond to Space/Tab/arrows while typing.
Why it matters

The ModApi docs advertise "typed-input interception" as a first-class capability, but it only covers submitted input. Interactive suggestion/prefill is the natural next step, and it's what users expect from a "prompt suggester" mod.

Environment
  • Command Code 1.15.0, macOS
  • Docs read: commandcode.ai/docs/mods (ModApi reference, UI surface)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

commandcode.ai/docs/mods の ModApi リファレンスを起点にして、既存の cmd.ui.notify、cmd.ui.setStatus、cmd.ui.widget、transformInput の各サーフェスを調べる。入力の読み取りと書き込みの挙動を定義し、キー入力の処理が必要かどうかを判断する。完了条件は、mods が通知やスラッシュコマンドに依存せず、要求された prefill またはインタラクティブな提案ワークフローをサポートできること。

索引モデルが issue の本文から書いたものです。

評価

領域
api, cli, developer-experience
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。