Skip to content

refactor(cli): replace lola mod search with top-level lola search#124

Open
SecKatie wants to merge 7 commits into
mainfrom
claude/refactor-search-modules-market-tJsXW
Open

refactor(cli): replace lola mod search with top-level lola search#124
SecKatie wants to merge 7 commits into
mainfrom
claude/refactor-search-modules-market-tJsXW

Conversation

@SecKatie

@SecKatie SecKatie commented May 13, 2026

Copy link
Copy Markdown
Collaborator

lola mod search previously searched remote marketplaces, which was a
confusing name given the command lives under mod. Replace it with a
single top-level lola search that searches both the local module
registry and enabled marketplace caches. Use --local or --remote to
scope to one side.

  • Local matches: module name, skill name, command name, or agent name
  • Marketplace matches: module name, description, or tag

Breaking change: scripts using lola mod search must switch to
lola search (add --remote to preserve the previous marketplace-only
behavior).

Examples

lola search git              # search both local and remote
lola search git --local      # only the local registry
lola search git --remote     # only enabled marketplaces

https://claude.ai/code/session_01EkBsZCC4Uo5MCLyay9mmMn

Summary

  • New Features
    • Added top-level lola search command that searches the local module registry and enabled marketplace caches in one pass, with --local / --remote flags to scope
  • Changes
    • Removed lola mod search; use lola search (or lola search --remote for the prior marketplace-only behavior)
  • Documentation
    • Updated CLI reference, quick-start, and marketplace guide to reflect the unified search command

Summary by CodeRabbit

  • New Features

    • Added top-level lola search that queries both the local registry and enabled marketplaces; lola mod search is a deprecated alias for local-only searches.
  • Changes

    • Replaced --local/--remote with mutually exclusive --mod/--market flags to scope searches.
    • Improved search output with separate local and marketplace sections, totals, and scoped hints when no results.
    • lola install <module> now auto-adds from marketplace when missing locally.
  • Documentation

    • CLI docs, guides, and examples updated to reflect the new command and flags.
  • Tests

    • Added tests covering search behavior, scoping, hints, and the deprecation alias.

@SecKatie SecKatie requested a review from Copilot May 13, 2026 12:19
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39f7c727-b99b-4791-b841-36b2145e0097

📥 Commits

Reviewing files that changed from the base of the PR and between 4e0b8df and c5bc148.

📒 Files selected for processing (9)
  • AGENTS.md
  • CLAUDE.md
  • docs/cli-reference/index.md
  • docs/getting-started/quick-start.md
  • docs/guides/marketplace.md
  • src/lola/__main__.py
  • src/lola/cli/mod.py
  • src/lola/cli/search.py
  • tests/test_cli_search.py
✅ Files skipped from review due to trivial changes (4)
  • AGENTS.md
  • docs/guides/marketplace.md
  • docs/cli-reference/index.md
  • CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/getting-started/quick-start.md
  • tests/test_cli_search.py
  • src/lola/cli/search.py

📝 Walkthrough

Walkthrough

Adds a top-level lola search command that queries the local module registry and enabled marketplace caches with --mod and --market flags, renders Rich-formatted local and marketplace results, enforces mutual-exclusivity, provides scope-specific empty-state tips, adds tests, updates docs, and retains lola mod search as a deprecated local-only alias.

Changes

Unified Search Command and Mod Compatibility

Layer / File(s) Summary
CLI imports and local search helper
src/lola/cli/search.py
Adds module docstring, Click + Rich imports, Console init, and _search_local to match query (case-insensitive) against module name, skills, commands, and agents.
Local results printing
src/lola/cli/search.py
Adds _print_local(results) to render local registry matches and per-module skill/command/agent counts using count_str.
Marketplace output and CLI command
src/lola/cli/search.py
Adds _print_marketplace(results) and defines lola search <query> with --mod/--market flags, mutual-exclusivity validation, conditional local/marketplace searches, totals, and scope-specific empty-result tips.
mod compatibility wrapper and count rename
src/lola/cli/mod.py
Renames _count_strcount_str, updates mod ls/mod update usages, and replaces lola mod search with a Click wrapper that emits a deprecation warning and forwards to search_cmd(mod=True, market=False).
Top-level command registration
src/lola/__main__.py
Imports and registers search_cmd on the top-level Click group.
Documentation updates
AGENTS.md, CLAUDE.md, docs/cli-reference/index.md, docs/guides/marketplace.md, docs/getting-started/quick-start.md
Replaces examples and docs to document lola search <query> behavior, --mod/--market scoping, and marks lola mod search as deprecated alias; updates quick-start example to use lola market search.
Tests for search CLI
tests/test_cli_search.py
Adds fixtures and tests covering help/missing-arg, local and remote matching, scope flags (including mutual-exclusivity), empty-results messaging, and lola mod search compatibility + deprecation output.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through docs and code today,
I taught the CLI a broader way,
Local and market, flags decide,
Deprecated whispers tucked aside,
A tiny rabbit cheers, hip-hip-hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring the CLI to replace lola mod search with a top-level lola search command, which is the central focus of all modifications across documentation and code.
Docstring Coverage ✅ Passed Docstring coverage is 91.18% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/refactor-search-modules-market-tJsXW

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Refactors CLI search behavior to reduce confusion: lola mod search now searches the local module registry, while remote marketplace discovery is moved to a new lola market search command (a breaking change for scripts relying on the old behavior).

