Skip to content

Comments

Improve CLI output readability for LLMs and non-interactive environments#1333

Merged
martin-helmich merged 13 commits intomasterfrom
feat/simplify-output-noninteractive
Sep 5, 2025
Merged

Improve CLI output readability for LLMs and non-interactive environments#1333
martin-helmich merged 13 commits intomasterfrom
feat/simplify-output-noninteractive

Conversation

@martin-helmich
Copy link
Member

@martin-helmich martin-helmich commented Sep 2, 2025

Summary

  • Enhance CLI usability when commands are executed through LLMs or non-interactive environments
  • Provide comprehensive contextual guidance after container deployment to reduce user confusion
  • Improve output readability and actionability for both human users and AI assistants

Why These Changes Matter

Better LLM Integration

The CLI is increasingly used through AI assistants and automation tools. The existing fancy terminal graphics and complex output formatting creates problems:

  • LLMs can't properly parse or understand visual elements like spinners and progress bars
  • Non-TTY environments lose critical information when fancy formatting is stripped
  • Users working through AI assistants miss important next steps and usage instructions

Enhanced User Experience After Container Deployment

Previously, after successfully deploying a container, users were left with minimal guidance on how to actually use their newly created service. This led to:

  • LLM hallucinations regarding usage and connectivity of created containers
  • Frustration trying to figure out connection methods
  • Missed opportunities to understand internal networking vs external access
  • Lack of awareness about domain configuration and port forwarding options

Solutions Implemented

SimpleProcessRenderer: Provides clean, parseable text output for non-TTY environments while preserving all critical information. LLMs can now understand process states and outcomes without visual noise.

Comprehensive Container Usage Hints: After container deployment, users immediately see:

  • How to connect from within the hosting environment (service-to-service communication)
  • Domain configuration options for external HTTPS access
  • Local port forwarding for development workflows
  • Management commands for SSH access, logs, and exec operations

The modular component architecture ensures maintainability while providing contextually appropriate guidance based on whether containers expose ports or not.

🤖 Generated with Claude Code

martin-helmich and others added 13 commits September 1, 2025 21:14
- Create a custom hook to provide default box styles based on TTY detection.
- Replace hardcoded box styles in Success component with the new hook.
…ault in useDefaultBoxStyles

- Simplify Success component by eliminating redundant width property.
- Default width now handled exclusively in useDefaultBoxStyles.
…ndant width definitions

- Added useDefaultBoxStyles hook to ErrorBox for consistent styling.
- Removed hardcoded width and redundant properties across related components.
- Simplified API token success message rendering.
…ag handling

- Introduced `SimpleProcessRenderer` for non-TTY environments.
- Added comprehensive unit tests for `SimpleProcessRenderer`.
- Updated process flag handling to utilize `SimpleProcessRenderer` when TTY is unavailable.
The existing SimpleProcessRenderer was updated to properly use writable
streams instead of console methods, and the test suite was fixed to use
real streams instead of mocks.

Changes:
- Updated SimpleProcessRenderer constructor to accept Writable stream parameter
- Replaced console.log calls with output.write() for all renderer methods
- Fixed process flags to pass process.stdout to SimpleProcessRenderer
- Rewrote test suite to use real Writable streams and string assertions
- Removed all mocking and type assertions from tests
- Simplified output format to be more readable and consistent

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Add comprehensive usage hints for newly created containers, including
port connection options, domain setup, and container management commands.

Components added:
- ContainerUsageHints: Main component showing usage hints based on container ports
- ContainerManagementCommands: Reusable component for SSH, logs, and exec commands
- CommandHint: Base component for displaying command suggestions with descriptions

Features:
- Adaptive hints based on whether container exposes ports
- Domain connection instructions via virtualhost creation
- Port forwarding examples for local development
- Container management commands (SSH, logs, exec)
- Integration with container run command to show hints after creation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Break down large ContainerUsageHints into smaller components:
  - NoPortsUsageHints for containers without exposed ports
  - DomainConnectionHints for domain connection instructions
  - PortForwardingHints for local port forwarding
  - PortConnectionHints as orchestrator for both connection types
- Extract ParsedPort interface to shared types.ts to eliminate duplication
- Improve component reusability and maintainability
- Update container run command to pass full service object for usage hints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add InternalConnectionHints component as first connection option
- Shows users how to connect from within hosting environment using service name as hostname
- Updated PortConnectionHints to orchestrate internal, domain, and port forwarding options
- Improved protocol-specific descriptions for domain and port forwarding hints
- Clarified that domain connections only work for HTTP and port forwarding works for TCP

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Create AppUsageHints component system for app installations
- Add domain connection instructions (no port forwarding for apps)
- Display backend/admin URLs using AppVersion.backendPathTemplate
- Show management commands for SSH, file operations, and app info
- Update AppInstaller to return full installation data and display hints
- Integrate with existing virtual host system for URL building
- Support host parameter for immediate backend URL display

Components:
- AppUsageHints: Main orchestrator for app installation guidance
- AppDomainConnectionHints: Domain connection via virtualhost creation
- AppBackendAccessHints: CMS backend URLs using backendPathTemplate
- AppManagementCommands: SSH, download, upload, and info commands

Provides immediate actionable guidance after app installation, similar to
container usage hints but tailored for app-specific connectivity patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…tNode

Replace ReactNode parameters with string parameters in ProcessRenderer methods
(addStep, runStep, addInfo, addConfirmation, addInput, addSelect, addCleanup)
for improved simplicity and consistency.

- Update ProcessRenderer interface and all implementations
- Convert JSX elements to template strings across codebase
- Update React component prop types accordingly
- Remove unused imports and clean up code
- Maintain backward compatibility for complete() method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@martin-helmich martin-helmich merged commit 2644d22 into master Sep 5, 2025
10 checks passed
@martin-helmich martin-helmich deleted the feat/simplify-output-noninteractive branch September 5, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant