PHPackages                             xbot-my/xbot-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. xbot-my/xbot-utils

ActiveLibrary

xbot-my/xbot-utils
==================

Utility tools for develop or manage project.

v1.0.7(4mo ago)08MITPHPPHP ^8.3CI passing

Since Jan 7Pushed 4mo agoCompare

[ Source](https://github.com/xbot-my/xbot-utils)[ Packagist](https://packagist.org/packages/xbot-my/xbot-utils)[ RSS](/packages/xbot-my-xbot-utils/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (9)Used By (0)

XBot Utils
==========

[](#xbot-utils)

> A powerful Symfony Console wrapper for managing development tasks with extensible plugin system.

[![Latest Version](https://camo.githubusercontent.com/b912cbd4cb542fba28c2c2dc7d2f3d7939c91b89b4fe19c0a6f844194dc9dcc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f78626f742d6d792f78626f742d7574696c73)](https://github.com/xbot-my/xbot-utils/releases)[![License](https://camo.githubusercontent.com/1ef2cde217d2b12f3d511c804a26a569504dd85f6ef338cb06000ae0e2c23f89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f78626f742d6d792f78626f742d7574696c73)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/5c8ce4571ddf4b6b8ca847e0c4c079de98fc6460eb7eae9c81ca63319c21f546/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e332d626c75652e737667)](https://php.net)[![Symfony](https://camo.githubusercontent.com/012bfef969a8ffd57bf7d17f9c3a2b3cb7270ef7a9c98935df974230c7275870/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d636f6e736f6c652d677265656e2e737667)](https://symfony.com/doc/current/components/console.html)

XBot Utils provides a unified PHP-based command-line interface for common development workflows, built on top of [Symfony Console](https://symfony.com/doc/current/components/console.html).

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Composer

Installation
------------

[](#installation)

```
composer install
```

Usage
-----

[](#usage)

```
./bin/xbot
```

Available Commands
------------------

[](#available-commands)

### Laravel Commands

[](#laravel-commands)

CommandDescription`clean`Clean Laravel project temporary and sensitive data`setup`Initialize Laravel project setup`service`Manage Laravel services (start/stop/restart/status for web, queue, schedule, horizon, echo)`db`Database management (migrate, backup, restore, test)### System Commands

[](#system-commands)

CommandDescription`sysinfo`Display system information and environment details### Core Commands

[](#core-commands)

CommandDescription`config`Manage xbot configuration (set, get, list, edit)`schedule`Manage scheduled tasks/cron jobs (list, add, remove, run, enable, disable, sync)`plugin`Manage xbot plugins (list, enable, disable, install, uninstall, info)`logs`View and manage xbot logs### Utility Commands

[](#utility-commands)

CommandDescription`info`Display detailed information about a command`search`Search for commands by keywordExamples
--------

[](#examples)

### Laravel Development

[](#laravel-development)

```
# Initialize Laravel project
./bin/xbot setup

# Clean temporary files
./bin/xbot clean

# Manage services
./bin/xbot service start
./bin/xbot service status
./bin/xbot service restart

# Database operations
./bin/xbot db migrate
./bin/xbot db backup
./bin/xbot db restore --file=backup.sql
./bin/xbot db test
```

### Configuration Management

[](#configuration-management)

```
# List all configuration
./bin/xbot config list

# Set configuration value
./bin/xbot config set output.color true

# Get specific configuration
./bin/xbot config get output.color

# Edit configuration file
./bin/xbot config edit

# Use global configuration
./bin/xbot config set script.timeout 300 --global

# Output as JSON
./bin/xbot config list --json
```

### Scheduled Tasks

[](#scheduled-tasks)

```
# List all scheduled tasks
./bin/xbot schedule list

# Add a new scheduled task
./bin/xbot schedule add --id daily-backup --cron "0 0 * * *" --command "./bin/xbot db backup"

# Run a task manually
./bin/xbot schedule run daily-backup

# Enable/disable a task
./bin/xbot schedule disable daily-backup
./bin/xbot schedule enable daily-backup

# Synchronize with system crontab
./bin/xbot schedule sync

# Remove a task
./bin/xbot schedule remove daily-backup
```

### Plugin Management

[](#plugin-management)

```
# List installed plugins
./bin/xbot plugin list

# Install a plugin from Git
./bin/xbot plugin install https://github.com/user/xbot-plugin.git

# Install from local path
./bin/xbot plugin install /path/to/plugin

# Enable/disable plugins
./bin/xbot plugin enable my-plugin
./bin/xbot plugin disable my-plugin

# View plugin information
./bin/xbot plugin info my-plugin

# Uninstall a plugin
./bin/xbot plugin uninstall my-plugin
```

### Log Management

[](#log-management)

```
# View recent logs
./bin/xbot logs

# Follow logs in real-time
./bin/xbot logs --tail

# Show last 100 lines
./bin/xbot logs --lines=100

# Filter by log level
./bin/xbot logs --level=ERROR

# List all log files
./bin/xbot logs --all

# Clear log file
./bin/xbot logs --clear
```

### System Information

[](#system-information)

```
# Display system info
./bin/xbot sysinfo
```

### Command Discovery

[](#command-discovery)

```
# Search for commands
./bin/xbot search database

# Get detailed info about a command
./bin/xbot info clean

# List all commands
./bin/xbot list

# Get help for specific command
./bin/xbot clean --help
```

Project Structure
-----------------

[](#project-structure)

```
.
├── bin/
│   └── xbot                          # Main executable
├── src/
│   ├── Command/
│   │   ├── BaseScriptCommand.php     # Base command class
│   │   ├── CleanCommand.php          # clean command
│   │   ├── SetupCommand.php          # setup command
│   │   ├── SysinfoCommand.php        # sysinfo command
│   │   ├── ServiceCommand.php        # service command
│   │   ├── DatabaseCommand.php       # db command
│   │   ├── ConfigCommand.php         # config command
│   │   ├── ScheduleCommand.php       # schedule command
│   │   ├── PluginCommand.php         # plugin command
│   │   ├── LogCommand.php            # logs command
│   │   ├── InfoCommand.php           # info command
│   │   └── SearchCommand.php         # search command
│   ├── Config/
│   │   └── ConfigManager.php         # Configuration management
│   ├── Scheduler/
│   │   ├── Scheduler.php             # Cron scheduler
│   │   ├── Task.php                  # Task model
│   │   ├── TaskRepository.php        # Task storage
│   │   └── CronExpression.php        # Cron parser
│   ├── Plugin/
│   │   ├── PluginManager.php         # Plugin system
│   │   ├── PluginInterface.php       # Plugin contract
│   │   └── AbstractPlugin.php        # Plugin base class
│   ├── Logging/
│   │   └── Logger.php                # Logging utilities
│   ├── Output/
│   │   └── ProgressHelper.php        # Progress bar helper
│   ├── ScriptExecutor.php            # Script execution with security
│   └── func.php                      # Helper functions
├── scripts/
│   ├── sysinfo.sh                    # System info script
│   └── laravel/
│       ├── setup.sh                  # Laravel setup script
│       ├── clean.sh                  # Laravel clean script
│       └── service.sh                # Service management script
├── tests/
│   ├── Unit/
│   │   └── Commands/                 # Command tests
│   ├── Feature/
│   ├── Pest.php                      # Pest configuration
│   └── TestCase.php                  # Base test case
├── composer.json
└── README.md

```

Development
-----------

[](#development)

### Adding a New Command

[](#adding-a-new-command)

1. Create your Bash script in `scripts/`
2. Create a command class extending `BaseScriptCommand`:

```
