Built-in AI Assistant

Unlike other editors that require extensions, plugins, or external tools, Ultra ships with AI capabilities out of the box. Press Ctrl+Shift+A and start a conversation with your code.

Supported Providers

๐ŸŸฃ

Claude

Anthropic's Claude excels at understanding complex codebases, explaining intricate logic, and writing clean, well-documented code.

Default
๐ŸŸข

Codex

OpenAI's code-focused model. Great for code completion, refactoring suggestions, and translating between languages.

๐Ÿ”ต

Gemini

Google's multimodal AI. Excellent for reasoning about code architecture and understanding visual diagrams.

Context Awareness

Ultra's AI doesn't just see your current file โ€” it understands your entire project. The assistant automatically receives context about:

  • Current file and selection โ€” What you're actively working on
  • Open buffers โ€” Files you have open in tabs
  • Project structure โ€” Directory layout and file relationships
  • Git status โ€” Uncommitted changes and branch information
  • LSP diagnostics โ€” Errors, warnings, and type information

Session Persistence

AI conversations persist across Ultra sessions. Close the editor, reboot your machine, come back later โ€” your entire chat history is preserved. Pick up right where you left off.

~/.ultra/sessions/ai-chat.json
{
  "conversations": [
    {
      "id": "abc123",
      "timestamp": "2025-01-15T10:30:00Z",
      "messages": [...],
      "context": { "file": "src/index.ts", "selection": "..." }
    }
  ]
}

What Can AI Do?

From explaining code to executing terminal commands

๐Ÿ’ฌ

Explain Code

Select any code and ask "What does this do?" Get clear explanations of complex logic, algorithms, and patterns.

โœ๏ธ

Write Code

Describe what you need in plain English. The AI generates implementation complete with types and documentation.

๐Ÿ”ง

Refactor

Ask to improve code quality, extract functions, rename variables, or convert between patterns and paradigms.

๐Ÿ›

Debug

Share error messages and stack traces. The AI helps identify root causes and suggests fixes.

๐Ÿ“

Document

Generate JSDoc comments, README sections, API documentation, and inline explanations.

๐Ÿงช

Write Tests

Generate unit tests, integration tests, and edge case coverage for your functions and modules.

๐Ÿ’ป

Run Commands

The AI can execute terminal commands for you โ€” install packages, run builds, or check git status.

๐Ÿ”

Search Codebase

Ask where something is defined, find usages, or locate files. The AI searches your project intelligently.

Configuration

Configure AI behavior in ~/.ultra/settings.jsonc. Choose your provider, set API keys, and customize how the assistant interacts with your code.

Provider Settings

{
  // AI Provider: "claude" | "codex" | "gemini"
  "ai.provider": "claude",

  // Model selection (provider-specific)
  "ai.model": "claude-3-opus-20240229",

  // API endpoint (for custom/proxy setups)
  "ai.endpoint": null,

  // Maximum context tokens to send
  "ai.maxContextTokens": 100000,

  // Include open files in context
  "ai.includeOpenFiles": true,

  // Include project structure
  "ai.includeProjectTree": true,

  // Allow AI to run terminal commands
  "ai.allowCommands": true,

  // Require confirmation before running commands
  "ai.confirmCommands": true
}

API Keys

Store API keys securely via environment variables or Ultra's secret storage:

# Environment variables
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GOOGLE_AI_KEY="..."

# Or use Ultra's secure storage
ultra config set ai.apiKey "sk-ant-..."

Custom System Prompts

Add project-specific instructions that the AI receives with every message. Create .ultra/ai-prompt.md in your project root:

.ultra/ai-prompt.md
# Project Context

This is a TypeScript monorepo using:
- Bun as the runtime
- Hono for the API server
- React for the frontend
- Drizzle for database ORM

## Code Style
- Use functional components with hooks
- Prefer const over let
- Use explicit return types on functions
- Keep functions under 50 lines

Tips for Better Results

Get the most out of Ultra's AI assistant

1. Be Specific

Instead of "fix this", try "this function should return null instead of throwing when the input is empty".

2. Share Context

Select relevant code before asking. The AI works better when it can see exactly what you're working on.

3. Ask Follow-ups

Conversations maintain context. Ask "can you also add error handling?" or "make it more concise".

4. Use Commands

Let the AI run commands for you. "Install lodash and update the imports" saves time and reduces errors.

5. Review Generated Code

AI-generated code is a starting point. Always review, test, and understand what gets added to your codebase.

6. Project Prompts

Add a .ultra/ai-prompt.md file with project conventions. The AI will follow your team's coding standards.

Ready to code with AI?

Install Ultra and experience AI-assisted development in your terminal.

curl -fsSL https://ultra.dev/install.sh | bash