Skip to content

Conversation

@crossjam
Copy link
Owner

@crossjam crossjam commented Nov 20, 2025

This PR implements the subcommand for Usage: prompthound [OPTIONS] COMMAND [ARGS]...

A command-line tool for interacting with the prompthound package.

Options:
--log-level [TRACE|DEBUG|INFO|SUCCESS|WARNING|ERROR|CRITICAL]
Set the log level for the command.
[default: WARNING]
--log-file FILE Path to a file for logging.
--help Show this message and exit.

Commands:
init Initialize the prompthound database.
main The main entry point for the prompthound CLI. as described in GitHub issue #4.

Task Checklist

  • 1. Create subcommand:

    • Add an subcommand to .
    • The subcommand should accept a list of filenames as arguments.
    • The subcommand should be able to read from if no filenames are provided.
    • Add a option to specify the database path.
  • 2. Implement Database Handling:

    • Use a default database path of in the appropriate user data directory.
    • If the database file specified by exists, prompt the user for confirmation before overwriting.
    • Initialize the database schema if the database is new or overwritten.
  • 3. Implement Ingestion Logic:

    • Read and parse feed data from files or .
    • Use the library to ingest the data.
    • Ensure that feed items are inserted only once to prevent duplicates.
  • 4. Add Error Handling:

    • Implement error handling for file I/O operations.
    • Implement error handling for database operations.
    • Implement error handling for feed parsing.
  • 5. Create Tests:

    • Add unit tests for the subcommand.
    • Test reading from files.
    • Test reading from .
    • Test the option.
    • Test overwriting an existing database.
    • Test with the existing test data in .
    • Test duplicate feed item handling.

@crossjam crossjam linked an issue Nov 20, 2025 that may be closed by this pull request
@crossjam crossjam self-assigned this Nov 20, 2025
Addresses the core functionality of the  subcommand for Usage: prompthound [OPTIONS] COMMAND [ARGS]...

  A command-line tool for interacting with the prompthound package.

Options:
  --log-level [TRACE|DEBUG|INFO|SUCCESS|WARNING|ERROR|CRITICAL]
                                  Set the log level for the command.
                                  [default: WARNING]
  --log-file FILE                 Path to a file for logging.
  --help                          Show this message and exit.

Commands:
  ingest  Ingest feed data from files or stdin.
  init    Initialize the prompthound database.
  main    The main entry point for the prompthound CLI..

- Reads feed file content from command-line filenames or standard input.
- Defaults to  in the OS-specific user data directory, with a  option for custom paths.
- Overwrites an existing database with user confirmation.
- Initializes the  schema for new or overwritten databases.
- Prevents duplicate feed items (identified by URL) during ingestion.
- Includes comprehensive tests for various input scenarios and data files.
- Adds  and Poe the Poet (version 0.37.0)

Result: No task specified.

Usage:
  poe [global options] task [task arguments]

Global options:
  -h, --help [TASK]     Show this help page and exit, optionally supply a
                        task.
  --version             Print the version and exit
  -v, --verbose         Increase output (repeatable)
  -q, --quiet           Decrease output (repeatable)
  -d, --dry-run         Print the task contents but don't actually run it
  -C, --directory PATH  Specify where to find the pyproject.toml
  -e, --executor EXECUTOR
                        Override the default task executor
  --ansi                Force enable ANSI output
  --no-ansi             Force disable ANSI output

Configured tasks:
  lint                  Run ruff linter on source and test files
  lint:fix              Run ruff linter and auto-fix issues
  type                  Run ty type checker on source files
  test                  Run pytest with verbose output
  test:cov              Run pytest with coverage report (terminal + HTML)
  test:quick            Run pytest and stop on first failure
  qa                    Run all QA checks (lint, type, test) configurations to .
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.

Implement feed file data ingest

2 participants