myk_pi_tools CLI Reference

This reference documents the subcommands available through the myk-pi-tools command line interface for database queries, code review handling, and managing project memory.

For information on how the daemon runs behind the scenes, see Daemon & Websocket Networking. For project-wide environment configurations, see Configuration & Settings.


Database Queries (myk-pi-tools db)

The db command group provides ad-hoc access to the SQLite reviews database for analytics and auto-skip logic.

db stats

Groups and returns review statistics based on source or reviewer.

Option Type Default Description
--by-source Flag True Group statistics by source (human, qodo, coderabbit)
--by-reviewer Flag False Group statistics by the reviewer author
--json Flag False Output results as JSON instead of formatted text table
--db-path String None Path to the SQLite database file
# Get stats grouped by source (default)
myk-pi-tools db stats

# Output reviewer stats as JSON
myk-pi-tools db stats --by-reviewer --json

db patterns

Identifies comments that appear multiple times with similar content, helping to identify potential auto-skip rules.

Option Type Default Description
--min Integer 2 Minimum number of occurrences to report
--json Flag False Output results as JSON
--db-path String None Path to the SQLite database file
# Find recurring patterns with at least 3 occurrences
myk-pi-tools db patterns --min 3

db dismissed

Retrieves all not_addressed or skipped comments for a repository.

Option Type Default Description
--owner String (Required) Repository owner (organization or user)
--repo String (Required) Repository name
--json Flag False Output results as JSON
--db-path String None Path to the SQLite database file
# View dismissed comments for the pi-config repo
myk-pi-tools db dismissed --owner myk-org --repo pi-config

db query

Runs a raw SELECT query against the review database.

Warning: Only SELECT statements are permitted for safety reasons.

Parameter/Option Type Default Description
sql String (Required) The SQL query to execute
--json Flag False Output results as JSON
--db-path String None Path to the SQLite database file
# Count comments grouped by status
myk-pi-tools db query "SELECT status, COUNT(*) as cnt FROM comments GROUP BY status"

db find-similar

Accepts JSON via stdin (requires path and body keys) and attempts to find a previously dismissed comment matching the exact file path and body similarity (Jaccard word overlap).

Option Type Default Description
--owner String (Required) Repository owner (organization or user)
--repo String (Required) Repository name
--threshold Float 0.6 Minimum similarity threshold (0.0 to 1.0)
--json Flag False Output results as JSON
--db-path String None Path to the SQLite database file
echo '{"path": "foo.py", "body": "Add error handling..."}' | \
  myk-pi-tools db find-similar --owner myk-org --repo pi-config --json

Review Handling (myk-pi-tools reviews)

Commands for managing pull request review fetch loops, automated Qodo interactions, and persistence.

reviews fetch

Fetches review threads from the current pull request and categorizes them by source (human, qodo, coderabbit). Saves output to <output-dir>/pr-<number>-reviews.json.

Parameter/Option Type Default Description
review_url String "" Optional specific review URL for context (e.g., #discussion_rXXX)
--include-resolved Flag False Include resolved threads in the fetch output
--user String None Filter threads by author username
--output-dir String (Required) Directory to write the output JSON file
myk-pi-tools reviews fetch --output-dir .pi/tmp/

reviews poll

Polls for reviews until new actionable comments appear.

Parameter/Option Type Default Description
review_url String "" Optional specific review URL
--source String coderabbit Which reviewer to poll for (coderabbit or qodo)
--output-dir String (Required) Directory to write the output JSON file
# Poll for Qodo comments
myk-pi-tools reviews poll --source qodo --output-dir .pi/tmp/

reviews post

Posts replies and resolves review threads based on status. Reads from a JSON file generated by reviews fetch and processed by the AI handler.

Parameter Type Default Description
json_path String (Required) Path to the JSON file containing the review payload
myk-pi-tools reviews post .pi/tmp/pr-42-reviews.json

reviews pending-fetch

Fetches the authenticated user's PENDING review and its comments from a GitHub PR.

Parameter/Option Type Default Description
pr_url String (Required) GitHub PR URL
--output-dir String (Required) Directory to write the output JSON file
myk-pi-tools reviews pending-fetch "https://github.com/owner/repo/pull/123" --output-dir .pi/tmp/

reviews pending-update

Updates accepted comment bodies in a pending review and optionally submits the review.

Parameter/Option Type Default Description
json_path String (Required) Path to the processed pending review JSON
--submit Flag False Submit the review immediately after updating comments
myk-pi-tools reviews pending-update .pi/tmp/pr-123-pending-review.json --submit

reviews status

Displays the review status for the current PR and generates an HTML report.

Option Type Default Description
--pr Integer None PR number (defaults to auto-detect from current branch)
--output-dir String (Required) Directory for output HTML report
myk-pi-tools reviews status --output-dir .pi/reports/

reviews ask-qodo

Posts a /qodo comment to ask a question and waits up to 10 minutes for a reply.

Parameter Type Default Description
args String (Required) The question string, optionally prepended with --pr owner/repo N
myk-pi-tools reviews ask-qodo "What edge cases are missing?"

reviews store

Stores completed review to the local SQLite database (.pi/data/reviews.db) for analytics, then deletes the JSON file.

Parameter Type Default Description
json_path String (Required) Path to the completed review JSON file
myk-pi-tools reviews store .pi/tmp/pr-42-reviews.json

Memory Management (myk-pi-tools memory)

Manual maintenance commands for reading, adding, or forgetting learned topics.

memory add

Adds a memory entry to the repository's topics directory.

Option Type Default Description
--category, -c String (Required) One of: lesson, decision, mistake, pattern, done, preference
--summary, -s String (Required) Short one-line description of the memory
--pinned Flag False Marks entry as user-requested (protected from automated pruning)
--file-path String None Global option: specific topics directory path
# Add a persistent user preference
myk-pi-tools memory add -c preference -s "Always use uv run" --pinned

memory show

Prints all memory entries across all topic markdown files.

Option Type Default Description
--file-path String None Global option: specific topics directory path
myk-pi-tools memory show

memory migrate

One-time migration script. Moves all entries from the legacy memories.db SQLite database to the file-backed topics directory.

Option Type Default Description
--file-path String None Global option: specific topics directory path
myk-pi-tools memory migrate

memory forget

Removes a specific memory entry if it exists in the active topic files.

Option Type Default Description
--category, -c String (Required) The category the memory belongs to
--summary, -s String (Required) The exact text of the entry to forget
--file-path String None Global option: specific topics directory path
myk-pi-tools memory forget -c mistake -s "Used pip instead of uv run"

memory path

Outputs the absolute directory path where project memory topics are stored.

Option Type Default Description
--file-path String None Global option: specific topics directory path
myk-pi-tools memory path

memory status

Shows the enforcement honesty inventory for project memory, analyzing code-tier implementations versus injected topic counts.

Tip: Used to ensure the AI's "learned" behaviors actually map cleanly to local hooks and rules.

Option Type Default Description
--file-path String None Global option: specific topics directory path
myk-pi-tools memory status