
Beautiful CLI Loading States with ora, listr2, and cli-progress
Beautiful CLI Loading States with ora, listr2, and cli-progress Nobody likes staring at a frozen terminal. When your CLI tool fetches data, processes files, or runs builds, users need visual feedback that something is actually happening. A silent terminal breeds anxiety — did it crash? Is it stuck? Should I Ctrl+C? Three libraries solve this problem elegantly: ora for spinners, listr2 for task lists, and cli-progress for progress bars. This article shows you how to use each one, combine them for complex workflows, and handle edge cases like piped output and nested tasks. ora: Elegant Terminal Spinners ora is the go-to library for terminal spinners. It's minimal, beautiful, and handles all the terminal escape code complexity for you. Basic Usage import ora from ' ora ' ; const spinner = ora ( ' Fetching user data... ' ). start (); try { const data = await fetchUsers (); spinner . succeed ( `Loaded ${ data . length } users` ); } catch ( err ) { spinner . fail ( ' Could not fetch users '
Continue reading on Dev.to Tutorial
Opens in a new tab



