Skip to content

aamar-shahzad/sysAgent

Repository files navigation

🧠 SysAgent CLI

Secure, intelligent command-line assistant for OS automation and control

Python 3.8+ License: MIT Code style: black

🌟 Features

🧠 LLM-Driven Intelligence

  • Natural language command processing
  • Multi-step planning and execution
  • Support for OpenAI, Ollama, and local models
  • Context-aware responses and suggestions

πŸ› οΈ Comprehensive System Tools

  • FileTool: File operations, cleanup, organization
  • SystemInfoTool: Real-time system metrics and monitoring
  • ProcessTool: Process management and control
  • NetworkTool: Network diagnostics and connectivity
  • AppTool: Application launching and management
  • SchedulerTool: Task scheduling and automation
  • ServiceTool: System service management
  • ClipboardTool: Clipboard operations
  • AuthTool: Secure credential management
  • ScreenshotTool: Screen capture and analysis
  • VoiceTool: Voice input/output capabilities

πŸ”’ Security & Safety

  • Permission-gated execution with OS-specific implementations
  • Dry-run mode for safe testing
  • Guardrails against dangerous operations
  • Encrypted configuration and logging
  • One-time permission setup with persistent state

🧩 Extensible Architecture

  • Plugin system for custom tools
  • Modular design for easy extension
  • Configuration management
  • Comprehensive logging and auditing

πŸš€ Quick Start

Installation

# Install from PyPI
pip install sysagent-cli

# Or install with all optional features
pip install sysagent-cli[full]

# For development
pip install sysagent-cli[dev]

First Run

# Start the interactive CLI
sysagent

# Or run a direct command
sysagent "show me system info"

πŸ“– Usage Examples

Basic Commands

# System information
sysagent "what's my system status?"
sysagent "show CPU and memory usage"

# File operations
sysagent "clean up temp files"
sysagent "organize my downloads folder"
sysagent "find large files in my home directory"

# Process management
sysagent "show me what's using the most CPU"
sysagent "kill the process using too much memory"
sysagent "restart my browser"

# Network diagnostics
sysagent "check my internet connection"
sysagent "ping google.com"
sysagent "what's my public IP address?"

# Application control
sysagent "open my code editor"
sysagent "close all browser windows"
sysagent "focus on my terminal"

Advanced Features

# Scheduled tasks
sysagent "schedule a backup every day at 2 AM"
sysagent "create a reminder to restart my computer weekly"

# System maintenance
sysagent "run a full system cleanup"
sysagent "check for system updates"
sysagent "optimize my startup programs"

# Development workflows
sysagent "set up my development environment"
sysagent "monitor my project's resource usage"

πŸ—οΈ Architecture

sysagent/
β”œβ”€β”€ core/           # Core functionality
β”‚   β”œβ”€β”€ agent.py    # LLM agent implementation
β”‚   β”œβ”€β”€ permissions.py  # Permission management
β”‚   β”œβ”€β”€ config.py   # Configuration handling
β”‚   └── logging.py  # Logging and auditing
β”œβ”€β”€ tools/          # System tools
β”‚   β”œβ”€β”€ file_tool.py
β”‚   β”œβ”€β”€ system_info_tool.py
β”‚   β”œβ”€β”€ process_tool.py
β”‚   β”œβ”€β”€ network_tool.py
β”‚   └── ...
β”œβ”€β”€ cli/            # Command-line interface
β”‚   β”œβ”€β”€ main.py     # Entry point
β”‚   β”œβ”€β”€ repl.py     # Interactive REPL
β”‚   └── commands.py # CLI commands
β”œβ”€β”€ plugins/        # Plugin system
β”‚   β”œβ”€β”€ base.py     # Plugin base classes
β”‚   └── loader.py   # Plugin loader
└── utils/          # Utilities
    β”œβ”€β”€ security.py # Security utilities
    β”œβ”€β”€ platform.py # Platform detection
    └── helpers.py  # Helper functions

πŸ”§ Configuration

SysAgent stores configuration in:

  • macOS: ~/.sysagent/
  • Linux: ~/.sysagent/
  • Windows: %APPDATA%/SysAgent/

Environment Variables

# LLM Configuration
export SYSAGENT_LLM_PROVIDER=openai  # or ollama, local
export SYSAGENT_OPENAI_API_KEY=your_key_here
export SYSAGENT_OLLAMA_BASE_URL=http://localhost:11434

# Security
export SYSAGENT_DRY_RUN=true  # Enable dry-run mode
export SYSAGENT_VERBOSE=true   # Enable verbose logging

# Features
export SYSAGENT_ENABLE_VISION=true   # Enable vision features
export SYSAGENT_ENABLE_VOICE=true    # Enable voice features

πŸ›‘οΈ Security

Permission System

SysAgent implements a comprehensive permission system:

  1. Platform Detection: Automatically detects your OS
  2. Permission Request: Requests necessary permissions with clear explanations
  3. One-time Setup: Permissions are granted once and remembered
  4. Granular Control: Different permission levels for different operations

Safety Features

  • Dry-run Mode: Test commands without execution
  • Guardrails: Block dangerous operations like rm -rf /
  • Confirmation Prompts: Ask before destructive operations
  • Audit Logging: Track all operations for review

🧩 Plugin Development

Creating Custom Tools

from sysagent.tools.base import BaseTool
from sysagent.types import ToolResult

class MyCustomTool(BaseTool):
    name = "my_custom_tool"
    description = "A custom tool for specific tasks"
    
    def execute(self, **kwargs) -> ToolResult:
        # Your tool logic here
        return ToolResult(
            success=True,
            data={"result": "Custom operation completed"},
            message="Custom tool executed successfully"
        )

Plugin Configuration

# ~/.sysagent/plugins/my_plugin.yaml
name: my_plugin
version: 1.0.0
description: My custom plugin
entry_point: my_plugin.tools
permissions:
  - file_system
  - network
dependencies:
  - requests

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/sysagent/sysagent-cli.git
cd sysagent-cli

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/
isort src/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with LangChain for LLM integration
  • Uses Rich for beautiful terminal output
  • Inspired by modern CLI tools like Typer

πŸ“ž Support


Made with ❀️ by the SysAgent Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages