MCPcopy Index your code
hub / github.com/github/spec-kit / bundle_search

Function bundle_search

src/specify_cli/commands/bundle/__init__.py:143–191  ·  view source on GitHub ↗

List matching bundles across the active catalog stack.

(
    query: str = typer.Argument("", help="Optional text query"),
    offline: bool = typer.Option(False, "--offline", help="Do not access the network"),
    as_json: bool = typer.Option(False, "--json", help="Emit JSON to stdout"),
)

Source from the content-addressed store, hash-verified

141
142@bundle_app.command("search")
143def bundle_search(
144 query: str = typer.Argument("", help="Optional text query"),
145 offline: bool = typer.Option(False, "--offline", help="Do not access the network"),
146 as_json: bool = typer.Option(False, "--json", help="Emit JSON to stdout"),
147) -> None:
148 """List matching bundles across the active catalog stack."""
149 try:
150 project_root = find_project_root() or Path.cwd()
151 stack = _build_stack(project_root, offline=offline)
152 results = stack.search(query)
153 except BundlerError as exc:
154 _fail(str(exc))
155 return
156
157 if as_json:
158 payload = [
159 {
160 "id": r.entry.id,
161 "name": r.entry.name,
162 "role": r.entry.role,
163 "version": r.entry.version,
164 "description": r.entry.description,
165 "source": r.source.id,
166 "install_policy": r.source.install_policy.value,
167 "verified": r.entry.verified,
168 "trust": _trust_level(r.entry.verified),
169 }
170 for r in results
171 ]
172 print(_json.dumps(payload, indent=2))
173 return
174
175 if not results:
176 console.print("[yellow]No matching bundles found.[/yellow]")
177 return
178
179 console.print("\n[bold cyan]Bundles:[/bold cyan]\n")
180 for r in results:
181 policy = (
182 "[dim](discovery-only)[/dim]"
183 if not r.source.install_allowed
184 else ""
185 )
186 console.print(
187 f" [bold]{r.entry.id}[/bold] v{r.entry.version} — {r.entry.name} "
188 f"[dim]({r.entry.role})[/dim] {_trust_badge(r.entry.verified)} {policy}"
189 )
190 console.print(f" {r.entry.description}")
191 console.print(f" [dim]source: {r.source.id}[/dim]")
192
193
194@bundle_app.command("info")

Callers

nothing calls this directly

Calls 7

find_project_rootFunction · 0.85
_build_stackFunction · 0.85
_failFunction · 0.85
_trust_levelFunction · 0.85
_trust_badgeFunction · 0.85
printMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected