Add extensions framework for custom btcli plugins#879
Open
tmimmanuel wants to merge 5 commits intoopentensor:stagingfrom
Open
Add extensions framework for custom btcli plugins#879tmimmanuel wants to merge 5 commits intoopentensor:stagingfrom
tmimmanuel wants to merge 5 commits intoopentensor:stagingfrom
Conversation
Contributor
|
Read CONTRIBUTING.md |
Author
|
@thewhaleking I am really sorry for my mistake. |
d304fee to
0a4911c
Compare
thewhaleking
requested changes
Mar 30, 2026
Contributor
thewhaleking
left a comment
There was a problem hiding this comment.
I think overall this is going in the right direction, but I think it needs to finish its thought.
I think this is a good first step, but needs to be a bit better fleshed out. Ideally I would like to see a test extension that does something.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the extensions system proposed in #500. This allows developers to create, install, and manage custom btcli plugins without modifying the core codebase.
What changed
btcli extcommand group with subcommands:add,update,remove,list,create,test,run~/.bittensor/extensions/and validated via anextension.yamlmanifest (name, version, description, entry_point)ext createscaffolds a new extension with manifest, entry point, and test templateext runresolves the entry point from the manifest, avoiding hardcoded pathsbtcli extensionandbtcli extensionsare also registeredWhy
Currently there is no way to extend btcli with custom commands. This framework provides a standard structure for community-built plugins while keeping the core CLI clean. See #500 for the original proposal and discussion.
New files
bittensor_cli/src/commands/extensions/— extension management commands, manifest parsing, templatestests/unit_tests/test_extensions.py— 19 unit tests covering manifest parsing, directory helpers, and CLI commandsTest plan
btcli ext create test-extcreates boilerplate at~/.bittensor/extensions/test-ext/btcli ext listshows the created extensionbtcli ext run test-extprints "Hello from test-ext!"btcli ext test test-extruns and passes the scaffold testbtcli ext remove test-extremoves the extensionbtcli ext add <valid-repo-url>clones and validates manifestbtcli ext add <repo-without-manifest>fails gracefully and cleans upbtcli ext updatepulls latest for all installed extensionsbtcli extensions listandbtcli extension listwork as aliasespytest tests/unit_tests/test_extensions.py— all 19 unit tests passCloses #500