Skip to content

MyDeskBot CLI Version

Work with AI directly from your terminal. Perfect for command line enthusiasts, automation experts, and anyone who prefers terminal workflows.

Overview

The MyDeskBot CLI Version provides a command line interface for the MyDeskBot AI engine. It enables natural language command generation, script automation, and terminal-based AI interaction.

Why Choose CLI Version?

⌨️ Terminal Integration Advantages

  • Command Line Interface: Use AI directly from your terminal
  • Script Automation: Generate and execute scripts with AI assistance
  • Batch Operations: Process multiple files or servers at once
  • Pipeline Integration: Seamlessly integrate with CI/CD pipelines

🎯 Perfect For Terminal Users

  • Keyboard-First: Control everything with keyboard commands
  • Automation Focused: Ideal for scripting and automation tasks
  • Terminal Workflows: Fits naturally into terminal-based workflows
  • Power User Friendly: Advanced features for experienced terminal users

Same AI Engine

🔄 Powered by MyDeskBot AI

The CLI Version uses the same AI engine as the Desktop and IDE versions:

  • Consistent Intelligence: Same AI capabilities across all interfaces
  • Shared Skills: Use the same Agent Skills Framework
  • Unified Configuration: AI settings sync across all versions
  • Cross-Interface Workflows: Start a task in CLI, continue in Desktop or IDE

🎯 Choose Your Interface

  • CLI: For terminal automation and scripting
  • Desktop: For visual workflows and graphical interaction
  • IDE: For coding assistance within your editor
  • All Three: Use different interfaces for different tasks

Installation

Using npm

bash
npm install -g @mydeskbot/cli

Using yarn

bash
yarn global add @mydeskbot/cli

Using Homebrew (macOS)

bash
brew install mydeskbot/tap/mydeskbot-cli

Using Scoop (Windows)

bash
scoop bucket add mydeskbot
scoop install mydeskbot-cli

Using Docker

bash
docker pull mydeskbot/cli:latest
docker run -it --rm mydeskbot/cli --help

Manual Installation

  1. Download the binary for your platform from GitHub Releases

  2. Extract the archive

  3. Move the binary to your PATH:

    bash
    # macOS/Linux
    sudo mv mydeskbot /usr/local/bin/
    
    # Windows (PowerShell)
    Copy-Item mydeskbot.exe C:\Windows\System32\

Getting Started

Authentication

bash
# Configure your API key
mydeskbot config set apiKey YOUR_API_KEY

# Or use environment variable
export MYDESKBOT_API_KEY=YOUR_API_KEY

First Command

bash
# Ask MyDeskBot to generate a command
mydeskbot ask "List all processes using more than 1GB of RAM"

# Output:
# ps aux | awk '$6 > 1048576 {print $2, $6, $11}'

Core Commands

mydeskbot ask

Generate commands or get help:

bash
# Generate a command
mydeskbot ask "Find files larger than 100MB"

# Get explanation for a command
mydeskbot explain "docker ps -a --filter 'exited=0'"

# Generate a script
mydeskbot generate-script "Backup all MySQL databases"

# Get help with regex
mydeskbot regex "Match email addresses"

mydeskbot exec

Execute commands with AI supervision:

bash
# Execute with explanation
mydeskbot exec "tar -xzf archive.tar.gz" --explain

# Execute with dry-run (show what will happen)
mydeskbot exec "rm -rf /tmp/old/*" --dry-run

# Execute with safety checks
mydeskbot exec "docker system prune" --safe

mydeskbot script

Generate and manage scripts:

bash
# Generate a backup script
mydeskbot script generate backup-database

# Edit with AI assistance
mydeskbot script edit backup-database

# Run with validation
mydeskbot script run backup-database --validate

mydeskbot chat

Interactive AI chat in terminal:

bash
# Start interactive session
mydeskbot chat

# Ask questions
> How do I find the size of a directory?
> du -sh directory-name

> How do I compress a file?
> tar -czf archive.tar.gz file.txt

mydeskbot config

Manage configuration:

bash
# Set configuration
mydeskbot config set model gpt-4
mydeskbot config set temperature 0.7

# View configuration
mydeskbot config get

# Reset configuration
mydeskbot config reset

Use Cases

DevOps Automation

bash
# Generate deployment script
mydeskbot script generate deploy-app \
  --template "Deploy to AWS ECS" \
  --variables "IMAGE_TAG=latest,CLUSTER=production"

# Generate monitoring script
mydeskbot ask "Monitor CPU usage and alert if > 80%"

# Generate backup script
mydeskbot ask "Backup all PostgreSQL databases with timestamps"

System Administration

bash
# Find system issues
mydeskbot ask "Find all zombie processes"

# Clean up disk space
mydeskbot ask "Remove all files in /tmp older than 7 days"

# Check service status
mydeskbot ask "Check if all required services are running"

Development Workflows

bash
# Generate commit message
mydeskbot ask "Generate commit message for: Fixed memory leak in API handler"

# Generate release notes
mydeskbot ask "Generate release notes from git log since v1.0.0"

# Run tests with AI
mydeskbot exec "npm test" --analyze

Log Analysis

bash
# Find errors
mydeskbot ask "Find all ERROR entries in app.log"

# Analyze patterns
mydeskbot ask "Find common patterns in access.log"

# Generate report
mydeskbot ask "Generate summary report for server logs"

Configuration

Config File

Create .mydeskbot.yaml in your project:

yaml
# Model settings
model:
  provider: openai
  model: gpt-4
  temperature: 0.7
  maxTokens: 2048

# Safety settings
safety:
  confirmDangerousCommands: true
  blockDestructiveCommands: false
  dryRunByDefault: false

