CommandCodeAI / CommandCodeAI/command-code
ModApi gap: mods cannot read or write the live input field (blocks ghost-text / prefill / Space-to-accept)
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 4k
- Forks
- 350
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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:
- 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, andwidgetis explicitly "not wired into the TUI yet"). - Prefill the input field so the user can edit before sending — impossible; no input-write API.
- Press Space to accept the suggestion into the field — impossible;
transformInputfires 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
/jslash command or typing1— 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)
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece pela referência da ModApi em commandcode.ai/docs/mods e inspecione as superfícies existentes cmd.ui.notify, cmd.ui.setStatus, cmd.ui.widget e transformInput. Defina o comportamento de leitura e escrita da entrada e determine se o tratamento de pressionamentos de tecla é necessário; o trabalho estará concluído quando os mods puderem oferecer suporte ao workflow solicitado de preenchimento prévio ou de sugestão interativa sem depender de avisos ou comandos slash.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Domínio
- api, cli, developer-experience
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100