Skip to content

AI Configuration

EasyShell integrates AI capabilities through Spring AI, supporting multiple model providers for the chat assistant, scheduled inspections, and SOP automation.

application.yml
spring:
ai:
openai:
api-key: ${OPENAI_API_KEY}
chat:
options:
model: gpt-4o
temperature: 0.3
max-tokens: 4096
application.yml
easyshell:
ai:
enabled: true
chat:
enabled: true
system-prompt: |
You are EasyShell AI Assistant, an expert in Linux system administration,
shell scripting, and DevOps. Help users manage their servers effectively.
Always prioritize safety — warn about destructive commands.
inspection:
enabled: true
schedule: "0 0 2 * * ?" # Daily at 2:00 AM
auto-approve: false # Require manual approval for remediation
sop:
enabled: true

EasyShell uses a file-based vector store (SimpleVectorStore from Spring AI) for AI memory and SOP context retrieval.

application.yml
easyshell:
ai:
vector-store:
path: /data/easyshell/vectors
dimensions: 1536 # Must match embedding model
embedding:
model: text-embedding-3-small

The vector store powers:

  • AI Memory — Retaining context from previous conversations
  • SOP Matching — Finding relevant SOPs based on the current situation
  • Script Recommendations — Suggesting scripts based on the problem description

Inspections automatically check host health and generate reports.

application.yml
easyshell:
ai:
inspection:
enabled: true
schedule: "0 0 2 * * ?" # Cron expression
targets: ALL # ALL | cluster:production | tag:critical
checks:
- disk-usage
- memory-usage
- cpu-load
- zombie-processes
- failed-services
- security-updates
- log-anomalies
thresholds:
disk-usage-warning: 80 # percent
disk-usage-critical: 95
memory-usage-warning: 85
cpu-load-warning: 80

For safety, destructive operations detected by AI can require manual approval.

application.yml
easyshell:
ai:
approval:
enabled: true
auto-approve-safe: true # Auto-approve read-only operations
require-approval:
- service-restart
- package-install
- file-modification
- user-management
notification:
channels:
- email
- webhook

All AI configuration can be set via environment variables:

VariableDescription
OPENAI_API_KEYOpenAI API key
AZURE_OPENAI_KEYAzure OpenAI API key
EASYSHELL_AI_ENABLEDEnable/disable AI features
EASYSHELL_AI_CHAT_ENABLEDEnable/disable chat assistant
EASYSHELL_AI_INSPECTION_ENABLEDEnable/disable scheduled inspections
EASYSHELL_AI_INSPECTION_SCHEDULEInspection cron schedule