Changes:

  • Repurposes lola mod search to do a case-insensitive substring search across local module names, skills, commands, and agents.
  • Adds lola market search to search across enabled marketplace caches (previous mod search behavior).
  • Updates docs and CLI reference to reflect the new command split and breaking change.

Reviewed changes

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

Show a summary per file
File Description
src/lola/cli/mod.py Changes mod search to search the local registry and formats local results for display.
src/lola/cli/market.py Adds new market search subcommand that delegates to MarketplaceRegistry.search().
docs/guides/marketplace.md Updates marketplace search example to use lola market search.
docs/getting-started/quick-start.md Updates quick-start marketplace search example to use lola market search.
docs/cli-reference/index.md Updates mod search description and adds market search to the command table.
CLAUDE.md Updates recent-changes notes to reflect the new command split.
AGENTS.md Updates architecture notes to distinguish local vs marketplace search commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lola/cli/mod.py Outdated
Comment thread src/lola/cli/market.py Outdated
Comment thread src/lola/cli/mod.py Outdated
@SecKatie SecKatie changed the title refactor(cli): split search into mod search and market search refactor(cli): replace lola mod search with top-level lola search May 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lola/cli/search.py (1)

60-65: ⚡ Quick win

Consider adding validation to prevent confusion when both --local and --remote are provided.

On lines 60-65, both --local and --remote map to the same scope parameter. When both flags are provided, Click applies "last one wins" (standard Click behavior), so lola search git --local --remote silently searches remote only. While this works correctly, users might not expect this behavior. Adding a validation callback to reject both flags together or documenting the behavior explicitly would improve clarity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lola/cli/search.py` around lines 60 - 65, The two Click options "--local"
and "--remote" both write to the same "scope" parameter, which lets Click
silently accept both and use the last one; add a validation callback on the
Click options (or on the command) to detect when both flags are passed and raise
a Click.UsageError, or explicitly document the "last-one-wins" behavior;
specifically modify the Click option declarations for "--local" and "--remote"
(or the command function handling search, e.g., the search(...) handler that
accepts scope) to include a callback that checks if both flags were set and
rejects the invocation with a clear error message like "Cannot specify both
--local and --remote".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lola/cli/search.py`:
- Around line 60-65: The two Click options "--local" and "--remote" both write
to the same "scope" parameter, which lets Click silently accept both and use the
last one; add a validation callback on the Click options (or on the command) to
detect when both flags are passed and raise a Click.UsageError, or explicitly
document the "last-one-wins" behavior; specifically modify the Click option
declarations for "--local" and "--remote" (or the command function handling
search, e.g., the search(...) handler that accepts scope) to include a callback
that checks if both flags were set and rejects the invocation with a clear error
message like "Cannot specify both --local and --remote".

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f48821f9-cad9-484e-a2a4-9b7139074c0d

📥 Commits

Reviewing files that changed from the base of the PR and between 549f745 and b224128.

📒 Files selected for processing (9)
  • AGENTS.md
  • CLAUDE.md
  • docs/cli-reference/index.md
  • docs/getting-started/quick-start.md
  • docs/guides/marketplace.md
  • src/lola/__main__.py
  • src/lola/cli/mod.py
  • src/lola/cli/search.py
  • tests/test_cli_search.py
💤 Files with no reviewable changes (1)
  • src/lola/cli/mod.py
✅ Files skipped from review due to trivial changes (2)
  • AGENTS.md
  • docs/getting-started/quick-start.md

Comment thread src/lola/cli/search.py Outdated
@mrbrandao

mrbrandao commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Removing lola mod search is a breaking change for users who have scripts depending on it. Would it be possible to keep it as a thin alias pointing to lola search --mod/local? That keeps retro-compatibility so no scripts break, while the new unified lola search becomes the canonical way.

