feat(cli): add 'oh plugin enable' and 'oh plugin disable' subcommands - #327
Open
sridhar-3009 wants to merge 1 commit into
Open
feat(cli): add 'oh plugin enable' and 'oh plugin disable' subcommands#327sridhar-3009 wants to merge 1 commit into
sridhar-3009 wants to merge 1 commit into
Conversation
The README documents 'oh plugin enable <name>' but the CLI had no such subcommand. After 'oh plugin install <source>' a plugin landed in settings.enabled_plugins as False and the only way to turn it on was to launch the TUI and run /plugin enable foo — which blocked headless (oh -p "..."), CI, Docker, and remote SSH users. Add two plugin subcommands that mirror the /plugin slash handler in commands/registry.py: oh plugin enable <name> — set enabled_plugins[name] = True and save oh plugin disable <name> — set enabled_plugins[name] = False and save Both validate that the plugin key exists in settings.enabled_plugins (i.e. has been installed) and exit non-zero with a clear message if not. Fixes HKUDS#291
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
Closes #291
The README documents
oh plugin enable <name>/oh plugin disable <name>but those subcommands did not exist. Afteroh plugin install <source>a plugin was registered insettings.enabled_pluginsasFalse, and the only way to flip it was to open the TUI and run/plugin enable foo— which doesn't work for headless (oh -p "..."), CI, Docker, or SSH sessions.What's added:
Both commands:
settings.enabled_pluginsexactly as the/pluginslash handler incommands/registry.pydoes"Enabled/Disabled plugin 'X'. Restart session to reload."to match the TUI messageTest plan
oh plugin install <path>thenoh plugin enable <name>— verifysettings.enabled_plugins[name]isTrueinsettings.jsonoh plugin disable <name>— verify it's set toFalseoh plugin enable nonexistent— verify non-zero exit and helpful error messageoh plugin list— verify enabled/disabled state reflects the change