Skip to content

Conversation

@shivasurya
Copy link
Owner

Summary

Adds an ASCII art banner with TTY detection to improve CLI user experience. The banner displays only when outputting to a terminal and can be disabled with --no-banner.

Why this change?

  • Better UX: Professional branding and visual identity for the CLI tool
  • Context awareness: Automatically detects TTY vs piped output
  • User control: Respects --no-banner flag and CI environments

Changes

  • Add ASCII art banner with go-figure library
  • Implement TTY detection using golang.org/x/term
  • Add --no-banner global flag
  • Display banner in scan/CI/serve commands
  • Add comprehensive test coverage (97%)

Testing

  • Unit tests for banner display logic
  • TTY detection tests for various writer types
  • Integration tests for flag behavior

Related

Part of CLI Output Enhancement initiative (PR-01 of 4)


🤖 Generated with Claude Code

Implements Phase 1 of CLI Output Enhancement with TTY-aware banner display.

New files:
- output/banner.go: ASCII art banner with version/license display
- output/banner_test.go: 100% test coverage for banner functionality
- output/tty.go: TTY detection using golang.org/x/term
- output/tty_test.go: 100% test coverage for TTY detection

Modified files:
- output/logger.go: Add isTTY field and IsTTY()/GetWriter() methods
- output/logger_test.go: Tests for new logger methods
- cmd/root.go: Add --no-banner persistent flag
- cmd/scan.go: Display banner on scan command startup
- cmd/ci.go: Display banner on ci command startup
- main_test.go: Update help output test with --no-banner flag

Dependencies added:
- github.com/common-nighthawk/go-figure: ASCII art generation
- golang.org/x/term: TTY detection and terminal capabilities

Features:
- Smart banner display (full ASCII art in TTY, hidden in pipes/CI)
- --no-banner flag to disable banner display
- Automatic TTY detection for all logger instances
- 97% test coverage for output package

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@shivasurya shivasurya added the enhancement New feature or request label Jan 20, 2026
@shivasurya shivasurya self-assigned this Jan 20, 2026
@shivasurya shivasurya added the enhancement New feature or request label Jan 20, 2026
@safedep
Copy link

safedep bot commented Jan 20, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon github.com/common-nighthawk/go-figure @ v0.0.0-20210622060536-734e95fb86be
sast-engine/go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/sys @ v0.40.0
sast-engine/go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/term @ v0.39.0
sast-engine/go.mod
ok icon
ok icon
ok icon
🔗

This report is generated by SafeDep Github App

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.25%. Comparing base (e7ee09b) to head (aaa567b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sast-engine/cmd/ci.go 0.00% 5 Missing ⚠️
sast-engine/cmd/scan.go 0.00% 5 Missing ⚠️
sast-engine/output/tty.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
- Coverage   80.25%   80.25%   -0.01%     
==========================================
  Files          99      101       +2     
  Lines       10992    11051      +59     
==========================================
+ Hits         8822     8869      +47     
- Misses       1819     1830      +11     
- Partials      351      352       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Owner Author

shivasurya commented Jan 20, 2026

Copy link
Owner Author

shivasurya commented Jan 20, 2026

Merge activity

  • Jan 20, 3:40 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 20, 3:41 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya merged commit 423ca1d into main Jan 20, 2026
6 of 7 checks passed
@shivasurya shivasurya deleted the feature/cli-banner-tty-pr01 branch January 20, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants