All demosNatural Language Commands

Natural Language Commands

Tell the editor what to do. In your own words.

Examples are free. Bring a key for your own inputs. Get a free key

Performance & cost

This session

Ready to run
Delivery time · median
—
Live model compute
—
Live input tokens
0
Est. cost · USD
$0.00

Bypass examples to measure live inference. Uses your quota.

Measurement details · 0 successful requests
Successful requests
0

Run an example for free to see its measurements.

Model compute is the average per measured request. Delivery time is the median browser time for successful requests, including queue, network, and retries. Cached delivery speed is not inference speed. Model compute can exceed browser time when one request processes many inputs.

Tokens come from response headers. Inference costs use $0.04 per million input tokens, before plan credits. The estimate includes live and recorded tokens at the same rate; cached examples are not charged again. Missing usage is unavailable or a partial total (≥). Demo resets keep these totals; reload to start a new session.

Try it

Open the palette and describe a change.

Build with the SDKTypeScript · Python · dm1

One request from this demo. Copy it into your app.

Uses your MS_API_KEY and quota. Keep the key on your server.

Install · set your key
npm install @cloudraker/milliseconds
export MS_API_KEY="your-api-key"
example.ts
import { DecisionMachine } from "@cloudraker/milliseconds";

// Run on your server; reads MS_API_KEY from the environment.
const dm = new DecisionMachine();

