Skip to main content

tui-applications

Patterns for controlling TUI applications (vim, htop, tig, lazygit, etc.) via terminalcp

Source facts

Repository
code-yeongyu/sisyphus-private
Last source activity
November 2, 2025 at 08:33
Detected SKILL.md language
English
Stars
17
Forks
2

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
tui-applications
description
Patterns for controlling TUI applications (vim, htop, tig, lazygit, etc.) via terminalcp
# TUI Applications Control with terminalcp This skill provides comprehensive patterns for automating Text User Interface (TUI) applications using terminalcp MCP. It enables AI agents to control interactive terminal applications with full visual feedback. ## Overview terminalcp enables: - Full PTY terminal emulation for TUI apps - ANSI color and cursor positioning preservation - Complex key sequence automation - Screen content capture and parsing - Multi-TUI session management The MCP server runs via `npx @mariozechner/terminalcp@latest --mcp` and provides complete terminal rendering. ## Vim/Neovim Automation ### Starting Vim/Neovim ```json // Open file in vim { "action": "start", "command": "vim myfile.txt", "name": "vim-session" } // Open file in neovim { "action": "start", "command": "nvim myfile.txt", "name": "nvim-session" } // Start vim without file { "action": "start", "command": "vim", "name": "vim-session" } ``` ### Vim Mode Navigation ```json // Enter insert mode { "action": "stdin", "id": "vim-session", "data": "i" } // Type text { "action": "stdin", "id": "vim-session", "data": "Hello, World!" } // Exit insert mode (Escape) { "action": "stdin", "id": "vim-session", "data": "\u001b" } // Move cursor (in normal mode) { "action": "stdin", "id": "vim-session", "data": "h" // left } { "action": "stdin", "id": "vim-session", "data": "j" // down } { "action": "stdin", "id": "vim-session", "data": "k" // up } { "action": "stdin", "id": "vim-session", "data": "l" // right } ``` Note: `\u001b` is the Escape key in MCP notation. ### Vim Editing Commands ```json // Delete line { "action": "stdin", "id": "vim-session", "data": "dd" } // Undo { "action": "stdin", "id": "vim-session", "data": "u" } // Redo { "action": "stdin", "id": "vim-session", "data": "\u0012" // Ctrl+R } // Copy line (yank) { "action": "stdin", "id": "vim-session", "data": "yy" } // Paste { "action": "stdin", "id": "vim-session", "data": "p" } // Find and replace { "action": "stdin", "id": "vim-session", "data": ":%s/old/new/g\r" } ``` ### Vim File Operations ```json // Save file { "action": "stdin", "id": "vim-session", "data": ":w\r" } // Save and quit { "action": "stdin", "id": "vim-session", "data": ":wq\r" } // Quit without saving { "action": "stdin", "id": "vim-session", "data": ":q!\r" } // Open another file { "action": "stdin", "id": "vim-session", "data": ":e another_file.txt\r" } // Save as { "action": "stdin", "id": "vim-session", "data": ":saveas newfile.txt\r" } ``` ### Vim Search and Navigation ```json // Search forward { "action": "stdin", "id": "vim-session", "data": "/search_term\r" } // Search backward { "action": "stdin", "id": "vim-session", "data": "?search_term\r" } // Next search result { "action": "stdin", "id": "vim-session", "data": "n" } // Previous search result { "action": "stdin", "id": "vim-session", "data": "N" } // Go to line { "action": "stdin", "id": "vim-session", "data": ":42\r" } // Go to end of file { "action": "stdin", "id": "vim-session", "data": "G" } // Go to beginning of file { "action": "stdin", "id": "vim-session", "data": "gg" } ``` ### Vim Visual Mode ```json // Enter visual mode { "action": "stdin", "id": "vim-session", "data": "v" } // Select text (move cursor while in visual mode) { "action": "stdin", "id": "vim-session", "data": "jjj" // Select 3 lines down } // Copy selection { "action": "stdin", "id": "vim-session", "data": "y" } // Exit visual mode { "action": "stdin", "id": "vim-session", "data": "\u001b" } ``` ### Capturing Vim Screen ```json { "action": "stdout", "id": "vim-session" } ``` This returns the full terminal rendering including vim's UI, status line, and content. ## System Monitoring TUIs ### htop ```json // Start htop { "action": "start", "command": "htop", "name": "htop-session" } // Navigate processes { "action": "stdin", "id": "htop-session", "data": "\u001b[B" // Down arrow } { "action": "stdin", "id": "htop-session", "data": "\u001b[A" // Up arrow } // Sort by CPU { "action": "stdin", "id": "htop-session", "data": "P" } // Sort by memory { "action": "stdin", "id": "htop-session", "data": "M" } // Filter processes { "action": "stdin", "id": "htop-session", "data": "F4" } { "action": "stdin", "id": "htop-session", "data": "python\r" } // Kill process { "action": "stdin", "id": "htop-session", "data": "F9" } // Capture current state { "action": "stdout", "id": "htop-session" } // Quit { "action": "stdin", "id": "htop-session", "data": "q" } ``` ### btop ```json // Start btop { "action": "start", "command": "btop", "name": "btop-session" } // Toggle menu { "action": "stdin", "id": "btop-session", "data": "m" } // Switch views { "action": "stdin", "id": "btop-session", "data": "1" // CPU view } { "action": "stdin", "id": "btop-session", "data": "2" // Memory view } { "action": "stdin", "id": "btop-session", "data": "3" // Network view } // Capture state { "action": "stdout", "id": "btop-session" } ``` ## Git TUIs ### tig ```json // Start tig (git commit history viewer) { "action": "start", "command": "tig", "name": "tig-session" } // Navigate commits { "action": "stdin", "id": "tig-session", "data": "j" // Next commit } { "action": "stdin", "id": "tig-session", "data": "k" // Previous commit } // View commit details { "action": "stdin", "id": "tig-session", "data": "\r" // Enter to view diff } // Search { "action": "stdin", "id": "tig-session", "data": "/search_term\r" } // View specific branch { "action": "stdin", "id": "tig-session", "data": ":toggle refs\r" } // Capture view { "action": "stdout", "id": "tig-session" } // Quit { "action": "stdin", "id": "tig-session", "data": "q" } ``` ### lazygit ```json // Start lazygit { "action": "start", "command": "lazygit", "name": "lazygit-session" } // Navigate panels { "action": "stdin", "id": "lazygit-session", "data": "1" // Files panel } { "action": "stdin", "id": "lazygit-session", "data": "2" // Branches panel } { "action": "stdin", "id": "lazygit-session", "data": "3" // Commits panel
View on GitHub
This SKILL.md is very large, so SkillsMP previews the first section here. View on GitHub