Skip to main content

Overview

Text Transformations are single-shot AI actions that instantly modify your selected text. From fixing grammar to changing tone to writing complete emails, each action is optimized for a specific use case.
All transformations work system-wide across any application - code editors, browsers, messaging apps, and more.

Built-in Actions

Grammar & Spelling

Fix Grammar (Alt+F)

Corrects all grammar, spelling, and punctuation errors while maintaining the original tone and style.
{
  id: "fix-grammar",
  label: "Fix Grammar",
  icon: "✍️",
  shortcut: "F",
  prompt: `You are a grammar and spelling expert.
    Fix all grammar, spelling, and punctuation errors in the text.
    Maintain the original tone and style.
    Return ONLY the corrected text, no explanations.`
}
Use cases:
  • Proofreading emails before sending
  • Cleaning up quick messages
  • Polishing documentation
Example:
their going too the store tomorrow and there bringing there friends

Length Adjustments

Shorten Text (Alt+S)

Condenses text while preserving all key information. Removes redundancy and filler words.
{
  id: "shorten",
  label: "Shorten Text",
  icon: "✂️",
  shortcut: "S",
  prompt: `You are a concise writing expert.
    Condense the text while preserving all key information.
    Remove redundancy and filler words.
    Return ONLY the shortened text, no explanations.`
}
Example:
I wanted to reach out and touch base with you regarding the meeting
that we had scheduled for next week. I was thinking that it might be
a good idea if we could possibly reschedule it to a different time
that works better for both of us, as I have a conflict with another
commitment that came up unexpectedly.

Make Longer (Alt+E)

Expands text with relevant details, examples, and context while maintaining the original tone.
{
  id: "expand",
  label: "Make Longer",
  icon: "📝",
  shortcut: "E",
  prompt: `You are a content writer.
    Expand the text with relevant details, examples, and context.
    Maintain the original tone and message.
    Return ONLY the expanded text, no explanations.`
}
Example:
The AI keyboard helps with coding interviews by providing real-time assistance.

Tone Adjustments

Professional Tone (Alt+P)

Rewrites text in a formal, professional tone suitable for business communications.
{
  id: "professional-tone",
  label: "Professional Tone",
  icon: "💼",
  shortcut: "P",
  prompt: `You are a business writing expert.
    Rewrite the text in a formal, professional tone.
    Suitable for business emails and documents.
    Return ONLY the rewritten text, no explanations.`
}
Example:
Hey! Just wanted to let you know the project's gonna be late.
Had some issues with the code.

Casual Tone (Alt+C)

Rewrites text in a relaxed, informal tone for friendly conversations.
{
  id: "casual-tone",
  label: "Casual Tone",
  icon: "😊",
  shortcut: "C",
  prompt: `You are a casual writing expert.
    Rewrite the text in a relaxed, informal tone.
    Keep it friendly and conversational.
    Return ONLY the rewritten text, no explanations.`
}
Example:
I would like to formally request your assistance with reviewing
the documentation before the deadline.

Friendly Tone (Alt+Y)

Adds warmth and approachability while keeping the message clear.
{
  id: "friendly-tone",
  label: "Friendly Tone",
  icon: "🤝",
  shortcut: "Y",
  prompt: `You are a warm communication expert.
    Rewrite the text in a friendly, approachable tone.
    Add warmth while keeping the message clear.
    Return ONLY the rewritten text, no explanations.`
}

Email Writing

Write Email (Alt+M)

Transforms bullet points or rough notes into a well-structured email with greeting and sign-off.
{
  id: "email-writer",
  label: "Write Email",
  icon: "📧",
  shortcut: "M",
  prompt: `You are an email writing expert.
    Transform the text into a well-structured email.
    Add appropriate greeting and sign-off.
    Format professionally.
    Return ONLY the email text, no explanations.`
}
Example:
- Need to reschedule meeting
- Conflict on Tuesday
- Prefer Wednesday or Thursday
- Morning works best

Custom Prompts

Custom Prompt (Alt+K)

Define your own transformation with a custom instruction. How to use:
  1. Select text and press Ctrl+\
  2. Choose Custom Prompt or press Alt+K
  3. Enter your instruction (e.g., “Make this sound more confident”)
  4. Press Enter to apply
Example custom prompts:
  • “Translate to Spanish”
  • “Add more technical details”
  • “Make this suitable for a LinkedIn post”
  • “Convert to bullet points”
  • “Explain like I’m five”
Your custom prompts are saved locally and can be reused. Great for repetitive transformations!

