Developer Workflow

Taming LLM Codebases with Gum

Stop drowning in AI-generated scripts. Build a single CLI that remembers everything.

Ori Nizan

Updated: Oct 2025 Β· 6 min read

πŸŽ€ charmbracelet/gum: A tool for glamorous shell scripts β†’
Handing gum to a futuristic enforcer

Meet Your New Command Center

Stop drowning in script chaos. When building with LLMs, your project accumulates dozens of scattered scripts that become impossible to manage. The solution isn't better documentationβ€”it's one beautiful, interactive CLI that serves as your project's front door.

My Project Developer CLI
Profile: dev | Port: 8000
Use ↑/↓ to navigate, Enter to select
> πŸš€ Start Services :: Launch Docker containers
πŸ›‘ Stop Services :: Shut down gracefully
πŸ—„οΈ Database Operations :: Migrations, seeding, backups
πŸ› οΈ Development Tools :: Tests, linting, formatting
⚑ Quick Actions :: Common tasks and health checks
❌ Exit

One command. All your tools. Never forget how your project works again.

The Problem: AI-Generated Chaos

You're building a web app with an LLM. First week: basic CRUD operations and database schema. Second week: authentication, file uploads, and email notifications. Third week: API versioning, rate limiting, and caching. A month in, you have scripts for development, testing, deployment, database operations, monitoring setup, and more. Each feature added a few more files. Now you have 25+ scripts scattered across your repo, and honestly, you're not sure which ones are still relevant.

Common Developer Frustrations:

  • Script sprawl: Dozens of run-*.sh files with no clear organization
  • Memory loss: "What parameters does deploy.sh need again?"
  • Onboarding hell: New developers (or future you) can't figure out how to start
  • LLM amnesia: The AI forgets to integrate new features into existing workflows

Three months later, you return to the project. You stare at your scripts/ folder like an archaeologist examining ancient ruins. "What does run-worker-prod-v2-final.sh do?"

Why Gum for LLM-Generated Projects?

Gum is a command-line tool that lets you build beautiful, interactive CLIs in bash. For LLM-generated projects, a well-structured Gum CLI becomes your single source of truth β€” a self-documenting front door to your entire codebase.

βœ… With Gum CLI

  • Run ./main-cli.sh
  • See every available action with descriptions
  • Choose what you need interactively
  • Preview commands before they run
  • Safe confirmations for dangerous ops

❌ Without It

  • Grep through scripts/ folder
  • Read source code to understand options
  • Copy-paste commands from docs
  • Hope you didn't miss a required flag

Key Benefits for Developers:

🎯 Essential Tips for Success

1

Use ONE Single ./main-cli.sh File

Everything starts from ./main-cli.sh in your repo root. No exceptions. No "quick scripts" outside the CLI. If you need it more than once, it belongs in the menu. This is your contract with yourself (and your LLM).

2

Start Small, Add Incrementally

Begin with one core command. As features grow, create separate scripts in a scripts/ folder that your main CLI callsβ€”keep main-cli.sh focused on orchestration. Get it working perfectly before adding more.

3

Test After Every Addition

After each new menu item, run through the entire flow. Does the order make sense? Are the descriptions clear? Can you use it without looking at the code? If not, refine before moving on.

4

Always Provide Defaults & Explanations

Never leave yourself guessing. Use gum input with default values, gum choose for selections, and always explain what each option does. Include examples for complex inputs.

5

Preview + Confirm for Everything Important

Show the exact command that will run. Use gum confirm before execution. This builds trust and helps you learn what's happening under the hood. Your future self will thank you.

⚠️ Critical Reminder: LLMs don't always listen to instructions. After every request, check if the main entry point was updated. If not, explicitly ask: "Now update main-cli.sh with a menu option for this feature, including description, command preview, and confirmation prompt."

Example: Interactive Workflow

Here's what your CLI looks like in action:

Step 1: Main Menu

