CommandCodeAI / CommandCodeAI/command-code

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

Open
#658 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ModApi reference at commandcode.ai/docs/mods and inspect the existing cmd.ui.notify, cmd.ui.setStatus, cmd.ui.widget, and transformInput surfaces. Define the input-reading and input-writing behavior, and determine whether keypress handling is needed; done means mods can support the requested prefill or interactive suggestion workflow without relying on notices or slash commands.

Written by the indexing model from the issue text.

Assessment

Domain
api, cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.