MCPcopy
hub / github.com/wshobson/agents / init

Function init

plugins/plugin-eval/src/plugin_eval/cli.py:133–147  ·  view source on GitHub ↗

Initialize corpus from a plugin directory.

(
    corpus_source: Path = typer.Argument(..., help="Path to plugins directory to index as corpus"),  # noqa: B008
    corpus_dir: Path = typer.Option(  # noqa: B008
        Path.home() / ".plugineval" / "corpus",  # noqa: B008
        help="Where to store corpus index",  # noqa: B008
    ),
)

Source from the content-addressed store, hash-verified

131
132@app.command()
133def init(
134 corpus_source: Path = typer.Argument(..., help="Path to plugins directory to index as corpus"), # noqa: B008
135 corpus_dir: Path = typer.Option( # noqa: B008
136 Path.home() / ".plugineval" / "corpus", # noqa: B008
137 help="Where to store corpus index", # noqa: B008
138 ),
139) -> None:
140 """Initialize corpus from a plugin directory."""
141 if not corpus_source.exists():
142 console.print(f"[red]Error: Source path does not exist: {corpus_source}[/red]")
143 raise typer.Exit(code=2)
144 from plugin_eval.corpus import Corpus # lazy import — Task 10
145
146 corpus = Corpus.init_from_source(corpus_source, corpus_dir)
147 console.print(f"[green]Corpus initialized with {corpus.size} skills at {corpus_dir}[/green]")
148
149
150@app.command()

Callers

nothing calls this directly

Calls 1

init_from_sourceMethod · 0.80

Tested by

no test coverage detected