Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Terminal AI Agents Workflow

The best way to work with AI tools in your development workflow is by adopting a hybrid strategy: use editor plugins for rapid, in-buffer tasks (like completion and single-file edits) and CLI agents for agentic, multi-file refactoring that leverages the power and stability of the terminal.

This guide covers the general philosophy and workflow patterns. For setup instructions and tool-specific guides, see the cross-references below.

1. Our Tool Stack

CategoryToolsCore FunctionBest For
Vim Pluginvim-ollamaIn-buffer completion, chat, single-file edits.Lowest latency, inline code completion, quick refactoring.
CLI AgentAider, Qwen Code, Claude CodeMulti-file refactoring & committing. Reads Git context and makes atomic changes.Complex refactors, generating new files, fixing tests across the codebase.

2. General Workflow Patterns

Pattern 1: In-Editor Quick Edit (Vim Plugin)

  1. Select Code: Use V or v to select the code block to refactor.

  2. Ask Plugin: Trigger the plugin’s edit/chat command.

  3. Prompt: Type your instruction (e.g., “Rewrite using list comprehension”).

  4. Diff Review: The plugin shows proposed changes. Accept or reject line-by-line.

This pattern is the lowest-latency way to do single-file edits. It works in Vim with vim-ollama or any editor with an AI plugin.

Pattern 2: Multi-File Feature Implementation (CLI Agent)

  1. Open Terminal: Use a terminal session (standalone or split in your editor).

  2. Start Agent: Launch your CLI agent (e.g., aider --model ollama_chat/qwen2.5-coder:14B).

  3. Add Files: Tell the agent what to work on (e.g., /add main.py utils.py tests/test_utils.py).

  4. Prompt: Give a high-level instruction spanning multiple files.

  5. Reload & Review: The agent modifies files on disk. Your editor detects changes and prompts you to reload buffers. Review the diff.

This pattern applies to Aider, Qwen Code, Claude Code, and similar CLI-based agents.

Pattern 3: Hybrid Mode (Cloud + Local)

For large-context planning tasks, use a capable cloud LLM (Gemini, Grok) via API as the architect model, while a local SLM handles execution:

  • Architect mode: Cloud LLM for high-level planning and design

  • Editor model: Local SLM for coding, testing, and fixing

3. Tool-Specific Guides