const { result, usage } = await dm.classifyTree(
  "User typed in the command palette of a markdown notes editor: \"make the text bigger\"",
  {
    "view": {
      "description": "Show or hide one named panel or gutter of the editor: the sidebar or left panel, the outline of headings, the status bar, the minimap, the line numbers, the rendered markdown preview, or wrapping long lines that run off the right edge.",
      "labels": {
        "toggle_sidebar": "Toggle Sidebar: Show or hide the sidebar: the left-hand panel, the left thing, the file explorer with the note list.",
        "toggle_outline": "Toggle Outline Panel: Show or hide the document outline of headings on the right.",
        "toggle_status_bar": "Toggle Status Bar: Show or hide the thin status bar along the bottom with word count and cursor position.",
        "toggle_minimap": "Toggle Minimap: Show or hide the miniature overview of the document next to the scrollbar.",
        "toggle_line_numbers": "Toggle Line Numbers: Show or hide line numbers in the gutter.",
        "toggle_word_wrap": "Toggle Word Wrap: Turn soft wrapping on or off, so long lines stop running off the right edge and fold onto the next line instead.",
        "toggle_preview": "Toggle Markdown Preview: Show or hide the rendered Markdown preview pane inside the editor, next to the source."
      }
    },
    "window": {
      "description": "Change the window as a whole: zen or focus mode with no distractions, zooming the whole interface in or out when everything on screen is too big or too small, splitting the editor into two panes.",
      "labels": {
        "toggle_zen_mode": "Toggle Zen Mode: Zen mode on or off: strip the window down to the text alone. Only for focus, quiet or no distractions, never for hiding one named panel.",
        "zoom_in": "Zoom In: Zoom the whole interface in, so every panel and all text on screen gets larger together. Not the editor font size.",
        "zoom_out": "Zoom Out: Zoom the whole interface out because everything on screen is too big; every panel and all text gets smaller together. Not the editor font size.",
        "reset_zoom": "Reset Zoom: Return the interface zoom to 100%.",
        "split_editor": "Split Editor: Open a second editor pane side by side with the current one.",
        "close_split": "Close Split: Close the second pane and return to a single editor.",
        "toggle_fullscreen": "Toggle Full Screen: Full screen on or off: blow the editor up so it fills the whole browser window and covers the page around it, or put it back."
      }
    },
    "appearance": {
      "description": "Change how the text and the app look: the color theme (night, dark, light, paper, sepia, high contrast), the size of the editor text when it is too small, too big, hard to read or should be louder, the typeface, typewriter scrolling.",
      "labels": {
        "set_theme": "Change Color Theme: Switch the color theme: night or dark, day or light, warm paper-like sepia, or high contrast. Colors only, not sizes.",
        "change_font_size": "Change Font Size: Change the size of the editor text in points, when it is too small, too big, hard to read or should be louder. Size only, not colors.",
        "reset_font_size": "Reset Font Size: Return the editor font size to its default.",
        "cycle_font_family": "Cycle Font Family: Switch to the next typeface (monospace, serif, sans-serif).",
        "toggle_typewriter_mode": "Toggle Typewriter Scrolling: Keep the current line vertically centered while typing, or stop doing so.",
        "toggle_ligatures": "Toggle Font Ligatures: Turn programming ligatures on or off: whether pairs such as != and => are drawn joined into one glyph."
      }
    },
    "format": {
      "description": "Add or remove markdown markup on the current line or selection: make it a heading, a title or a subheading, bold, italic, strikethrough, inline code, a code block, a bullet, numbered or checkbox list, a quote, a link, an image, a table, a divider, insert today's date, strip formatting.",
      "labels": {
        "set_heading": "Set Heading Level: Turn the current line into a heading of a given level (H1 to H6).",
        "toggle_bold": "Toggle Bold: Make the selected text bold, or remove bold.",
        "toggle_italic": "Toggle Italic: Make the selected text italic, or remove italics.",
        "toggle_strikethrough": "Toggle Strikethrough: Strike through the selected text, or remove strikethrough.",
        "toggle_inline_code": "Toggle Inline Code: Wrap the selection in backticks as inline code, or unwrap it.",
        "insert_code_block": "Insert Code Block: Insert a fenced code block (triple backticks) at the cursor.",
        "toggle_bullet_list": "Toggle Bullet List: Turn the current lines into a bulleted (unordered) list, or back into plain text.",
        "toggle_numbered_list": "Toggle Numbered List: Turn the current lines into a numbered (ordered) list, or back into plain text.",
        "toggle_task_list": "Toggle Task List: Turn the current lines into checkbox to-do items, or back into plain text.",
        "toggle_blockquote": "Toggle Blockquote: Turn the current lines into a quoted block (prefixed with >), or remove the quote.",
        "insert_link": "Insert Link: Insert a Markdown hyperlink around the selection.",
        "insert_image": "Insert Image: Insert a Markdown image reference at the cursor.",
        "insert_table": "Insert Table: Insert an empty Markdown table at the cursor.",
        "insert_horizontal_rule": "Insert Horizontal Rule: Insert a horizontal divider line (---) at the cursor.",
        "insert_date": "Insert Current Date: Insert today's date at the cursor.",
        "clear_formatting": "Clear Formatting: Strip Markdown markup (bold, italic, code, headings) from the selection, leaving plain text."
      }
    },
    "text": {
      "description": "Rewrite words or whole lines that are already written: put them in capitals so they shout or are loud, in lower case or title case, sort them alphabetically, remove repeated lines, trim spaces, join, duplicate, move or delete a line.",
      "labels": {
        "uppercase_selection": "Transform to Uppercase: Convert the selected text to ALL CAPS, so that it shouts or is loud.",
        "lowercase_selection": "Transform to Lowercase: Convert the selected text to all lowercase letters.",
        "title_case_selection": "Transform to Title Case: Capitalize The First Letter Of Each Word in the selection.",
        "sort_lines": "Sort Lines Ascending: Sort the selected lines alphabetically.",
        "remove_duplicate_lines": "Remove Duplicate Lines: Delete repeated lines in the selection, keeping one copy of each.",
        "trim_trailing_whitespace": "Trim Trailing Whitespace: Remove spaces and tabs from the ends of all lines.",
        "join_lines": "Join Lines: Merge the selected lines into a single line.",
        "duplicate_line": "Duplicate Line: Copy the current line and insert the copy directly below it.",
        "delete_line": "Delete Line: Remove the current line entirely.",
        "move_line_up": "Move Line Up: Swap the current line with the line above it.",
        "move_line_down": "Move Line Down: Swap the current line with the line below it."
      }
    },
    "edit": {
      "description": "Undo the last change, redo it, or select the whole document.",
      "labels": {
        "undo": "Undo: Revert the most recent edit.",
        "redo": "Redo: Re-apply the edit that was just undone.",
        "select_all": "Select All: Select the entire document text."
      }
    },
    "find": {
      "description": "Search this note for some text, search and replace words, or jump to a line number.",
      "labels": {
        "find": "Find: Open the search box to look for text in the current note.",
        "find_replace": "Find and Replace: Open search with a replacement field to substitute text in the current note.",
        "go_to_line": "Go to Line: Jump the cursor to a specific line number."
      }
    },
    "file": {
      "description": "Act on the note as a file: start a new note, save it, export or download it to send as a PDF, a web page or plain text, rename it, delete or trash it, pin it to the top of the list.",
      "labels": {
        "new_note": "New Note: Create a fresh, empty note and open it in a new tab.",
        "save_note": "Save Note: Save the current note to disk.",
        "export_note": "Export Note: Export, save-as or download the current note as a file in another format (Markdown, an HTML web page, PDF or plain text) to share or open elsewhere.",
        "rename_note": "Rename Note: Change the title / file name of the current note.",
        "delete_note": "Delete Note: Permanently delete the current note from the workspace (destructive).",
        "toggle_pin_note": "Pin / Unpin Note: Pin the current note to the top of the sidebar list, or unpin it."
      }
    },
    "tabs": {
      "description": "Act on the open editor tabs: close this tab, close every other tab, reopen the last closed tab, go to the next or previous tab.",
      "labels": {
        "close_tab": "Close Tab: Close the current editor tab.",
        "close_other_tabs": "Close Other Tabs: Close every open tab except the current one.",
        "reopen_closed_tab": "Reopen Closed Tab: Restore the tab that was closed most recently.",
        "next_tab": "Next Tab: Switch to the tab to the right of the current one.",
        "previous_tab": "Previous Tab: Switch to the tab to the left of the current one."
      }
    },
    "tools": {
      "description": "The spelling checker, which is what puts the red squiggly underlines under misspelled words, and saving the note automatically. Turn either background helper off or on.",
      "labels": {
        "toggle_spell_check": "Toggle Spell Check: Stop or start the red squiggly underlines under misspelled words: the spelling checker.",
        "toggle_autosave": "Toggle Autosave: Turn automatic saving after each change on or off."
      }
    }
  }
).withUsage();

console.log(result);
console.log({ inputTokens: usage.inputTokens, modelMs: usage.inferenceMs });

Under the hood How it works & limitations

API calls/classify-tree/classify/rate/yes-no

How it works

The model matches your request to one of the editor’s supported commands. When needed, it selects an argument such as a theme or font-size change. Destructive commands require confirmation.

Demo scope

Only your command request is sent for interpretation, not the note contents. Uncertain matches require an explicit selection. Commands act on this demo editor and its sample notes.

Inspired by the work of dabit3.