Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
!/blender/
!/inkscape/
!/audacity/
!/baota/
!/libreoffice/
!/zotero/
!/mubu/
Expand Down Expand Up @@ -106,6 +107,8 @@
/inkscape/.*
/audacity/*
/audacity/.*
/baota/*
/baota/.*
/libreoffice/*
/libreoffice/.*
/zotero/*
Expand Down Expand Up @@ -208,6 +211,7 @@
!/blender/agent-harness/
!/inkscape/agent-harness/
!/audacity/agent-harness/
!/baota/agent-harness/
!/libreoffice/agent-harness/
!/zotero/agent-harness/
!/mubu/agent-harness/
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,13 @@ Each application received complete, production-ready CLI interfaces — not demo
<td align="center">✅ 161</td>
</tr>
<tr>
<td align="center"><strong>🖥️ 宝塔 (Baota)</strong></td>
<td>Server Management</td>
<td><code>cli-anything-baota</code></td>
<td>Baota Panel API + Bridge</td>
<td align="center">✅ 121</td>
</tr>
<tr>
<td align="center"><strong>🌐 Browser</strong></td>
<td>Browser Automation</td>
<td><code>cli-anything-browser</code></td>
Expand Down Expand Up @@ -1205,6 +1212,7 @@ gimp 107 passed ✅ (64 unit + 43 e2e)
blender 208 passed ✅ (150 unit + 58 e2e)
inkscape 202 passed ✅ (148 unit + 54 e2e)
audacity 161 passed ✅ (107 unit + 54 e2e)
baota 121 passed ✅ (85 unit + 36 e2e)
libreoffice 158 passed ✅ (89 unit + 69 e2e)
mubu 96 passed ✅ (85 unit + 11 e2e)
obs-studio 153 passed ✅ (116 unit + 37 e2e)
Expand Down Expand Up @@ -1284,6 +1292,7 @@ cli-anything/
├── 🧊 blender/agent-harness/ # Blender CLI (208 tests)
├── ✏️ inkscape/agent-harness/ # Inkscape CLI (202 tests)
├── 🎵 audacity/agent-harness/ # Audacity CLI (161 tests)
├── 🖥️ baota/agent-harness/ # 宝塔 Baota Panel CLI (121 tests)
├── 🌐 browser/agent-harness/ # Browser CLI (DOMShell MCP, new)
├── 📄 libreoffice/agent-harness/ # LibreOffice CLI (158 tests)
├── 📧 mailchimp/agent-harness/ # Mailchimp Marketing API CLI (303 commands, 36 unit tests)
Expand Down
115 changes: 115 additions & 0 deletions baota/agent-harness/BAOTA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# 宝塔面板 (Baota Panel) CLI Harness - SOP

## Overview

宝塔面板 (Baota Panel) is a Linux server management panel with a web-based GUI. The source code is at `/www/server/panel/`. This CLI harness provides command-line access to all major panel functions.

## Architecture

### Source Layout
- `/www/server/panel/BT-Panel` - Main entry point (Python/Flask)
- `/www/server/panel/class/` - Core Python modules
- `ajax.py` - API endpoints
- `panelSite.py` - Website management (257 methods)
- `panelAuth.py` - Authentication
- `config.py` - Panel configuration
- `database.py` - Database management (MySQL)
- `files.py` - File management
- `public.py` - Shared utilities
- `panelFirewall.py` - Firewall management
- `panelSSL.py` - SSL certificate management
- `panelPlugin.py` - Plugin management
- `/www/server/panel/config/` - Configuration files
- `/www/server/panel/data/` - SQLite databases and runtime data
- `/www/server/panel/BTPanel/` - Flask web application

### Backend
- Python 3 + Flask web framework
- SQLite for panel data (data/default.db)
- Shell commands for system operations
- PluginLoader for C-extension module loading

## CLI Command Groups

### `sites` - Website Management
- `list` - List all websites
- `create` - Create a new website
- `delete` - Delete a website
- `start` - Start a website
- `stop` - Stop a website
- `info` - Get website details
- `domains` - Manage site domains
- `ssl` - Manage SSL certificates
- `php-version` - Get/set PHP version
- `path` - Get/set site path
- `limits` - Manage bandwidth limits
- `set-port <site_id> <port>` - Change a site's listening port

### `databases` - Database Management
- `list` - List all databases
- `create` - Create a database
- `delete` - Delete a database
- `backup` - Backup a database
- `user` - Manage database users

### `files` - File Management
- `list` - List files in a directory
- `upload` - Upload a file
- `download` - Download a file
- `delete` - Delete a file/directory
- `permissions` - Set file permissions

### `config` - Panel Configuration
- `show` - Show panel configuration
- `set` - Set configuration values
- `port` - Manage panel port
- `ssl` - Manage panel SSL
- `security` - Security settings
- `dns set` - Configure DNS API provider (DNSPod, Aliyun, Cloudflare)
- `dns list` - List configured DNS API providers
- `dns record add <domain> <subdomain> <type> <value>` - Add a DNS record
- `dns record list <domain>` - List DNS records for a domain
- `dns record delete <record_id>` - Delete a DNS record

### `system` - System Management
- `status` - Panel status
- `restart` - Restart panel services
- `logs` - View panel logs
- `info` - System information
- `network` - Show server IPv4/IPv6 addresses

### `plugins` - Plugin Management
- `list` - List installed plugins
- `install` - Install a plugin
- `uninstall` - Uninstall a plugin

### `cron` - Scheduled Task (计划任务) Management
- `list` - List all scheduled tasks
- `info` - Get details of a specific task
- `add` - Add a new scheduled task
- `delete` - Delete a scheduled task
- `start` - Start/enable a task
- `stop` - Stop/disable a task
- `check-le` - Check if Let's Encrypt renewal task exists and is active
- `ensure-le` - Ensure Let's Encrypt renewal task exists (create/restart if needed)

### `sites ssl deploy` - SSL Deploy Workflow
- Applies SSL certificate to a site
- Then checks/ensures Let's Encrypt auto-renewal cron task
- `--skip-ssl` flag to only run the renewal cron check

## Output Formats

- Default: Human-readable text
- `--json`: Machine-readable JSON output
- JSON structure: `{"status": true/false, "data": {...}, "msg": "..."}`

## REPL Mode

Run `cli-anything-baota` without arguments to enter REPL mode:
```
Baota CLI > sites list
Baota CLI > sites create --domain example.com --path /www/wwwroot/example.com
Baota CLI > config show
Baota CLI > exit
```
111 changes: 111 additions & 0 deletions baota/agent-harness/cli_anything/baota/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# cli-anything-baota

CLI harness for 宝塔面板 (Baota Panel) - a Linux server management panel.

## Installation

```bash
pip install cli-anything-baota
```

Or install from source:

```bash
cd agent-harness
pip install -e .
```

## Usage

### One-shot commands

```bash
# System management
cli-anything-baota system status
cli-anything-baota system restart
cli-anything-baota system info

# Site management
cli-anything-baota sites list
cli-anything-baota sites info 1
cli-anything-baota sites create --domain example.com --path /www/wwwroot/example.com

# Database management
cli-anything-baota databases list
cli-anything-baota databases create --name mydb --username myuser --password mypass

# File management
cli-anything-baota files list /www/wwwroot
cli-anything-baota files read /www/wwwroot/index.html

# Configuration
cli-anything-baota config show
cli-anything-baota config port 8888
cli-anything-baota config logs --lines 50
```

### DNS record management (via configured provider)

```bash
cli-anything-baota config dns record add example.org www A 198.51.100.1
cli-anything-baota config dns record list example.org
cli-anything-baota config dns record delete 123
```

### Site port modification

```bash
cli-anything-baota sites set-port 1 802
```

### Network information

```bash
cli-anything-baota system network
cli-anything-baota --json system network
```

### JSON output

```bash
cli-anything-baota --json sites list
cli-anything-baota --json system status
```

### Scheduled task management

```bash
cli-anything-baota cron list
cli-anything-baota cron check-le
cli-anything-baota cron ensure-le --site-id 1
cli-anything-baota cron start 3
cli-anything-baota cron stop 3
cli-anything-baota cron delete 3
```

### SSL deploy workflow (apply SSL + ensure renewal cron)

```bash
cli-anything-baota sites ssl deploy 1
cli-anything-baota sites ssl deploy 1 --domains example.com,www.example.com
cli-anything-baota sites ssl deploy 1 --skip-ssl
```

### REPL mode

```bash
cli-anything-baota
```

Then type commands interactively:

```
Baota CLI > sites list
Baota CLI > system status
Baota CLI > exit
```

## Requirements

- Baota Panel installed at `/www/server/panel/`
- Python 3.7+
1 change: 1 addition & 0 deletions baota/agent-harness/cli_anything/baota/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Baota Panel CLI - A command-line interface for 宝塔面板 server management."""
Loading
Loading