Add extensions framework for custom btcli plugins#879
Add extensions framework for custom btcli plugins#879tmimmanuel wants to merge 5 commits intolatent-to:stagingfrom
Conversation
|
Read CONTRIBUTING.md |
|
@thewhaleking I am really sorry for my mistake. |
d304fee to
0a4911c
Compare
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.
|
@thewhaleking Could you please review my updates? |
We're in the process of nailing down the spec for btcli v10 right now, so are going to pause on any feature development. |
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