How Actions Work

All actions follow the same pipeline:
1

Select Text

Highlight the text you want to transform in any application.
2

Open Action Menu

Press Ctrl+\ to open the Action Menu or use a direct shortcut like Alt+F.
3

AI Processing

The selected text is sent to the completion API with the action’s prompt.
4

View Result

The transformed text appears in the Result Panel with options to copy or paste.
5

Apply

Press Enter to paste the result back, replacing your original selection.

Action Execution Flow

const handleActionSelect = useCallback(
  async (action: Action) => {
    // Set the current action
    setCurrentAction(action);
    setMessages([]);

    // Get the action's prompt
    const prompt = getActionPrompt(action);
    
    // Send to completion API
    sendMessage(
      {
        parts: [{ type: "text", text: selectedText }]
      },
      {
        body: {
          action: action.id as ActionType,
          customPrompt: prompt
        },
      }
    );
  },
  [sendMessage, selectedText, setMessages]
);
The completion API processes the request:
export async function POST(req: Request) {
  const { messages, action, customPrompt, userId } = await req.json();

  // Use custom prompt if provided, otherwise use system prompt
  const systemPrompt = customPrompt
    ? `${customPrompt}\n\n${getSystemPrompt(userId)}`
    : getSystemPrompt(userId);

  // Stream the transformation
  const result = streamText({
    model: myProvider.languageModel(defaultModel),
    system: systemPrompt,
    messages: modelMessages,
    tools: {
      tavilySearchTool,      // Web search if needed
      addMemory,             // Store user preferences
      searchMemory,          // Retrieve context
    },
  });

  return new Response(result.toUIMessageStream());
}

Memory Integration

All transformations can leverage the memory system:
  • Search memory before transformation for personalized output
  • Store preferences when user accepts/rejects suggestions
  • Learn writing style from user’s edits and corrections
The more you use transformations, the more they adapt to your style. The AI learns your preferences for tone, length, and formatting.

Creating Custom Actions

You can define your own reusable actions in the settings:
  1. Open Settings from the Action Menu toolbar
  2. Go to the Actions tab
  3. Click Add Action
  4. Define:
    • Label - Display name
    • Icon - Emoji or icon
    • Shortcut - Single key (e.g., “Q”)
    • Prompt - Transformation instruction
    • Group - “action” or “agent”
Example custom action:
{
  "id": "code-review",
  "label": "Review Code",
  "icon": "🔍",
  "shortcut": "R",
  "prompt": "You are a code review expert. Analyze the code for bugs, performance issues, and best practices. Provide specific, actionable feedback. Return ONLY the review, no explanations.",
  "group": "action"
}
Keyboard shortcuts must be unique. The system will warn you if a shortcut is already in use.

Action Management

Actions are stored locally and persist across sessions:
// Load actions from localStorage
export function loadActions(): Action[] {
  const saved = localStorage.getItem(STORAGE_KEY);
  if (saved) {
    const parsed: Action[] = JSON.parse(saved);
    // Merge with any new default actions
    return [...parsed, ...missingDefaults];
  }
  return getDefaultActions();
}

// Save custom actions
export function saveActions(actions: Action[]): void {
  localStorage.setItem(STORAGE_KEY, JSON.stringify(actions));
}

// Reset to defaults
export function resetToDefaults(): Action[] {
  const defaults = getDefaultActions();
  saveActions(defaults);
  return defaults;
}

Best Practices

More specific prompts yield better results. Instead of “improve this”, try “make this more concise while maintaining technical accuracy”.
Memorize shortcuts for your most-used actions (e.g., Alt+F for grammar). This saves time over opening the menu.
Chain transformations: first shorten text with Alt+S, then make it professional with Alt+P.
The memory system learns from your edits. If you modify the AI’s output, it will adapt future suggestions.

Keyboard Shortcuts Reference

ShortcutActionDescription
Alt+FFix GrammarCorrect spelling and grammar
Alt+SShorten TextCondense while keeping key info
Alt+EMake LongerExpand with details and examples
Alt+PProfessional ToneFormal business writing
Alt+CCasual ToneRelaxed, informal style
Alt+YFriendly ToneWarm and approachable
Alt+MWrite EmailTransform to structured email
Alt+KCustom PromptDefine your own transformation
Alt+HChat ModeFree-form AI conversation
Alt+IInterview CopilotCoding interview assistant
Alt+TText AgentQuick text tools
Alt+VVoice AgentVoice conversation

See Also

Build docs developers (and LLMs) love