Back to Home

AI-First Features

Every feature in Termitty is designed specifically for AI agents and automation. 100% open source and built by the community.

MIT Licensed
AI Optimized

AI-Friendly Structured State

Get terminal state as structured JSON/YAML instead of raw text. Perfect for LLM processing and decision making.

  • JSON/YAML output for AI models
  • Cursor position and screen dimensions
  • Detected UI elements (prompts, menus, errors)
  • Working directory and environment context
ai_friendly_structured_state.py
state = session.state.terminal.get_structured_state()
# Returns:
{
    "screen": {"text": "...", "cursor": {"row": 10, "col": 25}},
    "detected_elements": [
        {"type": "prompt", "text": "user@server:~$"},
        {"type": "error", "text": "Permission denied"}
    ],
    "context": {"working_directory": "/home/user"}
}

Smart Wait Conditions

AI agents can wait for specific conditions instead of arbitrary timeouts. No more flaky sleep() calls in automation scripts.

  • Wait for specific text output
  • Wait for prompts to be ready
  • Custom lambda conditions
  • Timeout handling with retries
smart_wait_conditions.py
# Wait intelligently, not with sleep()
session.execute('./deploy.sh', wait=False)
session.wait_until(OutputContains('Deployment complete'))
session.wait_until(PromptReady())

# Custom AI logic
session.wait_until(
    lambda s: 'error' not in s.terminal.get_screen_text().lower()
)

Session Recording & Replay

Record expert terminal sessions and replay them. Perfect for creating AI training datasets from real interactions.

  • Record every command and output
  • Capture terminal state at each step
  • Export in multiple formats
  • Replay for AI training
session_recording_replay.py
# Record expert debugging session
session.start_recording('expert_debug.json')
# Expert performs complex debugging
session.stop_recording()

# AI learns from recordings
session.replay_recording('expert_debug.json')
ai_model.train_on_session(recording_data)

Interactive Authentication

AI can handle sudo passwords, SSH keys, 2FA tokens, and any interactive prompts automatically.

  • Automatic password detection
  • Secure credential handling
  • 2FA token support
  • Custom prompt responses
interactive_authentication.py
# AI handles authentication prompts
session.execute('sudo systemctl restart nginx', wait=False)

if session.wait_until(TextContains('[sudo] password')):
    session.send_line(vault.get_password(), secure=True)

# Handle 2FA
if session.wait_until(TextContains('2FA token')):
    session.send_line(vault.get_2fa_token())

Full Terminal Emulation

Complete ANSI support with virtual terminal. AI can "see" exactly what humans see in the terminal.

  • Complete ANSI escape sequence support
  • Color and formatting preservation
  • Cursor tracking and positioning
  • Screen buffer access
full_terminal_emulation.py
# AI sees the full terminal state
with session.interactive_shell() as shell:
    shell.send_line('htop')
    
    # AI can read the htop interface
    screen = shell.get_screen_text()
    cpu_usage = parse_htop_output(screen)
    
    if cpu_usage > 90:
        shell.send_key('q')  # Quit htop
        # AI takes action based on what it sees

Parallel Multi-Server Execution

Execute commands across multiple servers simultaneously with intelligent coordination and error handling.

  • Rolling deployment strategies
  • Batch processing with size control
  • Error handling and recovery
  • Load balancing across hosts
parallel_multi_server_execution.py
from termitty.parallel import ConnectionPool

pool = ConnectionPool(['web-01', 'web-02', 'web-03'])

# Rolling deployment with AI monitoring
results = pool.execute_on_all(
    'sudo systemctl restart app',
    strategy='rolling',
    batch_size=1,
    on_error=ai_error_handler
)

Context Preservation

Maintain working directory, environment variables, and shell state across commands. AI understands the full context.

  • Persistent working directory
  • Environment variable tracking
  • Shell history preservation
  • Session state management
context_preservation.py
# Context is preserved across commands
session.execute('cd /var/log')
session.execute('export DEBUG=1')
session.execute('ls -la')  # Runs in /var/log with DEBUG=1

# AI knows the current context
state = session.state.terminal.get_structured_state()
print(state['context']['working_directory'])  # /var/log

Universal Cloud Support

Works with any SSH-accessible system - AWS, GCP, Azure, on-premises, containers, or edge devices.

  • Cloud-agnostic design
  • Container and Kubernetes support
  • Edge device compatibility
  • No vendor lock-in
universal_cloud_support.py
# Works everywhere SSH works
environments = [
    {'host': 'aws-instance.amazonaws.com', 'type': 'aws'},
    {'host': 'gcp-vm.googlecloud.com', 'type': 'gcp'},
    {'host': 'container-host', 'type': 'docker'},
    {'host': 'edge-device.local', 'type': 'iot'}
]

for env in environments:
    with TermittySession() as session:
        session.connect(env['host'])
        # Same API works everywhere

Ready to Build AI-Powered Automation?

Join the open source community building the future of AI infrastructure automation.