Botovis

Artisan Commands

CLI commands for model management, schema discovery, interactive chat, and Telegram setup

Botovis registers four Artisan commands to help you manage and debug your installation.

botovis:models

Scans your Laravel application for Eloquent models and helps you generate the models config array interactively. This is the easiest way to set up which models Botovis can access.

php artisan botovis:models

By default, it presents an interactive selection where you can choose which models to include and what CRUD permissions each should have.

Options

OptionDescription
--allSelect all discovered models with full CRUD permissions (skip interactive selection)
--writeWrite the generated config directly to config/botovis.php
--read-onlyDefault all selected models to read-only permissions (['read'])
--path=Custom path to scan for models (default: app/Models)

Examples

# Interactive model selection (default)
php artisan botovis:models

# Select all models with full CRUD, write to config file
php artisan botovis:models --all --write

# Select all models with read-only permissions
php artisan botovis:models --all --read-only

# Scan a custom directory for models
php artisan botovis:models --path=app/Domain/Models

Sample Output

Botovis — Model Scanner
========================

Scanning app/Models...

Found 5 Eloquent models:

  [x] App\Models\User
  [x] App\Models\Product
  [x] App\Models\Order
  [ ] App\Models\PasswordReset
  [x] App\Models\Category

Generated config:

'models' => [
    \App\Models\User::class     => ['create', 'read', 'update', 'delete'],
    \App\Models\Product::class  => ['create', 'read', 'update', 'delete'],
    \App\Models\Order::class    => ['create', 'read', 'update', 'delete'],
    \App\Models\Category::class => ['create', 'read', 'update', 'delete'],
],

botovis:discover

Discovers and displays the database schema visible to the AI. Shows the tables, columns, relationships, and data types that Botovis has detected from your registered Eloquent models.

php artisan botovis:discover

This is the best way to verify that Botovis correctly understands your database structure.

Options

OptionDescription
--jsonOutput the schema in JSON format (useful for debugging)
--promptShow the actual system prompt that would be sent to the LLM

Examples

# See the full schema in a readable format
php artisan botovis:discover

# Export schema as JSON
php artisan botovis:discover --json

# See the actual LLM system prompt
php artisan botovis:discover --prompt

Sample Output

Botovis — Schema Discovery
============================

Table: users (Users)
  id            integer       PK, auto-increment
  name          string(255)   NOT NULL
  email         string(255)   NOT NULL, UNIQUE
  role          string(50)    NOT NULL, default: 'user'
  is_active     boolean       NOT NULL, default: true
  created_at    timestamp     NULLABLE
  updated_at    timestamp     NULLABLE

  Relations:
    → orders (hasMany → orders)
    → profile (hasOne → profiles)

Table: orders (Orders)
  id            integer       PK, auto-increment
  user_id       integer       NOT NULL, FK → users
  status        string(20)    enum: pending, processing, completed, cancelled
  total         decimal(10,2) NOT NULL
  created_at    timestamp     NULLABLE

  Relations:
    → user (belongsTo → users)
    → items (hasMany → order_items)

Models: 5 | Tables: 5 | Columns: 32 | Relations: 8

Debugging Tip

If the AI gives unexpected answers, run botovis:discover --prompt to see exactly what context the LLM receives. This helps identify missing columns, relationships, or incorrect type detection.

botovis:chat

An interactive CLI chat interface for testing and debugging. Ask questions directly from the terminal without needing the web widget.

php artisan botovis:chat

Options

OptionDescription
--simpleUse simple mode (intent classification) instead of the agent loop

Examples

# Start an interactive agent chat
php artisan botovis:chat

# Use simple mode
php artisan botovis:chat --simple

Sample Session

Botovis Chat — Interactive Mode (agent)
Type "exit" to quit, "reset" to clear history.
─────────────────────────────────────────

You: How many orders were placed this month?

  [Step 1] Thinking: I need to count orders from this month
  [Step 1] Action: count_records(table: orders, conditions: [{column: created_at, operator: >=, value: 2025-02-01}])
  [Step 1] Observation: Count: 342

AI: There have been 342 orders placed so far in February 2025.

You: What's the total revenue from those orders?

  [Step 1] Thinking: I need to sum the total column for this month's orders
  [Step 1] Action: aggregate(table: orders, function: SUM, column: total, conditions: [{column: created_at, operator: >=, value: 2025-02-01}])
  [Step 1] Observation: SUM(total): 45,230.50

AI: The total revenue from February 2025 orders is $45,230.50.

You: exit
Goodbye!

Authentication

The CLI chat runs without an authenticated user by default. If your security configuration requires authentication, the agent will use the wildcard * role permissions.

botovis:telegram-setup

Configures the Telegram bot integration. This command is available when you install the botovis/botovis-telegram package.

php artisan botovis:telegram-setup

Options

OptionDescription
--url=URLSet the webhook URL manually (skips auto-detection)
--infoDisplay current webhook information
--removeRemove the current webhook

Examples

# Interactive setup — prompts for URL if not provided
php artisan botovis:telegram-setup

# Set webhook with explicit URL
php artisan botovis:telegram-setup --url=https://your-app.com/botovis/telegram/webhook

# Check current webhook status
php artisan botovis:telegram-setup --info

# Remove the webhook
php artisan botovis:telegram-setup --remove

Sample Output

Botovis Telegram Setup
========================

Bot: @YourBotName
Token: 7234...****

Setting webhook to: https://your-app.com/botovis/telegram/webhook

✓ Webhook set successfully!

Test your bot by sending a message to @YourBotName on Telegram.

See the Telegram Integration page for full setup instructions.

On this page