Mojo UpDocs
AI Workbench

Ask AI where you write

How to ask AI to write or change code and text right where you are writing, in the built-in editor and the Library — what to ask, accepting or rejecting a change, the one-click actions, suggestions as you type, which model answers, and how it is governed and counted.

In the built-in editor and in a Library document, you can ask AI to write something new or to change what you selected, without leaving the page. Nothing in your file changes until you accept what it proposes.

The editor and the Library's source open with the same guidance as this page (Ask AI where you write). It is also listed in Settings → Help, under Guides.

Asking

Put the cursor where you want something written, or select the text you want changed, then:

  • press Ctrl+K (⌘K on a Mac);
  • or press the Ask AI button in the editor's toolbar, or in the Library document's header;
  • or right-click and choose Ask AI….

A small box opens at the cursor, or over the selection, and the lines below move down to make room for it. Say what you want in your own words and press Enter. The answer is written in as you watch.

On an empty line the editor shows Ctrl+K to ask AI in grey, as a reminder. Elsewhere in the app, Ctrl+K opens Search Everything; in the editor and the Library's source it asks AI instead.

What to ask

In code, ask for something new where the cursor is, or select code and ask for a change:

  • "Create a function that parses ISO dates"
  • "Make this async"
  • "Fix this"
  • "Add tests for this"
  • "Add error handling"

In writing (Markdown and plain text), ask for a draft, or select a passage and say how to change it:

  • "Draft a paragraph about our release process"
  • "Make this shorter"
  • "Make it friendlier"
  • "Turn it into a list"

An empty box shows a few suggestions to start from. In a document, Continue writing carries on from the cursor, and with the cursor on a heading, Write this section drafts what goes under it.

Accept, reject or try again

What comes back is a proposed change:

  • the lines it adds are shown in green, each marked with a +, beneath the text it changes;
  • the lines it removes are shown in red and struck through, where they stand.

Nothing is written until you accept it.

Keys or buttonWhat it does
Enter or Tab, or AcceptPuts the change into your file.
Esc, or RejectDrops it; your file is as it was.
Try againAsks the same thing afresh.
Type a follow-up and press EnterChanges the answer before you take it, such as "make it shorter" or "use a for loop".
StopEnds an answer that is still being written; what arrived so far stays proposed.

An accepted change is one edit: Undo (Ctrl+Z) takes it back. It is not saved until you save the file (Ctrl+S in the editor, Save in the Library).

One-click actions on a selection

Select some text and a few actions appear just above it, beside Ask AI:

In codeIn writing
Explain: says what the selection does, in the box; nothing is written.Improve the writing: clearer and better flowing, the same meaning.
Fix: fixes the bugs in it.Shorter: the same in fewer words.
Add comments: comments and doc comments, the code unchanged.Fix grammar: spelling and grammar, nothing else.

Each one asks at once and shows its answer as a proposed change, except Explain, which answers in the box. You can ask a follow-up question there too.

Suggestions as you type

Separately from asking, the editor can suggest the rest of a line as you type code. Pause, and a suggestion appears in grey where you are: Tab takes it and Esc dismisses it.

The chip in the editor's toolbar says what makes the suggestions, or why nothing can, and opens the place to change it. Suggestions as you type in Settings → Repositories & editors chooses whether they come only from a model on this computer (the default, which never costs anything), also from your chat model, or not at all.

Which model answers

Ask AI in Settings → Repositories & editors chooses who answers:

  • My chat model (the default): your chat model from Settings → Models, else your default model, else a model running on this computer. The first one your organisation allows answers.
  • Only this computer: only a model served on this computer, by the bundled local model, Ollama or LM Studio. Nothing you ask leaves this computer.
  • Off: no Ask AI in the editor or the Library.

The box says which model answered. When nothing can answer, it says why in one sentence, with a button that opens the place to fix it: Local models to start a chat model there, or Settings → Models to choose one.

What it is told

Each ask sends only what the answer needs:

  • the file's name and kind (its language, or that it is a document);
  • the text just before and after the cursor, or around the selection, and the selection itself;
  • in a document, its title and headings;
  • the beginning of the repository's instructions for agents (AGENTS.md, or CLAUDE.md).

It never sends the whole file when the file is long, and never the rest of the repository.

Your organisation's rules

Asking AI follows the same rules as a chat:

  • Which providers and models the workspace policy allows, and the project's classification. A model it does not allow is not asked; the next one you have is, or you are told why none can.
  • Data protection. What you send is checked first, as a chat message is: secrets and personal data are removed or the ask is stopped, according to the policy, and you are told when that happens.
  • Budgets. A daily budget that has been reached stops the ask, with the reason.

See Policies.

Usage and records

What each ask costs is counted in Usage, under Editor, beside your agents and chats. A model on this computer costs nothing.

Each change you accept is recorded in the workbench's audit trail: who accepted it, the file, whether it was an insertion or a change, and how long your request was. The words you asked and the text written are not recorded.

On this page