Skip to content

feat(#8): Improve non-interactive mode and TTY detection - #49

Merged
admarble merged 1 commit into
mainfrom
feature/8-improve-non-interactive-mode-and-tty-detection
Jan 10, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/8-improve-non-interactive-mode-and-tty-detection

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add robust TTY detection with new src/lib/tty.ts module
  • Detect 12 CI environments (GitHub Actions, GitLab CI, CircleCI, Travis, Jenkins, etc.)
  • Add --interactive flag to force prompts in non-TTY environments
  • Graceful defaults in non-interactive mode (auto-detect stack, use sensible defaults)

Test plan

  • All 218 tests pass including 22 new TTY detection tests
  • Build succeeds
  • Manual: Run echo "" | npx sequant init to verify non-interactive detection
  • Manual: Run npx sequant init --interactive to verify force-interactive flag

Closes #8

🤖 Generated with Claude Code

Add robust TTY and CI environment detection for the init command:
- New tty.ts module with isStdinTTY, isStdoutTTY, isCI detection
- Support for 12 CI environments (GitHub Actions, GitLab CI, etc.)
- --interactive flag to force prompts in non-TTY environments
- Graceful defaults in non-interactive mode (auto-detect stack, use defaults)
- Clear messaging about why non-interactive mode was detected

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble

Copy link
Copy Markdown
Contributor Author

QA Review for Issue #8

AC Coverage

AC Description Status Notes
AC-1 Detect non-TTY environment gracefully ✅ MET tty.ts implements isStdinTTY(), isStdoutTTY(), isCI(), shouldUseInteractiveMode() with 22 unit tests
AC-2 Fallback to defaults without cryptic errors ✅ MET All prompts wrapped with TTY checks; uses detected stack or "generic", stack-specific devUrl
AC-3 Clear messaging about defaults chosen ✅ MET logDefault() outputs 📦 Using stack: generic (default); explains why non-interactive mode was triggered
AC-4 Works in CI environments ✅ MET Detects 12 CI environments (GitHub Actions, GitLab CI, CircleCI, Travis, Jenkins, Buildkite, Drone, TeamCity, Azure DevOps, AWS CodeBuild)

Coverage: 4/4 AC items fully met


Quality Metrics

Metric Value Status
Type issues (any) 0 ✅ OK
Deleted tests 0 ✅ OK
Files changed 5 ✅ OK
Lines added +527 -
Lines deleted -8 -
Test count 218 (22 new TTY + 16 updated init) ✅ OK

Code Review

Strengths:

  • Clean separation of concerns - TTY detection in dedicated src/lib/tty.ts module
  • Comprehensive test coverage (22 TTY tests + 16 init tests for non-interactive mode)
  • Type-safe implementation with proper TypeScript types
  • Clear, contextual user messaging showing why non-interactive mode was detected
  • Excellent CI coverage (12 environments)
  • --interactive flag provides escape hatch when needed

Issues:

  • None found

Suggestions:

  • None - implementation is complete and well-structured

Verdict: ✅ READY_FOR_MERGE

All acceptance criteria are met with high-quality implementation. The feature provides robust TTY detection, graceful defaults, clear messaging, and comprehensive CI support. Test coverage is excellent.

Next Steps

  1. Merge when ready
  2. Consider running manual tests from PR description:
    • echo "" | npx sequant init - verify non-interactive detection
    • npx sequant init --interactive - verify force-interactive flag

Documentation: Before merging, run /docs 8 to generate feature documentation.

🤖 QA review by Claude Code

@admarble
admarble merged commit 459318d into main Jan 10, 2026
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.

Improve non-interactive mode and TTY detection

1 participant