Skip to content

feat: Add --print-body flag to wait command#9

Merged
sokripon merged 7 commits intosokripon:mainfrom
clawdbot-silly-waddle:feature/new-command
Jan 16, 2026
Merged

feat: Add --print-body flag to wait command#9
sokripon merged 7 commits intosokripon:mainfrom
clawdbot-silly-waddle:feature/new-command

Conversation

@clawdbot-silly-waddle
Copy link
Contributor

Summary

Adds an optional --print-body/-p parameter to the wait command that displays the email body when a new email is received.

Changes

  • Added --print-body/-p optional flag to wait command
  • When enabled, prints email text body after standard email info
  • If no text body is available, shows "No text body available" message
  • Maintains backward compatibility - flag defaults to False

Usage

# Wait for email and print body
tacomail wait abcde@tacomail.com --print-body

# Short form
tacomail wait abcde@tacomail.com -p

# Standard behavior (no body)
tacomail wait abcde@tacomail.com

Example output

Waiting for email to abcde@tacomail.com... (timeout: 30s)

✓ Email received!
  From: sender@example.com <sender@example.com>
  Subject: Test email

Email Body:
Hello! This is a test email message.

Done

Benefits

  • Useful for debugging email content
  • Can verify email text without logging into Tacomail dashboard
  • Helpful for automated testing and verification

The create-with-session command and its 'new' alias are already in
upstream/main, so the benefits section is no longer needed.
- **lint.yml**: Run linter (ruff) and type checking (mypy) on every push and PR
- **tests.yml**: Run basic tests that don't require email sending on every push and PR
- **email-tests.yml**: Run tests that require Postmark email sending only on manual trigger

Benefits:
- Linting runs fast on every PR without waiting for long test runs
- Basic API tests run on every PR without requiring Postmark secrets
- Email sending tests only run when manually triggered by maintainer with secrets
- Uses pytest markers ("flow") to separate tests by dependencies

This fixes the issue where PRs from forks fail due to missing Postmark secrets.
mypy is not available in the project, so remove it from lint workflow.
Ruff provides sufficient linting capabilities.
- test_email_sender_initialization() creates PostmarkEmailSender without session
- test_wait_for_email_async() sends test email using PostmarkEmailSender
- test_wait_for_email_filtered_async() sends test emails using PostmarkEmailSender

These tests now properly excluded from basic tests workflow via -m "not flow"
Adds optional --print-body/-p parameter to wait command that displays
the email body when a new email is received.

Usage:
  tacomail wait <email> --print-body
  tacomail wait <email> -p

If no text body is available, a message is shown instead.
- Remove incorrectly placed print_body parameter from create function
- Fix f-string without placeholders (unnecessary f prefix)

All linting now passes with ruff check.
@sokripon sokripon merged commit 163f9e6 into sokripon:main Jan 16, 2026
2 checks passed
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.

2 participants