My Project Developer CLI
Profile: dev | Port: 8000
Use ↑/↓ to navigate, Enter to select
Β 
πŸš€ Start Services :: Launch Docker containers
> πŸ—„οΈ Database Operations :: Migrations, seeding, backups
πŸ› οΈ Development Tools :: Tests, linting, formatting
⚑ Quick Actions :: Common tasks
❌ Exit

Step 2: Submenu Opens

πŸ—„οΈ Database Operations
Use ↑/↓ to navigate, Enter to select
Β 
> πŸ“€ Run migrations :: Apply pending database migrations
βͺ Rollback migration :: Undo last migration
🌱 Seed data :: Load demo data into database
πŸ’Ύ Create backup :: Backup database to file
πŸ”„ Restore backup :: Restore from backup file
🐚 Open DB shell :: Interactive PostgreSQL shell
← Back to main menu

Step 3: Command Preview & Confirm

πŸ“‹ Command Preview:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ docker compose exec api alembic upgrade head β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Β 
This will apply all pending migrations to the database.
Β 
> Yes, run this command
No, cancel

Step 4: Execution & Feedback

Running migrations...
Β 
INFO [alembic.runtime.migration] Running upgrade abc123 -> def456
INFO [alembic.runtime.migration] Running upgrade def456 -> ghi789
Β 
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ βœ… Migrations applied successfully! β”‚
β”‚ 2 migrations run β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Β 
Press Enter to return to menu...

Getting Started

1. Install Gum

terminal
# macOS
brew install gum

# Linux
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum

2. Create Agent Instructions File

Save this as AGENTS.md in your project root:

AGENTS.md
## Gum CLI Development Rules

### CORE PRINCIPLE: SINGLE ENTRYPOINT
- ONE main script at repo root: ./main-cli.sh using gum
- ALL features integrate into this menu - NO orphan scripts
- Menu provides orientation with clear descriptions for each action

### IMPLEMENTATION STRATEGY
1. Start with one essential command
2. As features grow, create separate scripts in scripts/ folder
3. Main CLI should call these scripts - keep main-cli.sh clean
4. Test thoroughly before adding more
5. Ensure menu order makes logical sense
6. Group related actions together

### FOR EVERY MENU ITEM
- Show: action name + one-line description
- Include default values where applicable
- Use gum style for visual hierarchy

### PARAMETER CONTROL
- Use `gum input` for text with default values
- Use `gum choose` for option selection
- Use `gum confirm` for yes/no decisions

### PREVIEW + CONFIRM (MANDATORY)
- ALWAYS show the exact command before execution
- Use `gum confirm` for ANY impactful operation
- Allow abort at confirmation

### CRITICAL REMINDER FOR EVERY TASK
After completing ANY development task, you MUST:
1. Add/update corresponding action in ./main-cli.sh
2. Include descriptive label + help text
3. Add command preview + confirmation
4. Test the new menu option end-to-end

Optional: Agent-specific instruction files

  • .cursorrules - For Cursor IDE
  • .clinerules - For Cline (VS Code extension)
  • .github/copilot-instructions.md - For GitHub Copilot
  • .windsurf/rules.md - For Windsurf IDE

Each file can contain similar rules tailored to that agent's workflow. Reference your AGENTS.md in these files.

3. Let Your LLM Create the CLI

Ask your AI assistant to create the initial CLI structure:

prompt
Create a main-cli.sh file in the repo root using Gum.

Requirements:
- Single entry point for all project operations
- Start with 1-2 basic commands (like start/stop services)
- Each menu item should have a description
- Preview commands before execution
- Use gum confirm for confirmations
- Include proper error handling

Make it simple and we'll expand it incrementally.

4. Start Using It

terminal
chmod +x main-cli.sh

# Run with bash (not sh!)
bash main-cli.sh

# Or if executable:
./main-cli.sh
⚠️ Important: When running the CLI, use "bash main-cli.sh" instead of "sh main-cli.sh".

Let’s Keep Building

Hope this guide helps you wrangle your own AI-fueled codebase into a single, joyful CLI. I’m constantly iterating on this workflow and would love to hear how you’re applying it.

If you spot something that could be better, or have a Gum trick I should try, contact me at restin3@gmail.com.