6.6 KiB
name, description
| name | description |
|---|---|
| install-beatsaber-plugin | Install or update a Beat Saber plugin in the plugin-helper repo by using the local helper workflow. Use when the user asks to add, install, update, bump, lock, or manage a Beat Saber plugin release for a BSManager instance. The user must provide an explicit GitHub release URL in the prompt; if no release URL is present, ask for one and do not infer, search for, or substitute a different repository. |
Install Beat Saber Plugin
Use the repository's own plugin-helper commands to manage plugins for BSManager instances. Do not manually copy release files into the game instance except to undo your own mistaken install before rerunning the helper.
Hard Guardrail
Require an explicit GitHub release URL from the user's prompt before selecting any release or repository.
- If the prompt does not contain a GitHub release URL, stop and ask the user for it.
- Do not search the web to discover a repository or "correct" release URL.
- Do not substitute a similar repo, fork, project, or package name.
- If the provided URL is a general releases page, use that repo's release API and choose the latest non-draft, non-prerelease release unless the user asks for a specific tag/version.
- If the provided URL is a tag URL, use that exact tag.
Accepted URL shapes include:
https://github.com/<owner>/<repo>/releases
https://github.com/<owner>/<repo>/releases/tag/<tag>
https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
Workflow
-
Confirm the workspace is the
plugin-helperrepo.test -f pyproject.toml && test -d src/plugin_helper && test -d registry && test -d locks -
Read the local helper behavior before changing files.
Inspect at least:
sed -n '1,220p' README.md sed -n '1,260p' src/plugin_helper/cli.py sed -n '1,260p' src/plugin_helper/planner.py sed -n '1,220p' src/plugin_helper/models.py sed -n '1,220p' registry/plugins.toml sed -n '1,220p' locks/<instance>.lock.toml -
Determine the instance.
Prefer the instance the user names. If omitted and the working context clearly points at one lockfile, use that instance. Otherwise run:
PYTHONPATH=src python -m plugin_helper instances -
Snapshot first when requested.
If the user asks for a one-time or pre-helper snapshot, archive the instance's
Plugins/directory before any install:mkdir -p "$HOME/archive/beatsaber" tar -C "<instance-root>/<instance>" -czf "$HOME/archive/beatsaber/<instance>-Plugins-pre-helper-<timestamp>.tar.gz" Plugins sha256sum "$HOME/archive/beatsaber/<instance>-Plugins-pre-helper-<timestamp>.tar.gz"Report the archive path and hash.
-
Resolve the release from the user-provided URL only.
For GitHub URLs, derive
<owner>/<repo>and optional<tag>from the URL. Query the GitHub API directly for metadata:curl -sS https://api.github.com/repos/<owner>/<repo>/releases curl -sS https://api.github.com/repos/<owner>/<repo>/releases/tags/<tag>Pick the asset that matches the Beat Saber instance/version. Prefer an exact versioned asset such as
1.40.8.zipover broad or source archives. If multiple plausible assets remain, ask the user. -
Inspect the asset before selecting an install strategy.
Download to the helper state directory:
mkdir -p .state/instances/<instance>/downloads curl -L --fail -o .state/instances/<instance>/downloads/<asset-name> "<browser_download_url>" sha256sum .state/instances/<instance>/downloads/<asset-name>Match the checksum against GitHub's
digestwhen available. Inspect zip contents:unzip -l .state/instances/<instance>/downloads/<asset-name>Strategy guide:
dll-to-plugins: asset is a single.dllthat belongs inPlugins/.bsipa-zip: zip top-level paths are onlyIPA/,Libs/, orPlugins/.root-zip: zip contains valid game-root paths outside the BSIPA top-level set.zip-to-pending: only when the release is intended forIPA/Pending/.manual: do not use for installable releases.
-
Update the registry and lockfile.
Add or update exactly one
[[plugins]]entry inregistry/plugins.tomlwith:[[plugins]] id = "<stable-plugin-id>" name = "<human name>" repo = "<owner>/<repo>" asset_patterns = ["<asset-name-or-pattern>"] install_strategy = "<strategy>" category = "<category-if-obvious>"Add or update the matching
[[plugins]]entry inlocks/<instance>.lock.tomlwith:[[plugins]] id = "<stable-plugin-id>" repo = "<owner>/<repo>" tag = "<tag>" asset = "<asset-name>" sha256 = "<asset-sha256>"Preserve unrelated registry and lockfile content. Do not invent dependency versions unless they are explicitly stated by the provided release notes or existing local metadata.
-
Use the helper to validate, plan, and apply.
Always pass
--state-dir .stateso the helper uses the repo-local downloaded asset:PYTHONPATH=src python -m plugin_helper --state-dir .state check --instance <instance> PYTHONPATH=src python -m plugin_helper --state-dir .state plan --instance <instance> --plugin <plugin-id> PYTHONPATH=src python -m plugin_helper --state-dir .state apply <generated-plan-path>Before applying, read or summarize the generated plan enough to confirm it changes only the intended plugin files.
-
Verify the result.
Confirm the installed file hashes match the plan or archive members:
PYTHONPATH=src python -m plugin_helper --state-dir .state state --instance <instance> PYTHONPATH=src python -m plugin_helper --state-dir .state check --instance <instance> PYTHONPATH=src python -m unittest discover -s testsUse
PYTHONPATH=src; plainpython -m unittestmay fail in this source-layout repo. -
Final response.
Include:
- release URL/tag/asset used
- snapshot path and hash, if created
- files changed in the repo and helper state
- live instance files changed
- backup path created by the helper
- validation commands and results
Mistake Recovery
If you installed from the wrong release or repo during the current task:
- Restore affected live files from the helper backup created by that mistaken apply.
- Remove mistaken downloaded assets and mistaken plan files from
.state. - Correct the registry and lockfile to the user-provided release URL.
- Rerun
check,plan, andapplywith--state-dir .state. - Keep or report only the backup relevant to the final correct apply unless the user asks for full audit history.