Skip to content

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

Open
SecKatie wants to merge 6 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 6 commits into
mainfrom
claude/refactor-search-modules-market-tJsXW

Conversation

@SecKatie
Copy link
Copy Markdown
Collaborator

@SecKatie SecKatie commented May 13, 2026

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 a top-level unified search command that queries both the local registry and enabled marketplaces.
    • --local / --remote flags let you scope searches to one source.
  • Changes

    • Module-search documentation and commands updated to use the new unified search.
    • Installing a missing module from a marketplace will auto-add it to the local registry.

Review Change Stack

`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
@SecKatie SecKatie requested a review from Copilot May 13, 2026 12:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed8d19fd-6969-476c-b435-e59d13b0730f

📥 Commits

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

📒 Files selected for processing (3)
  • src/lola/cli/mod.py
  • src/lola/cli/search.py
  • tests/test_cli_search.py
✅ Files skipped from review due to trivial changes (1)
  • src/lola/cli/mod.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_cli_search.py

📝 Walkthrough

Walkthrough

Adds a top-level lola search command that queries the local module registry and enabled marketplace caches with --local and --remote flags, renders Rich-formatted local and marketplace results, and includes mutual-exclusivity and scope-specific "no modules found" tips.

Changes

Unified Search Command

Layer / File(s) Summary
Command imports and local search helper
src/lola/cli/search.py
Adds command-level docs, Click/Rich imports, Console initialization, and _search_local which matches query (case-insensitive) against module name, skills, commands, and agents.
Local results printing
src/lola/cli/search.py
Adds _print_local(results) to render the local registry header and per-module counts for skills/commands/agents using Rich formatting.
Marketplace output and CLI command
src/lola/cli/search.py
Adds _print_marketplace(results) to render marketplace matches and defines lola search <query> with --local/--remote flags, mutual-exclusivity validation, conditional local/marketplace searches, totals, and scope-specific empty-result tips.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through docs and code today,
I found the search that lights the way,
Local whispers, markets hum,
Flags decide where results come from,
A rabbit cheers — now searches play!

🚥 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 clearly summarizes the main change: replacing lola mod search with a new top-level lola search command, which is the primary refactor across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% 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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
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
@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
SecKatie and others added 2 commits May 13, 2026 09:16
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>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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

SecKatie and others added 2 commits May 13, 2026 15:29
- 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>
Comment thread src/lola/cli/search.py
@click.command(name="search")
@click.argument("query")
@click.option("--local", is_flag=True, help="Search only the local registry")
@click.option("--remote", is_flag=True, help="Search only enabled marketplaces")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The --local / --remote naming is a bit misplaced here. In Lola, everything lola search touches is already local on disk — the module registry is local, and the marketplace catalogs are locally cached YAML files too. Even marketplaces can be fully offline or federated from a local file. So the local vs remote distinction does not really map to what is happening under the hood.

What if we used names that are already familiar from the existing command structure? Something like --mod and --market — they map directly to lola mod and lola market, the two namespaces the data comes from:

lola search git             # search both (default)
lola search git --mod       # scope to lola mod registry only
lola search git --market    # scope to lola market catalogs only

This makes the flags immediately intuitive to anyone who already uses the CLI.

@mrbrandao
Copy link
Copy Markdown
Collaborator

mrbrandao commented May 21, 2026

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.

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