# Crawl, walk & run your way to usable CLIs in Go Page: https://stenobird.com/podcast/go-time-golang-software-engineering/crawl-walk-run-your-way-to-usable-clis-in-go Text version: https://stenobird.com/podcast/go-time-golang-software-engineering/crawl-walk-run-your-way-to-usable-clis-in-go.md Podcast: [Go Time: Golang, Software Engineering](https://stenobird.com/podcast/go-time-golang-software-engineering) Published: 2024-11-12T21:30:00+00:00 Episode link: https://changelog.com/gotime/337 Audio file: https://op3.dev/e/https://cdn.changelog.com/uploads/gotime/337/go-time-337.mp3 Processing state: processed JSON: https://stenobird.com/v1/public/podcasts/go-time-golang-software-engineering/episodes/crawl-walk-run-your-way-to-usable-clis-in-go Duration seconds: 3467 ## Resource Building a production-ready CLI in Go requires more than just picking a library like Cobra. This episode explores the technical debt and architectural decisions encountered when moving from a simple script to a robust, user-friendly tool. ## Highlights - Failure mode: Over-using generics and abstractions can make debugging significantly harder than handling simple boilerplate - Practical takeaway: Prefer flags over positional arguments to ensure knowledge transfer and consistency across different commands - Main idea: A successful CLI should act as a teaching tool, helping users understand the underlying system through explicit command structures - Technical challenge: Integrating Cobra's flag parsing with Go's native testing flags can create significant friction in test suites - Design philosophy: Avoid deviating from established patterns unless you have a specific, well-justified reason to reinvent the wheel ## Topics Go programming, CLI development, Cobra library, Software architecture, User Experience, Unit testing, Command line interfaces, Developer tools ## Chapters - 1:00 — The Evolution of Deployment Platforms: A discussion on the shift from Heroku-style abstractions to more flexible, low-level primitives like Fly.io. - 10:00 — The Pitfalls of Custom Implementations: The difficulty of maintaining custom logic when you deviate from the 'golden path' of established libraries. - 14:05 — Testing Network-Dependent CLIs: How to handle network calls and simulations during the testing phase of CLI development. - 22:30 — IDEs and Refactoring Large Codebases: Comparing the refactoring capabilities of IntelliJ versus VS Code when managing multi-repository changes. - 35:10 — Designing for User Education: Why explicit flags are superior to positional arguments for creating a predictable user experience. - 44:10 — Learning from GitHub CLI: Analyzing the implementation of tools like the GitHub CLI and Bubble Tea to find inspiration for robust CLI design. ## Actions - request_transcript: `POST https://stenobird.com/v1/public/podcasts/go-time-golang-software-engineering/episodes/crawl-walk-run-your-way-to-usable-clis-in-go/transcription-requests` — Idempotently request low-priority transcript generation for this episode. - read_markdown: `GET https://stenobird.com/podcast/go-time-golang-software-engineering/crawl-walk-run-your-way-to-usable-clis-in-go.md` — Read the agent-friendly Markdown representation of this episode resource. A page view does not enqueue transcription. Agents should invoke `request_transcript` explicitly when they need this episode processed. ## Transcript Full transcripts are not published on public pages unless there is a clear rights basis.