mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-17 17:51:20 +08:00
feat: add CLI commands documentation and service management features
- Updated the VitePress configuration to include links to CLI commands in both English and Chinese. - Enhanced the AstrBot deployment documentation with instructions for installing it as a system service. - Created comprehensive CLI commands documentation covering initialization, service management, configuration, and plugin management. - Added tests for CLI command aliases and service functionalities to ensure proper command registration and behavior. - Implemented service log management features, including enabling application logging and controlling log visibility.
This commit is contained in:
25
tests/test_cli_command_aliases.py
Normal file
25
tests/test_cli_command_aliases.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from click.testing import CliRunner
|
||||
|
||||
from astrbot.cli.__main__ import cli
|
||||
|
||||
|
||||
def test_top_level_help_uses_product_command_names():
|
||||
result = CliRunner().invoke(cli, ["help"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "config" in result.output
|
||||
assert "plugin" in result.output
|
||||
assert " conf " not in result.output
|
||||
assert " plug " not in result.output
|
||||
|
||||
|
||||
def test_legacy_config_and_plugin_aliases_still_work():
|
||||
runner = CliRunner()
|
||||
|
||||
config_result = runner.invoke(cli, ["help", "conf"])
|
||||
plugin_result = runner.invoke(cli, ["help", "plug"])
|
||||
|
||||
assert config_result.exit_code == 0
|
||||
assert "Configuration management commands" in config_result.output
|
||||
assert plugin_result.exit_code == 0
|
||||
assert "Plugin management" in plugin_result.output
|
||||
Reference in New Issue
Block a user