@SecKatie

SecKatie commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Finally getting back to this. I'll submit a fix here shortly.

@SecKatie

SecKatie commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

@mrbrandao I resolved the comments and updated the PR!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/test_cli_search.py (1)

299-309: ⚡ Quick win

Assert stderr-only deprecation behavior explicitly.

This test only verifies that “deprecated” appears somewhere in output, but it doesn’t enforce the compatibility contract that the warning must be on stderr while stdout stays parser-safe.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_cli_search.py` around lines 299 - 309, Update the
test_mod_search_emits_deprecation_notice to explicitly assert that the
deprecation message is emitted on stderr and that stdout remains parser-safe:
after invoking mod with cli_runner, assert that "deprecated" (or the exact
deprecation text) appears in result.stderr, assert that result.stdout does not
contain the deprecation text (and/or equals the expected parser-safe output,
e.g., empty or machine-oriented output), and keep references to the same test
function and the imported mod from lola.cli.mod when making these assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/test_cli_search.py`:
- Around line 299-309: Update the test_mod_search_emits_deprecation_notice to
explicitly assert that the deprecation message is emitted on stderr and that
stdout remains parser-safe: after invoking mod with cli_runner, assert that
"deprecated" (or the exact deprecation text) appears in result.stderr, assert
that result.stdout does not contain the deprecation text (and/or equals the
expected parser-safe output, e.g., empty or machine-oriented output), and keep
references to the same test function and the imported mod from lola.cli.mod when
making these assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a5088187-aa0f-4cae-a05c-9adbefdb0296

📥 Commits

Reviewing files that changed from the base of the PR and between d6fe31d and 4e0b8df.

📒 Files selected for processing (7)
  • AGENTS.md
  • CLAUDE.md
  • docs/cli-reference/index.md
  • docs/guides/marketplace.md
  • src/lola/cli/mod.py
  • src/lola/cli/search.py
  • tests/test_cli_search.py
✅ Files skipped from review due to trivial changes (3)
  • docs/guides/marketplace.md
  • CLAUDE.md
  • docs/cli-reference/index.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

claude and others added 7 commits June 5, 2026 14:48
`lola mod search` previously searched remote marketplaces, which was a
confusing name given the command lives under `mod`. Move that behavior
to `lola market search` (where it belongs) and repurpose `lola mod
search` to search the local module registry by name, skill, command, or
agent.

Breaking change: scripts using `lola mod search` to search marketplaces
must switch to `lola market search`.

https://claude.ai/code/session_01EkBsZCC4Uo5MCLyay9mmMn
Replace `lola mod search` and `lola market search` with a single top-level
`lola search <query>` that searches both the local registry and all enabled
marketplaces, with optional `--local` / `--remote` flags to scope.

Local matches use module name, skill name, command name, and agent name.
Marketplace matches use module name, description, and tags. Results are
rendered in two clearly-labelled sections.

Breaking change: scripts using `lola mod search` or `lola market search`
must switch to `lola search`.

https://claude.ai/code/session_01EkBsZCC4Uo5MCLyay9mmMn
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers help/registration, local matching (by module/skill/command/agent
name, case-insensitive), remote matching (by name and tag), --local /
--remote scope flags, the three empty-result tips, and that `lola mod
search` is no longer registered. Also drops the redundant
ensure_lola_dirs() call in search_cmd; list_registered_modules() already
handles it on the local path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Import _count_str from lola.cli.mod instead of redefining it in
  search.py; use it for the section headers in _print_local /
  _print_marketplace instead of recomputing `plural` inline.
- Add a `search_env` fixture in test_cli_search.py that creates
  market_dir/cache_dir and patches MARKET_DIR/CACHE_DIR via monkeypatch,
  replacing ~6 lines of repeated setup in each test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address PR review feedback:

- Rename the `lola search` scope flags from `--local`/`--remote` to
  `--mod`/`--market` for clearer registry-vs-marketplace naming.
- Restore `lola mod search` as a thin compatibility alias that forwards
  to `lola search <query> --mod`, so existing scripts keep working. The
  deprecation notice is written to stderr so stdout stays byte-identical
  to `lola search --mod` for scripts parsing the results.
- Keep the mutual-exclusivity guard so `--mod --market` errors clearly.
- Update docs (CLI reference, marketplace guide), AGENTS.md, CLAUDE.md,
  and tests to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SecKatie SecKatie force-pushed the claude/refactor-search-modules-market-tJsXW branch from 4e0b8df to c5bc148 Compare June 5, 2026 18:48
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.

4 participants