# Integrations
integrations:
  github:
    token: GITHUB_TOKEN
  aws:
    region: us-east-1
    profile: default

# Aliases
aliases:
  backup: "mydeskbot script run backup-database"
  deploy: "mydeskbot script run deploy-app"

Environment Variables

bash
# API Keys
export MYDESKBOT_API_KEY=your_api_key
export OPENAI_API_KEY=your_openai_key
export ANTHROPIC_API_KEY=your_anthropic_key

# Model Settings
export MYDESKBOT_MODEL=gpt-4
export MYDESKBOT_TEMPERATURE=0.7

# Safety Settings
export MYDESKBOT_SAFE_MODE=true
export MYDESKBOT_DRY_RUN=false

Script Templates

Backup Script Template

bash
#!/bin/bash
# MyDeskBot Generated: Backup Script
# Generated: 2024-02-24

# Variables
BACKUP_DIR="/backups"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
RETENTION_DAYS=7

# Functions
backup_database() {
    local db_name=$1
    local backup_file="$BACKUP_DIR/${db_name}_${TIMESTAMP}.sql.gz"

    echo "Backing up $db_name..."
    mysqldump -u root -p"$DB_PASSWORD" "$db_name" | gzip > "$backup_file"

    echo "Backup saved to $backup_file"
}

# Main execution
backup_database "app_db"
backup_database "analytics_db"

# Cleanup old backups
find "$BACKUP_DIR" -name "*.sql.gz" -mtime +$RETENTION_DAYS -delete

echo "Backup completed successfully"

Deployment Script Template

bash
#!/bin/bash
# MyDeskBot Generated: Deployment Script

# Configuration
APP_NAME="myapp"
DOCKER_IMAGE="myapp:$1"
HELM_CHART="./charts/$APP_NAME"

# Pre-deployment checks
check_preconditions() {
    echo "Checking preconditions..."

    # Check if image exists
    if ! docker image inspect "$DOCKER_IMAGE" &> /dev/null; then
        echo "Error: Image $DOCKER_IMAGE not found"
        exit 1
    fi

    # Check if chart exists
    if [ ! -d "$HELM_CHART" ]; then
        echo "Error: Helm chart not found at $HELM_CHART"
        exit 1
    fi

    echo "Preconditions passed"
}

# Deploy application
deploy_app() {
    echo "Deploying $APP_NAME..."

    helm upgrade --install "$APP_NAME" "$HELM_CHART" \
        --set image.tag="$1" \
        --namespace production \
        --wait \
        --timeout 5m

    echo "Deployment completed"
}

# Rollback on failure
rollback_deployment() {
    echo "Rolling back deployment..."
    helm rollback "$APP_NAME" --namespace production
}

# Main execution
check_preconditions

if ! deploy_app "$1"; then
    rollback_deployment
    exit 1
fi

echo "Deployment successful"

CI/CD Integration

GitHub Actions

yaml
name: MyDeskBot CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  mydeskbot-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Setup MyDeskBot CLI
        uses: mydeskbot/setup-cli@v1
        with:
          api-key: ${{ secrets.MYDESKBOT_API_KEY }}

      - name: Code Review
        run: |
          mydeskbot review \
            --files $(git diff --name-only main) \
            --format markdown \
            --output review.md

      - name: Comment PR
        uses: actions/github-script@v6
        with:
          script: |
            const fs = require('fs')
            const review = fs.readFileSync('review.md', 'utf8')
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: review
            })

GitLab CI

yaml
stages:
  - review
  - test

mydeskbot-review:
  stage: review
  image: mydeskbot/cli:latest
  script:
    - mydeskbot review --target $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  artifacts:
    paths:
      - mydeskbot-review.md

mydeskbot-test:
  stage: test
  image: mydeskbot/cli:latest
  script:
    - mydeskbot generate-tests --coverage 80
    - mydeskbot run-tests --parallel

Advanced Features

Batch Processing

bash
# Process multiple files
mydeskbot batch process ./logs/*.log \
  --action "summarize errors" \
  --output ./summaries/

# Process in parallel
mydeskbot batch process ./data/*.csv \
  --parallel 4 \
  --action "generate report" \
  --format markdown

Pipeline Integration

bash
# Create a pipeline
mydeskbot pipeline create my-pipeline.yaml <<EOF
steps:
  - name: validate
    command: mydeskbot validate
  - name: test
    command: npm test
  - name: deploy
    command: mydeskbot deploy
EOF

# Run pipeline
mydeskbot pipeline run my-pipeline.yaml

Custom Commands

bash
# Define custom command
mydeskbot alias add "db-backup" "mydeskbot script run backup-database"

# Use custom command
mydeskbot db-backup

# List aliases
mydeskbot alias list

Safety Features

Dangerous Command Detection

bash
# MyDeskBot warns about dangerous commands
$ mydeskbot ask "Delete all files"
⚠️  WARNING: This command will delete all files in the current directory
⚠️  Command: rm -rf .
⚠️  Are you sure? (y/N): y

Dry Run Mode

bash
# Preview changes without executing
mydeskbot exec "docker system prune" --dry-run

# Output:
# Would remove:
# - 12 stopped containers
# - 5 unused images
# - 3 GB of data

Command History

bash
# View command history
mydeskbot history

# Replay a command
mydeskbot history replay 42

# Export history
mydeskbot history export commands.json

Resources

Pricing

PlanPriceFeatures
Free$0100 requests/day, basic features
Pro$9/moUnlimited requests, advanced features
Team$29/user/moTeam sharing, pipeline templates
EnterpriseCustomSelf-hosted, custom integrations

Automate with AI from your terminal! Install MyDeskBot CLI Version today.