ncode

CLI docs Composer: send, steer, queue

ncode CLI Using ncode

Composer: send, steer, queue

The composer is the text field at the bottom of the session. It always has the keyboard: letters type, Enter sends, and only a leading / turns a line into a command.

Sending#

Type and press Enter. If the conversation is still loading, Enter keeps the message and sends it once the conversation has loaded (unless you changed the draft in the meantime).

  • A new line without sending: Ctrl+O, Ctrl+J or Shift+Enter. The last works in terminals that support the kitty keyboard protocol (kitty and Ghostty, for example); ncode asks the terminal when it starts and uses the other two keys when it gets no answer.
  • A bigger composer: Ctrl+↑ adds a row, Ctrl+↓ takes one back.
  • Your editor: Ctrl+X opens the draft in $VISUAL, else $EDITOR, else vi. Save and quit to bring the text back.
  • Earlier prompts: on an empty draft, ↑ and ↓ walk the prompts you sent in this conversation. Ctrl+R in the composer searches the prompts you sent in this project, across its conversations: type to narrow the list, ↑ and ↓ move, Enter puts the prompt into the draft (undo with Ctrl+Z), Esc closes. (Switch run stays on Ctrl+R everywhere else and in the Ctrl+P palette; Ctrl+G opens Runs from the composer.)
  • Editing: Ctrl+A and Ctrl+E jump to the start and end of the line, Ctrl+W deletes a word, Ctrl+U deletes to the start of the line, Ctrl+Z undoes. Option+← / → (and Ctrl+← / →, Alt+B / F) move by word.
  • Stash a draft: Stash draft and Restore stash in the Ctrl+P palette park the draft you are writing and bring it back, one stash per conversation.
  • Redraw: Ctrl+L redraws the screen if the terminal left it garbled.
  • Mode: Shift+Tab cycles Ask, Auto and Plan; see Approvals and trust.

Slash commands and file paths#

Typing / lists every command above the composer, and the list narrows as you type. Tab completes the highlighted command. Enter takes it too: a command that needs no argument runs at once (/com then Enter runs /compact); one that needs text waits for it after /<name>.

Tab also completes a file path after @, so you can point the assistant at a file by name: explain @lib/app/router.ex. A file whose name starts with what you typed comes first: @mi lists mix.exs before the files under priv/repo/migrations/.

After a command that takes a fixed set of values (/panel, /effort, /approval, /theme and more), the choices open under the composer as a list you can move through with Up and Down, complete with Tab and run with Enter; Esc closes just the list. The list opens on the value in force, marked with a muted ●. The command word is coloured while you type it, and an unknown /word is muted.

The full list is on Slash commands.

Running a shell command with !#

A draft that starts with ! runs a command instead of sending a message:

text
!git status --short

Enter runs it in the project folder, with the same scrubbed environment and timeout as an agent's command (120 seconds). Nothing asks for approval, because you typed it. The transcript shows a $ <command> row with running… while it works, then its exit status and the first 2 KB of the output; open the row in select mode for the rest. The next turn's model reads the command and its output, as [Shell command the user ran], and the desktop app shows the row as Shell.

  • One shell command runs per conversation; a second one says A shell command is still running · Esc stops it.
  • Esc stops a running command (it ends as [exit stopped]), and quitting stops it too.
  • A command that needs a terminal of its own (vim, less) gets no terminal and ends at once; run those in another window.
  • ! alone says Type a command after !. To send a message that really starts with ! to the model, send it with Ctrl+S.
  • It works in the full screen. In --plain and -p a leading ! is just text.

Large pastes#

A paste of more than 8 lines, or more than 4,096 bytes, does not fill the composer. It becomes one dim chip, [Pasted text #1 · 60 lines], and the text is put back in place when you send. Typing around a chip is normal, Backspace next to it removes the whole chip, and a chip you edit by hand is sent as you typed it. Pasting the same text twice makes two chips. Editing in your editor with Ctrl+X shows the full text. Change the line count with the terminal.paste_collapse_lines setting (0 to 200, default 8); 0 never collapses. A draft, chips expanded, can be at most 256 KiB.

While a turn runs#

Nothing is refused because work is running.

  • Steer. A message you send while this conversation's chat turn is working goes to that turn. The transcript marks it → to the running turn, and the running turn receives it.
  • Queue. Tab or Alt+Enter queues the draft instead: it waits under the live turn, marked queued, and is sent when the turn ends. /queue <text> does the same. Queued messages survive switching conversations, quitting and starting again. /queue alone lists them, numbered; /queue drop 2 removes the second and /queue clear removes all (to queue the word clear itself, type it and press Alt+Enter). If you stop a turn yourself, the queue pauses instead of starting the next message at once; press Enter on an empty draft to run it.
  • Start something beside it. /swarm, /plan <task>, /consensus, /create-workflow, a workflow or a goal start their own run at once, next to the running one.

/compact sent during a turn, and a message sent while the conversation is being compacted, wait their turn in the queue.

Running ncode chat turn with guidance marked to the running turn and a separate queued message that will send after the current turn finishes.

Attaching an image#

text
/attach docs/screenshot.png

stages an image file from inside the project for your next message; it is sent with that message.

To attach what is on the clipboard, such as a screenshot you copied, press Ctrl+V in the composer. The image appears as a chip, [Image #1 · 412 KB], and goes with the next message. At most 4 images fit in one message, each up to 6 MB. Text paste stays the terminal's own (⌘+V in most terminals). Image paste needs macOS, so over SSH it says to use /attach PATH; with no image on the clipboard it says The clipboard has no image.

Messages that name a workflow#

When a message talks about a workflow, the word is highlighted and Enter sends the message as /create-workflow <your text>, so the assistant writes a workflow for you (see Workflows). To send it as an ordinary message instead, press Ctrl+S. A word inside backticks is not highlighted.

Stopping and rewinding#

  • Esc stops the turn that is streaming, or the one you just sent. It first closes an open list or dialog. Your draft stays.
  • Ctrl+C closes an open layer, else clears your draft (Ctrl+Z brings it back), else stops the turn.
  • /stop stops everything running in this conversation.
  • Esc twice quickly (two presses within 0.6 seconds), with an empty draft and nothing streaming, opens the rewind list to go back to an earlier turn and edit it. /undo rewinds the last turn.