feat(cli): implement uninstall command and add log-level option

- Implement 'astrbot uninstall' to remove systemd service and data files
- Add '--log-level' option to 'astrbot run' (default: INFO)
- Pass log level config to core logger via env var
This commit is contained in:
LIghtJUNction
2026-03-16 23:55:36 +08:00
parent a05bfed15d
commit 6db0959bb1
7 changed files with 180 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
# user service
[Unit]
Description=AstrBot Service
Documentation=https://github.com/AstrBotDevs/AstrBot
After=network-online.target
Wants=network-online.target
@@ -9,6 +11,9 @@ WorkingDirectory=%h/.local/share/astrbot
ExecStart=/usr/bin/sh -c '/usr/bin/astrbot run || { /usr/bin/astrbot init && /usr/bin/astrbot run; }'
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=astrbot-%u
Environment=PYTHONUNBUFFERED=1
[Install]