Skip to content

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

Open
krudo-taco wants to merge 1 commit 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 1 commit 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 on lines +152 to +156
def pqa_root() -> Path:
"""Return the `.pqa` directory used for indexes and saved settings."""
if pqa_home := os.environ.get("PQA_HOME"):
return Path(pqa_home) / ".pqa"
return Path.home() / ".pqa"
Comment on lines +161 to +164
directory = Path(index_directory)
if not directory.is_dir():
return []
return sorted(path.name for path in directory.iterdir() if path.is_dir())
show_pqa_paths(settings)
case _:
commands = ", ".join({"view", "ask", "search", "index"})
commands = ", ".join({"view", "ask", "search", "index", "where"})
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