Skip to content

Implement non-interactive logic: use AI suggestions regardless of confidence, provide defaults on failure #15

@shayonpal

Description

@shayonpal

Description

Implement the non-interactive execution logic when --popclip-mode flag is set. The script should never prompt for user input and should handle all scenarios automatically.

Acceptance Criteria

  • When --popclip-mode is set, always use AI suggestions regardless of confidence level
  • If AI categorization fails completely, implement sensible fallback defaults
  • Remove all input() calls when in PopClip mode
  • Provide appropriate exit codes for success/failure scenarios
  • Return status messages suitable for PopClip feedback

Context

This is the core implementation work for PopClip integration, building on the flag added in issue #14. This will make the script fully autonomous when triggered from PopClip.

Technical Implementation

Default Fallback Strategy

When AI fails in PopClip mode:

  • Collection: "General" or analyze content for keywords
  • Name: First 50 characters of content, cleaned up
  • Keyword: Generate from content (e.g., first word + timestamp)
  • Description: "Snippet created via PopClip"

Error Handling

  • Never use input() when --popclip-mode is True
  • Log errors but continue with defaults
  • Exit with appropriate codes (0 for success, 1 for failure)

Notification Changes

  • Suppress or modify macOS notifications in PopClip mode
  • Consider returning status via stdout for PopClip to display

Dependencies

Priority

Medium (P2) - Critical functionality for PopClip integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions