Skip to content

feat(cli): add pqa where to print the .pqa directory and indexes - #1350

Open
krudo-taco wants to merge 2 commits into
Future-House:mainfrom
krudo-taco:cli/print-pqa-directory
Open

feat(cli): add pqa where to print the .pqa directory and indexes#1350
krudo-taco wants to merge 2 commits into
Future-House:mainfrom
krudo-taco:cli/print-pqa-directory

Conversation

@krudo-taco

Copy link
Copy Markdown

Fixes #891.

Adds pqa where so the CLI can print:

  • the .pqa directory ($PQA_HOME/.pqa or ~/.pqa)
  • the configured index directory
  • names of built indexes (child directories only)

Validation: tests/test_cli.py::test_cli_where_prints_pqa_directory_and_indexes and tests/test_cli.py::test_list_built_indexes_skips_files_and_missing_dirs passed.

Print the PQA home directory, the configured index directory, and the
names of built indexes so users can find cached data without guessing
PQA_HOME.

Fixes Future-House#891.
Copilot AI lite review requested due to automatic review settings August 27, 2026 16:38
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new paperqa where CLI subcommand to help users discover where PaperQA stores its local .pqa data and what indexes exist, addressing the “where is the index stored?” request from #891.

Changes:

  • Introduces where CLI command that logs the .pqa root directory, configured index directory, and built index names.
  • Adds helpers (pqa_root, list_built_indexes, show_pqa_paths) to support the new command.
  • Adds CLI tests covering the printed paths and directory-only index listing behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/test_cli.py Adds tests validating paperqa where output and list_built_indexes directory filtering behavior.
src/paperqa/agents/init.py Implements the where subcommand and supporting helpers for path/index reporting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/paperqa/agents/__init__.py
Comment thread src/paperqa/agents/__init__.py Outdated
Comment thread src/paperqa/agents/__init__.py Outdated
Expand ~ in PQA_HOME for both pqa_root() and pqa_directory(),
catch OSError from iterdir() in list_built_indexes(), and print
CLI commands from a tuple so the fallback help order is stable.
@krudo-taco

Copy link
Copy Markdown
Author

Addressed the Copilot review comments:

  • expand ~ in PQA_HOME for both pqa_root() and pqa_directory()
  • catch OSError from iterdir() in list_built_indexes() and return []
  • print CLI commands from a tuple so the fallback help order is stable

Covered by tests/test_cli.py.

@krudo-taco

Copy link
Copy Markdown
Author

Addressed in 006f4c4:

  • expand ~ in PQA_HOME for both pqa_root() and pqa_directory()
  • catch OSError from iterdir() in list_built_indexes() and return []
  • print CLI commands from a tuple so the fallback help order is stable

Validation: uv run pytest tests/test_cli.py -k 'where or list_built or pqa_root or missing_command' -q — 5 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI command to print .pqa directory

2 participants