> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loupp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> Execute custom commands on your shared hosting servers

## Overview

Execute custom shell commands directly on your shared hosting server from the Loupp dashboard. Run maintenance tasks, troubleshoot issues, and perform administrative operations without direct SSH access.

## Command Execution Features

### Core Capabilities

<CardGroup cols={3}>
  <Card title="Custom Commands" icon="terminal">
    Execute any shell command with full server access
  </Card>

  <Card title="Command History" icon="history">
    Track all executed commands with timestamps and outputs
  </Card>

  <Card title="Real-time Monitoring" icon="monitor">
    Monitor command execution status and results
  </Card>
</CardGroup>

### Execution Environment

Commands run in a controlled environment:

<AccordionGroup>
  <Accordion title="Working Directory">
    Commands execute from the server's root directory: `/home/loupp/{{ $server->name }}`
  </Accordion>

  <Accordion title="User Context">
    Commands run as the `loupp` user with appropriate permissions
  </Accordion>

  <Accordion title="Timeout Limits">
    Commands have a 2-minute timeout to prevent resource exhaustion
  </Accordion>
</AccordionGroup>

## Running Commands

### Basic Command Execution

<Steps>
  <Step title="Access command interface">
    Navigate to your shared server dashboard and click on the "Commands" tab.
  </Step>

  <Step title="Enter command">
    Type your command in the text area:

    ```bash theme={null}
    # Example commands
    ls -la
    php artisan list
    composer install
    npm run build
    ```
  </Step>

  <Step title="Execute command">
    Use one of these methods to run the command:

    * Click "Run" button
    * Press `Cmd + Enter` (macOS)
    * Press `Ctrl + Enter` (Windows/Linux)
  </Step>

  <Step title="Monitor execution">
    Track command status and view output in real-time.
  </Step>
</Steps>

### Command Input Tips

<AccordionGroup>
  <Accordion title="Multi-line Commands">
    ```bash theme={null}
    # You can enter multi-line commands
    if [ -f "composer.json" ]; then
        composer install --no-dev
    else
        echo "No composer.json found"
    fi
    ```
  </Accordion>

  <Accordion title="File Operations">
    ```bash theme={null}
    # Common file operations
    ls -la storage/logs/
    tail -n 50 storage/logs/laravel.log
    chmod -R 755 storage/
    ```
  </Accordion>
</AccordionGroup>

## Command History Management

### Viewing Command History

All executed commands are automatically logged with detailed information:

<CardGroup cols={3}>
  <Card title="Command Details" icon="info">
    * Full command text
    * Execution timestamp
    * User who ran the command
  </Card>

  <Card title="Execution Status" icon="check">
    * Running status
    * Success/failure indicators
    * Execution time tracking
  </Card>

  <Card title="Output Results" icon="file-text">
    * Command output
    * Error messages
    * Return codes
  </Card>
</CardGroup>

### Command History Interface

<Steps>
  <Step title="Access history">
    Scroll down to the "Command History" section below the command input.
  </Step>

  <Step title="Review commands">
    Each command entry shows:

    * Command text (clickable to re-run)
    * Execution date and time
    * Relative time (e.g., "2 hours ago")
    * Current status
  </Step>

  <Step title="View details">
    Click "View Details" to see full command output and execution information.
  </Step>
</Steps>

### Reusing Commands

<Steps>
  <Step title="Select previous command">
    Click on any command in the history to automatically populate the input field.
  </Step>

  <Step title="Modify if needed">
    Edit the command before execution if you need to make changes.
  </Step>

  <Step title="Execute modified command">
    Run the command with your modifications.
  </Step>
</Steps>
