feat: add loading animations with global API proxy integration - #7
Merged
Conversation
Add NPM-style loading spinners to all CLI commands using a global API proxy approach that automatically wraps all Twist API calls with appropriate loading animations. Key Features: - Global API Proxy: Automatically adds spinners to all TwistApi method calls without requiring code changes to existing commands - Context-aware messages: Different spinners for read operations (blue), create operations (green), and update/delete operations (yellow) - Zero maintenance: New API methods automatically get spinners without any additional development work - Smart configuration: Auto-disables in CI environments, non-TTY terminals, and JSON output modes - Professional UX: Provides immediate visual feedback during network operations, similar to NPM's loading experience Core Components: - yocto-spinner package (2KB, zero dependencies) - Modern, lightweight spinner library - src/lib/spinner.ts - Core spinner utilities with withSpinner function and LoadingSpinner class - src/lib/api.ts - Enhanced with Proxy wrapper that intercepts all API calls - Global configuration - --no-spinner option and TW_SPINNER=false environment variable support Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jan 22, 2026
# 1.0.0 (2026-01-22) ### Bug Fixes * add UTF-8 charset to OAuth callback HTML responses ([#8](#8)) ([fcb2d49](fcb2d49)) ### Features * Add Biome linting, upgrade to Node 20, and add CI workflows ([#3](#3)) ([57f802e](57f802e)) * add loading animations with global API proxy integration ([#7](#7)) ([bf53bfb](bf53bfb)) * Add OAuth authentication with dynamic client registration ([#6](#6)) ([2845ebd](2845ebd)), closes [#5](#5) * add semantic release automation for NPM publishing ([#10](#10)) ([c756324](c756324)) * Refactor login command to auth with status/logout subcommands ([#4](#4)) ([59e6493](59e6493))
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add NPM-style loading spinners to all CLI commands using a global API proxy approach that automatically wraps all Twist API calls with appropriate loading animations.
Key Features
Implementation Details
Core Components
src/lib/spinner.ts- Core spinner utilities withwithSpinnerfunction andLoadingSpinnerclasssrc/lib/api.ts- Enhanced with Proxy wrapper that intercepts all API calls--no-spinneroption andTW_SPINNER=falseenvironment variable supportAPI Method Mapping
The proxy automatically maps API methods to appropriate loading messages:
users.getSessionUser()workspaces.getWorkspaces()threads.getThread()comments.createComment()comments.updateComment()inbox.archiveThread()Configuration Options
Users can disable spinners using:
tw auth status --no-spinnerTW_SPINNER=false tw auth statusTesting
tw auth status,tw inbox, etc.)Benefits
Demo
This implementation transforms the CLI into a modern, professional tool with immediate user feedback during network operations while requiring zero changes to existing command implementations.
🤖 Generated with Claude Code