### Install Hook and Start Daemon Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/agent_baseline/help.txt Quick start example to install the RCH hook and start the local RCH daemon. ```bash rch hook install && rch daemon start ``` -------------------------------- ### Initialize setup Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/README.md Run the interactive initialization command to configure workers and start the daemon. ```bash rch init ``` -------------------------------- ### Install and Run Soft Serve Git Server Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Installs Soft Serve via Homebrew and starts the Git server. Access and clone repositories using SSH. ```bash # Install brew install soft-serve # Start soft serve # Access ssh localhost -p 23231 git clone ssh://localhost:23231/repo ``` -------------------------------- ### 5-Minute TUI Example Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/go-tui.md A basic interactive list for selecting an item. Requires Bubble Tea and Lip Gloss libraries. Run with `go mod init example && go get github.com/charmbracelet/bubbletea github.com/charmbracelet/lipgloss && go run .` ```go package main import ( "fmt" "os" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" ) var ( selected = lipgloss.NewStyle().Foreground(lipgloss.Color("212")).Bold(true) normal = lipgloss.NewStyle().Foreground(lipgloss.Color("252")) title = lipgloss.NewStyle().Bold(true).Padding(0, 1).Background(lipgloss.Color("62")) ) type model struct { items []string cursor int } func (m model) Init() tea.Cmd { return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: switch msg.String() { case "q", "ctrl+c": return m, tea.Quit case "up", "k": if m.cursor > 0 { m.cursor-- } case "down", "j": if m.cursor < len(m.items)-1 { m.cursor++ } case "enter": fmt.Printf("\nYou chose: %s\n", m.items[m.cursor]) return m, tea.Quit } } return m, nil } func (m model) View() string { s := title.Render("Select an item") + "\n\n" for i, item := range m.items { cursor := " " style := normal if m.cursor == i { cursor = "▸ " style = selected } s += cursor + style.Render(item) + "\n" } s += "\n" + normal.Render("↑/↓: move • enter: select • q: quit") return s } func main() { m := model{items: []string{"Option A", "Option B", "Option C"}} if _, err := tea.NewProgram(m).Run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } ``` -------------------------------- ### Run Development Server Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/web/README.md Use these commands to start the Next.js development server. Ensure you have Node.js and a package manager (npm, yarn, pnpm, or bun) installed. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Install via Scoop Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Installs the tool on Windows using the Scoop package manager. First, add the necessary bucket, then install the tool. ```bash scoop bucket add user https://github.com/user/scoop-bucket ``` ```bash scoop install tool ``` -------------------------------- ### Install x/term Package Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Install the x/term package for terminal detection capabilities. Use the provided go get command. ```bash go get github.com/charmbracelet/x/term@latest ``` -------------------------------- ### Quick Example Section Template Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md A template for the Quick Example section in a README.md, demonstrating core workflow with a series of commands. ```markdown ### Quick Example ```bash # Initialize (one-time setup) $ tool init # Core operation $ tool do-thing --flag value # See results $ tool show results # The killer feature $ tool magic --auto ``` ``` -------------------------------- ### Installation Section Template Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Template for the Installation section of a README.md, providing quick install via curl and options for further customization. ```markdown ## Installation ### Quick Install (Recommended) ```bash curl -fsSL https://raw.githubusercontent.com/user/repo/main/install.sh | bash ``` **With options:** ```bash # Auto-update PATH curl -fsSL https://... | bash -s -- --easy-mode ``` -------------------------------- ### Install teatest Package Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Install the teatest package for Bubble Tea TUI testing. Use the provided go get command. ```bash go get github.com/charmbracelet/x/exp/teatest@latest ``` -------------------------------- ### Install via Homebrew Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Installs the tool on macOS or Linux using the Homebrew package manager. Ensure Homebrew is installed and the user repository is added. ```bash brew install user/tap/tool ``` -------------------------------- ### Install Gum Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Install Gum using Homebrew or Go. This is the first step before using any Gum commands. ```bash # Install brew install gum # or: go install github.com/charmbracelet/gum@latest ``` -------------------------------- ### Install RCH from Source Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/QUICKSTART.md Clone the repository, build the release binary, and copy it to your local bin directory. This is the recommended installation method. ```bash git clone https://github.com/Dicklesworthstone/remote_compilation_helper.git cd remote_compilation_helper cargo build --release cp target/release/rch target/release/rchd ~/.local/bin/ ``` -------------------------------- ### Mock Webhook Server Setup Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/extending/integration-hooks.md Starts a local HTTP server and configures the RCH endpoint to point to it for testing purposes. ```bash # Start a mock server to test webhooks python -m http.server 8080 & # Configure RCH to send to mock rch config set webhooks.endpoint http://localhost:8080/webhook # Trigger a build and check mock server logs ``` -------------------------------- ### README Checklist Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md A checklist to ensure all essential components are included before publishing a project's README file. Covers hero sections, TL;DR, examples, installation methods, diagrams, comparisons, troubleshooting, limitations, FAQs, and code block readiness. ```markdown □ Hero section with illustration + badges + one-liner + curl install □ TL;DR with Problem/Solution/Feature table □ Quick example (5-10 commands) □ At least 3 installation methods documented □ Every command has usage examples □ Architecture diagram for complex tools □ Comparison table vs at least 2 alternatives □ Troubleshooting section (top 5 errors) □ Honest Limitations section □ FAQ with 5+ questions □ All code blocks are copy-paste ready □ No broken links or badges □ Consistent terminology throughout □ Grammar/spelling checked ``` -------------------------------- ### Install Shell and Go Tools Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/QUICK-REFERENCE.md Commands to install essential shell tools using Homebrew and Go libraries for Bubble Tea development. Ensure you have Go and Homebrew installed. ```bash # Shell tools (all at once) brew install gum glow vhs freeze mods # Go libraries go get github.com/charmbracelet/bubbletea@latest \ github.com/charmbracelet/bubbles@latest \ github.com/charmbracelet/lipgloss@latest \ github.com/charmbracelet/huh@latest \ github.com/charmbracelet/glamour@latest \ github.com/charmbracelet/wish@latest # v2 track (bleeding edge) go get charm.land/bubbletea/v2@latest go get charm.land/lipgloss/v2@latest ``` -------------------------------- ### Install Bubble Tea and Lip Gloss for Go Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/SKILL.md Install the necessary Charmbracelet libraries, Bubble Tea for the TUI framework and Lip Gloss for styling, using Go's package manager. ```bash go get github.com/charmbracelet/bubbletea github.com/charmbracelet/lipgloss ``` -------------------------------- ### Install System-Wide Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Installs the tool system-wide using curl and bash, requiring sudo privileges. This makes the tool available globally on the system. ```bash curl -fsSL https://... | sudo bash -s -- --system ``` -------------------------------- ### Install and Send Email with Pop Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Installs the Pop CLI tool and demonstrates sending emails with various options, including attachments and reading content from stdin. ```bash # Install brew install pop # Send email pop send \ --from "me@example.com" \ --to "you@example.com" \ --subject "Hello" \ --body "Message body" # With attachment pop send \ --to "team@example.com" \ --subject "Report" \ --attach report.pdf \ --body "See attached" # From stdin cat update.md | pop send \ --to "team@example.com" \ --subject "Weekly Update" # Interactive pop ``` -------------------------------- ### Quick Install Shell Tools Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Install multiple Charm CLI tools including Gum, Glow, VHS, Freeze, and Mods simultaneously using Homebrew. ```bash # All shell tools at once brew install gum glow vhs freeze mods ``` ```bash # Or from Charm tap brew tap charmbracelet/tap brew install charmbracelet/tap/gum \ charmbracelet/tap/glow \ charmbracelet/tap/vhs \ charmbracelet/tap/freeze \ charmbracelet/tap/mods ``` -------------------------------- ### Install Freeze Code Screenshot Tool Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Install the Freeze CLI tool for generating beautiful code screenshots for documentation. Available via Homebrew. ```bash # Install brew install freeze ``` -------------------------------- ### Quick Install Go Libraries Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Install essential Charmbracelet Go libraries including wish, teatest, and term. This command fetches the latest versions of these packages. ```bash go get github.com/charmbracelet/wish@latest \ github.com/charmbracelet/x/exp/teatest@latest \ github.com/charmbracelet/x/term@latest ``` -------------------------------- ### Install RCH on Workstation Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/migration.md Install the RCH binary from source or via cargo to your local machine. ```bash # From source git clone https://github.com/Dicklesworthstone/remote_compilation_helper.git cd remote_compilation_helper cargo build --release cp target/release/rch target/release/rchd ~/.local/bin/ # Or via cargo cargo install --git https://github.com/Dicklesworthstone/remote_compilation_helper.git ``` -------------------------------- ### Install Specific Version Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Installs a specific version of the tool using curl and bash. Ensure the URL is correct for the desired version. ```bash curl -fsSL https://... | bash -s -- --version v1.0.0 ``` -------------------------------- ### Install Bun and Node.js on Worker Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/workers.md Installs Bun, a fast JavaScript runtime, and Node.js on the worker machine. Useful for projects involving TypeScript or JavaScript. ```bash # For Bun/TypeScript projects curl -fsSL https://bun.sh/install | bash ``` -------------------------------- ### Install Charm Libraries Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/go-tui.md Installs the latest stable versions of various Charm libraries including Bubble Tea, Bubbles, Lip Gloss, Huh, Glamour, Harmonica, and Log. ```bash go get github.com/charmbracelet/bubbletea@latest \ github.com/charmbracelet/bubbles@latest \ github.com/charmbracelet/lipgloss@latest \ github.com/charmbracelet/huh@latest \ github.com/charmbracelet/glamour@latest \ github.com/charmbracelet/harmonica@latest \ github.com/charmbracelet/log@latest ``` -------------------------------- ### Manual configuration Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/README.md Manually define worker nodes and start the daemon service. ```bash # 1) configure workers mkdir -p ~/.config/rch cat > ~/.config/rch/workers.toml << 'TOML' [[workers]] id = "css" host = "203.0.113.20" user = "ubuntu" identity_file = "~/.ssh/id_rsa" total_slots = 32 priority = 100 TOML # 2) start daemon rch daemon start # 3) verify workers rch workers probe --all # 4) install hook rch hook install # 5) check posture rch check rch status --workers --jobs ``` -------------------------------- ### Install Glow Markdown Viewer Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Install the Glow CLI tool for viewing Markdown files in the terminal. Supports local files, URLs, and standard input. ```bash # Install brew install glow ``` -------------------------------- ### Initialize and Configure File Picker Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/component-catalog.md Create a new file picker, set allowed file extensions, the starting directory, and visibility options for hidden files and file sizes. Styling can be applied to selected items. ```go import "github.com/charmbracelet/bubbles/filepicker" fp := filepicker.New() fp.AllowedTypes = []string{'.txt', '.md', '.go'} fp.CurrentDirectory, _ = os.UserHomeDir() fp.ShowHidden = false fp.ShowSize = true fp.ShowPermissions = false // Styling fp.Styles.Selected = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) // In Init func (m model) Init() tea.Cmd { return m.filepicker.Init() } ``` -------------------------------- ### RCH Hook Installation Commands Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/adr/005-shell-hooks.md Provides bash commands for installing and verifying the RCH hook. Use 'rch hook install' for auto-detection or '--agent=claude-code' for manual setup. ```bash # Auto-detect and install rch hook install # Manual installation rch hook install --agent=claude-code # Verify rch hook status ``` -------------------------------- ### Automated Dependency Installation Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/workers.md Uses the RCH CLI to automatically install necessary dependencies on a specified worker. This simplifies the setup process. ```bash rch fleet deploy --worker my-worker --install-deps ``` -------------------------------- ### Build from Source Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Installs the tool by cloning the repository, building from source using Cargo, and copying the executable to a local bin directory. This method provides the latest code. ```bash git clone https://github.com/user/repo.git cd repo cargo build --release cp target/release/tool ~/.local/bin/ ``` -------------------------------- ### Soft Serve Configuration Example Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Basic configuration for Soft Serve, setting the server name, host, port, and initial admin SSH keys. ```yaml # ~/.config/soft-serve/config.yaml name: "My Soft Serve" host: 0.0.0.0 port: 23231 initial_admin_keys: - "ssh-ed25519 AAAA... you@example.com" ``` -------------------------------- ### Multi-Tier Help System Components Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/production-architecture.md Implement a multi-tier help system for users to learn the TUI without leaving it. This includes a quick reference, a full tutorial, and a persistent shortcuts sidebar. ```go // Tier 1: Quick Reference (?) — compact overlay, context-specific func (m model) renderQuickHelp() string { keys := getKeysForFocus(m.focus) return renderKeyTable(keys, 60, 20) // 60 chars wide, 20 lines } ``` ```go // Tier 2: Full Tutorial (`) — multi-page walkthrough with rich content type TutorialPage struct { Title string Content []TutorialComponent Context []focus // Only show when these views are active } type TutorialComponent interface { Render(width int) string } type Section struct{ text string } type KeyTable struct{ keys []KeyDesc } type Tip struct{ text string } type Warning struct{ text string } type CodeBlock struct{ code, lang string } ``` ```go // Tier 3: Shortcuts Sidebar (;) — persistent, always-visible func (m model) renderShortcutsSidebar() string { // Fixed 34-char width on right edge shortcuts := getContextShortcuts(m.focus) sidebar := lipgloss.NewStyle(). Width(34). Height(m.height). Border(lipgloss.NormalBorder(), false, false, false, true). BorderForeground(m.theme.Border). Render(renderShortcutList(shortcuts)) return sidebar } ``` ```go // Sidebar scrollable with Ctrl+J/K func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyMsg: switch msg.String() { case "ctrl+j": if m.showSidebar { m.sidebarScroll++ } case "ctrl+k": if m.showSidebar && m.sidebarScroll > 0 { m.sidebarScroll-- } } } ``` -------------------------------- ### Unix Socket Request Example Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/adr/001-unix-socket-ipc.md Demonstrates a simple GET request format for querying worker selection via Unix domain socket. ```text GET /select-worker?project=myproject&cores=4&runtime=rust\n ``` -------------------------------- ### Define and Render Help Menu Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/component-catalog.md Defines key bindings and creates a help model for displaying short or full help menus. Set the Width property to control wrapping. ```go import ( "github.com/charmbracelet/bubbles/help" "github.com/charmbracelet/bubbles/key" ) // Define key bindings type keyMap struct { Up key.Binding Down key.Binding Help key.Binding Quit key.Binding } func (k keyMap) ShortHelp() []key.Binding { return []key.Binding{k.Help, k.Quit} } func (k keyMap) FullHelp() [][]key.Binding { return [][]key.Binding{ {k.Up, k.Down}, {k.Help, k.Quit}, } } var keys = keyMap{ Up: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "up"), ), Down: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("↓/j", "down"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "toggle help"), ), Quit: key.NewBinding( key.WithKeys("q", "ctrl+c"), key.WithHelp("q", "quit"), ), } // Create help model h := help.New() h.Width = 80 // Wrap at width // Toggle full/short h.ShowAll = true // Full help h.ShowAll = false // Short help // Render helpView := h.View(keys) ``` ```go h.Styles.ShortKey = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) h.Styles.ShortDesc = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) h.Styles.FullKey = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) h.Styles.FullDesc = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) h.Styles.FullSeparator = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) ``` -------------------------------- ### Idempotent Remote Worker Setup Script Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/PLAN_TO_MAKE_REMOTE_COMPILATION_HELPER.md A bash script to set up the RCH worker environment idempotently. It installs dependencies, the Rust toolchain, sccache, and C/C++ tools, ensuring the worker is ready for compilation. ```bash #!/usr/bin/env bash set -euo pipefail MARKER_FILE="/var/lib/rch/.setup_complete" VERSION_FILE="/var/lib/rch/.version" REQUIRED_VERSION="0.1.0" # Skip if already set up with correct version if [[ -f "$MARKER_FILE" ]] && [[ -f "$VERSION_FILE" ]]; then installed_version=$(cat "$VERSION_FILE") if [[ "$installed_version" == "$REQUIRED_VERSION" ]]; then echo "RCH worker already at version $REQUIRED_VERSION" exit 0 fi fi echo "Setting up RCH worker..." # 1. Create directories sudo mkdir -p /var/lib/rch sudo mkdir -p /tmp/rch sudo chown -R "$USER:$USER" /tmp/rch # 2. Install dependencies sudo apt-get update sudo apt-get install -y \ build-essential \ pkg-config \ libssl-dev \ zstd \ rsync # 3. Install Rust toolchain if ! command -v rustup &> /dev/null; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly fi source ~/.cargo/env rustup default nightly rustup update # 4. Install sccache cargo install sccache || true echo 'export RUSTC_WRAPPER=sccache' >> ~/.bashrc # 5. Install C/C++ tools sudo apt-get install -y gcc g++ clang ccache # 6. Mark complete echo "$REQUIRED_VERSION" | sudo tee "$VERSION_FILE" sudo touch "$MARKER_FILE" echo "RCH worker setup complete!" ``` -------------------------------- ### Minimal Configuration Example Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/README.md A base configuration file defining general settings, compilation thresholds, transfer parameters, and self-healing options. ```toml [general] enabled = true force_local = false force_remote = false socket_path = "~/.cache/rch/rch.sock" log_level = "info" [compilation] confidence_threshold = 0.85 min_local_time_ms = 2000 remote_speedup_threshold = 1.2 build_slots = 4 test_slots = 8 check_slots = 2 build_timeout_sec = 300 test_timeout_sec = 1800 bun_timeout_sec = 600 external_timeout_enabled = true [transfer] compression_level = 3 remote_base = "/tmp/rch" adaptive_compression = true verify_artifacts = false max_transfer_mb = 2048 [selection] strategy = "balanced" [self_healing] hook_starts_daemon = true daemon_installs_hooks = true [alerts] enabled = true suppress_duplicates_secs = 300 ``` -------------------------------- ### Horizontal Scaling Configuration Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/diagrams/deployment.md Example TOML configuration for defining multiple RCH workers. Each worker is defined with an ID, host address, and the number of compilation slots it provides. This setup allows for horizontal scaling by adding more workers to increase total capacity. ```toml # ~/.config/rch/workers.toml [[workers]] id = "worker-1" host = "10.0.1.10" total_slots = 16 [[workers]] id = "worker-2" host = "10.0.1.11" total_slots = 32 [[workers]] id = "worker-3" host = "10.0.1.12" total_slots = 16 # Total capacity: 64 slots ``` -------------------------------- ### Test Bubble Tea App with teatest Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/infrastructure.md Write tests for Bubble Tea applications using teatest. This example shows how to send keys, type text, wait for specific output, and get the final output. Ensure you have imported the necessary packages. ```go import ( "testing" "time" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/x/exp/teatest" ) func TestApp(t *testing.T) { m := NewModel() tm := teatest.NewTestModel(t, m) // Send keys tm.Send(tea.KeyMsg{Type: tea.KeyDown}) tm.Send(tea.KeyMsg{Type: tea.KeyEnter}) // Type text tm.Type("hello world") // Wait for condition teatest.WaitFor(t, tm, func(bts []byte) bool { return strings.Contains(string(bts), "Expected output") }, teatest.WithDuration(time.Second)) // Get final output out := tm.FinalOutput(t) if !strings.Contains(string(out), "success") { t.Fatal("expected success message") } // Quit tm.Send(tea.KeyMsg{Type: tea.KeyCtrlC}) tm.WaitFinished(t, teatest.WithFinalTimeout(time.Second)) } ``` -------------------------------- ### Basic Command Usage Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/SKILL.md Demonstrates the basic usage of a command and how to use flags with values. Use the --help flag to see all available options. ```bash tool command # Basic usage ``` ```bash tool command --flag value # With options ``` ```bash tool command --help # See all options ``` -------------------------------- ### Go: Bubble Tea Starter Application Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/QUICK-REFERENCE.md A basic Bubble Tea application demonstrating a simple list selection UI. Requires the Bubble Tea library. ```go package main import ( "fmt" "os" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" ) type model struct { cursor int items []string } func (m model) Init() tea.Cmd { return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: switch msg.String() { case "q", "ctrl+c": return m, tea.Quit case "up", "k": if m.cursor > 0 { m.cursor-- } case "down", "j": if m.cursor < len(m.items)-1 { m.cursor++ } case "enter": fmt.Println("Selected:", m.items[m.cursor]) return m, tea.Quit } } return m, nil } var selected = lipgloss.NewStyle().Foreground(lipgloss.Color("212")).Bold(true) func (m model) View() string { s := "" for i, item := range m.items { cursor := " " if i == m.cursor { cursor = "▸ " s += selected.Render(cursor+item) + "\n" } else { s += cursor + item + "\n" } } return s + "\n↑/↓: navigate • enter: select • q: quit" } func main() { m := model{items: []string{"Option A", "Option B", "Option C"}} if _, err := tea.NewProgram(m).Run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } ``` -------------------------------- ### Install ssh-copy-id on macOS Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/ssh-setup.md If you are on macOS and do not have `ssh-copy-id` installed, you can install it using Homebrew. ```bash brew install ssh-copy-id ``` -------------------------------- ### Cargo Commands for Development Setup Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/crafting-readme-files/references/section-templates.md Outlines essential Cargo commands for setting up a development environment, including cloning the repository, building the project, running tests, and linting. ```bash # Clone git clone https://github.com/user/repo.git cd repo # Install dependencies cargo build # Run tests cargo test # Run lints cargo clippy --all-targets -- -D warnings ``` -------------------------------- ### Install RCH with Cargo Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/QUICKSTART.md Install RCH directly from its Git repository using Cargo. Ensure you have the Rust toolchain installed. ```bash cargo install --git https://github.com/Dicklesworthstone/remote_compilation_helper.git ``` -------------------------------- ### RCH Installation Subcommands Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/PLAN_TO_MAKE_REMOTE_COMPILATION_HELPER.md Commands for installing the RCH agent on workers or locally. Options include fleet-wide installation and source builds. ```bash rch install --fleet Install on all workers --worker-only Install worker agent only --easy-mode Non-interactive setup --from-source Build from source ``` -------------------------------- ### Generate Fresh Configuration Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/runbooks/configuration-troubleshooting.md Initializes a new configuration file, optionally specifying a profile. ```bash rch config init # Or with specific profile rch config init --profile prod ``` -------------------------------- ### Configure global settings Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/adr/004-toml-configuration.md Example of the global configuration file structure including general, compilation, transfer, and output settings. ```toml [general] enabled = true log_level = "info" socket_path = "~/.cache/rch/rch.sock" [compilation] confidence_threshold = 0.85 min_local_time_ms = 2000 [transfer] compression_level = 3 exclude_patterns = [ "target/", ".git/", "node_modules/", ] [output] stream_mode = "realtime" preserve_colors = true ``` -------------------------------- ### Initialize Project Configuration Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/PLAN_TO_MAKE_REMOTE_COMPILATION_HELPER.md Initializes the '.rch/config.toml' file with default settings for a new project. ```bash # Initialize .rch/config.toml with defaults rch config init ``` -------------------------------- ### Install Gum for Shell Scripts Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/SKILL.md Install the Gum CLI tool for adding prompts, confirmations, and other interactive elements to shell scripts. This is a one-time installation. ```bash brew install gum # One-time install ``` -------------------------------- ### Install RCH with Installer Script Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/QUICKSTART.md Use a curl command to download and execute the installation script for RCH. This provides a quick alternative to building from source. ```bash curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/remote_compilation_helper/main/install.sh | bash ``` -------------------------------- ### Initialize and Configure List Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/component-catalog.md Initializes a new list component with predefined items, a default delegate, and specified dimensions. Demonstrates setting the title, enabling the status bar, and filtering. ```go // Create list items := []list.Item{ item{"First", "Description 1"}, item{"Second", "Description 2"}, } l := list.New(items, list.NewDefaultDelegate(), 40, 20) l.Title = "My List" l.SetShowStatusBar(true) l.SetFilteringEnabled(true) // Styling l.Styles.Title = lipgloss.NewStyle( ).Foreground(lipgloss.Color("205") ).Bold(true) // In Update l, cmd = l.Update(msg) // Get selected item if i, ok := l.SelectedItem().(item); ok { // Use i } // Update items l.SetItems(newItems) ``` -------------------------------- ### Install Mods CLI Tool Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Install the Mods CLI tool for interacting with AI models directly from your terminal. Supports installation via Homebrew or Go. ```bash # Install brew install mods ``` ```bash # Or with Go go install github.com/charmbracelet/mods@latest ``` -------------------------------- ### Go: Common Bubble Components Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/QUICK-REFERENCE.md Demonstrates the initialization and basic usage of common components from the 'bubbles' library, including spinners, text inputs, progress bars, viewports, and lists. Ensure the item type implements the 'list.Item' interface for list components. ```go import ( "github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/spinner" "github.com/charmbracelet/bubbles/textinput" "github.com/charmbracelet/bubbles/viewport" "github.com/charmbracelet/bubbles/progress" ) // Spinner s := spinner.New() s.Spinner = spinner.Dot // In Init: return s.Tick // In Update: s, cmd = s.Update(msg) // Text input ti := textinput.New() ti.Placeholder = "Type here..." ti.Focus() // In Update: ti, cmd = ti.Update(msg) // Get value: ti.Value() // Progress bar p := progress.New(progress.WithDefaultGradient()) // Render: p.ViewAs(0.75) // 75% // Viewport (scrollable content) vp := viewport.New(80, 20) vp.SetContent(longText) // In Update: vp, cmd = vp.Update(msg) // List (requires item type implementing list.Item interface) type item struct{ title, desc string } func (i item) Title() string { return i.title } func (i item) Description() string { return i.desc } func (i item) FilterValue() string { return i.title } items := []list.Item{item{"One", "First"}, item{"Two", "Second"}} l := list.New(items, list.NewDefaultDelegate(), 40, 20) l.Title = "My List" ``` -------------------------------- ### Bash Installation Script for Remote Compilation Helper Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/PLAN_TO_MAKE_REMOTE_COMPILATION_HELPER.md Provides a comprehensive bash script for installing the Remote Compilation Helper (rch) and its associated services. Supports interactive, fleet-wide, and worker-only installation modes. ```bash #!/usr/bin/env bash # install.sh - Remote Compilation Helper Installer set -euo pipefail # ============================================================================ # Configuration # ============================================================================ REPO="Dicklesworthstone/remote_compilation_helper" BINARY_NAME="rch" DAEMON_NAME="rchd" WORKER_NAME="rch-wkr" # ============================================================================ # Installation Modes # ============================================================================ # # 1. Local-only: Install rch + rchd on current machine # 2. Fleet: Install on current + all workers # 3. Worker-only: Install just rch-wkr on current machine # # Usage: # bash install.sh # Interactive # bash install.sh --fleet # Full fleet setup # bash install.sh --worker-only # Just worker # bash install.sh --easy-mode # Non-interactive full setup ``` -------------------------------- ### Install RCH Hooks Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/QUICKSTART.md Install the RCH hooks to enable command interception. Use the auto-detect option or specify the agent, such as Claude Code, for manual installation. This step is crucial for RCH to redirect your build commands. ```bash # Auto-detect and install hooks rch hook install # Or manually for Claude Code rch hook install --agent=claude-code ``` -------------------------------- ### Initialize and Style Viewport Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/component-catalog.md Create a new viewport with specified dimensions and apply custom styling. The content can be set using `SetContent`. ```go import "github.com/charmbracelet/bubbles/viewport" vp := viewport.New(80, 20) vp.SetContent(longContent) // Mouse wheel scrolling vp.MouseWheelEnabled = true vp.MouseWheelDelta = 3 // Styling vp.Style = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(lipgloss.Color("240")) ``` -------------------------------- ### Command Palette Initialization Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/go-tui.md Sets up a command palette with fuzzy search capabilities using the `list` component. Ensure `list.Item` and `item` types are defined, and `titleStyle` is initialized. ```go items := []list.Item{ item{title: "New File", key: "ctrl+n"}, item{title: "Open File", key: "ctrl+o"}, item{title: "Save", key: "ctrl+s"}, } l := list.New(items, list.NewDefaultDelegate(), 40, 14) l.Title = "Commands" l.SetShowStatusBar(false) l.SetFilteringEnabled(true) // Built-in fuzzy search! l.Styles.Title = titleStyle ``` -------------------------------- ### Replace fmt.Println with Lip Gloss Styling Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/go-tui.md Demonstrates replacing standard `fmt.Println` with Lip Gloss for styled output, specifically for error messages. Requires importing the `lipgloss` and `fmt` packages. ```go // Before fmt.Println("Error: file not found") // After errStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("196")).Bold(true) fmt.Println(errStyle.Render("Error: file not found")) ``` -------------------------------- ### Install VHS Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/shell-scripts.md Command to install VHS, a tool for recording terminal sessions as GIFs, using Homebrew. ```bash # Install brew install vhs ``` -------------------------------- ### Verify RCH Installation on Worker Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/workers.md Checks if the RCH agent has been successfully installed and is running on the specified worker. ```bash rch fleet verify --worker my-first-worker ``` -------------------------------- ### Main Application Entry Point Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/advanced-patterns.md The main function sets up the TUI application, enabling debug logging if the DEBUG environment variable is set. It initializes the program with a model and configures screen and mouse behavior. ```go func (i item) FilterValue() string { return i.title } // ───────────────────────────────────────────────────────────── // Main // ───────────────────────────────────────────────────────────── func main() { // Enable debug logging to file if os.Getenv("DEBUG") != "" { f, _ := tea.LogToFile("debug.log", "debug") defer f.Close() } p := tea.NewProgram( initialModel(), tea.WithAltScreen(), tea.WithMouseCellMotion(), ) if _, err := p.Run(); err != nil { fmt.Fprintln(os.Stderr, "Error:", err) os.Exit(1) } } ``` -------------------------------- ### Install rch and rchd Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/README.md Executes the installation script to set up the rch tool, the rchd daemon, and bootstrap the necessary configuration. ```bash curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/remote_compilation_helper/main/install.sh?$(date +%s)" | bash -s -- --easy-mode ``` -------------------------------- ### Install Build Tools on Worker Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/workers.md Installs essential build tools like `build-essential`, `rsync`, and `zstd` on Debian/Ubuntu-based systems. ```bash # For C/C++ projects sudo apt install -y gcc g++ clang ``` -------------------------------- ### Install Rust Toolchain on Worker Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/guides/workers.md Installs the Rust toolchain, including the nightly version, on a worker machine. This is essential for Rust development. ```bash # On each worker (run via SSH or directly) # Install Rust (nightly) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup default nightly rustup update ``` -------------------------------- ### File Watching Setup with fsnotify Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/production-architecture.md Sets up a file watcher using the fsnotify library to monitor a specific file for write events. The onChange function is called when a relevant event occurs. Ensure the directory containing the file is added to the watcher. ```go import "github.com/fsnotify/fsnotify" func watchFile(path string, onChange func()) { watcher, _ := fsnotify.NewWatcher() defer watcher.Close() watcher.Add(filepath.Dir(path)) for { select { case event := <-watcher.Events: if event.Name == path && (event.Op&fsnotify.Write != 0) { onChange() } case err := <-watcher.Errors: log.Printf("watcher error: %v", err) } } } ``` -------------------------------- ### ripgrep Rust Example Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/AGENTS.md Example of using ripgrep to quickly search for textual patterns like 'println!' within Rust files. ```bash rg -n 'println!' -t rust ``` -------------------------------- ### Example Directory Layout Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/design/pooled-target-dirs.md A visual representation of how multiple jobs share a single target directory based on their toolchain. ```text /data/projects// .rch-target-nightly-2026-05-01-a1b2c3/ # all nightly-2026-05-01 jobs .rch-target-stable-1.87.0-d4e5f6/ # all stable jobs ``` -------------------------------- ### Test Specific Commands with Classifier Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/docs/architecture/classifier.md Examples for testing specific commands using the 'rch classify' command. Includes an example for verbose output. ```bash # Test specific commands rch classify "cargo build --release" rch classify "bun test" rch classify "gcc main.c -o main" # Verbose output RCH_LOG_LEVEL=debug rch classify "command" ``` -------------------------------- ### Initialize Bubble Tea App Model Source: https://github.com/dicklesworthstone/remote_compilation_helper/blob/main/skills/building-glamorous-tuis/references/advanced-patterns.md Sets up the initial state for the Bubble Tea application, including configuring a spinner and marking the app as loading. ```go func initialModel() model { s := spinner.New() s.Spinner = spinner.Dot s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) return model{ screen: screenLoading, spinner: s, loading: true, } } ```