Skip to content

XelandOne/JarvisMacControll

Repository files navigation

JarvisMacControll

A macOS application for generating and executing Swift code using LLMs.

⚠️ SAFETY DISCLAIMER: This application executes code generated by Large Language Models (LLMs) directly on your machine without. There are inherent security risks in executing AI-generated code without checking. Use at your own risk and review all generated code carefully before execution. The author is not responsible for any damage, data loss, or security breaches that may result from using this application.

Overview

JarvisMacControll is a macOS application that allows you to generate Swift code using AI services (Claude or OpenAI) and execute it directly on your Mac. Simply type in a natural language prompt describing what you want to achieve, and the LLM will generate the corresponding Swift code, which can then be executed immediately.

JarvisMacControll Demo

Features

  • AI-Powered Code Generation: Generate Swift code from natural language prompts using:
    • OpenAI GPT-4 API
    • Anthropic Claude API
  • Code Execution: Execute the generated Swift code directly within the application
  • Flexible Architecture: Switch between different AI providers through a clean interface-based design
  • Modern UI: Built with SwiftUI for a responsive and native macOS experience

Requirements

  • macOS Sonoma (14.5) or later
  • Xcode 16.0 or later
  • API keys for Claude and/or OpenAI

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/JarvisMacControll.git
    cd JarvisMacControll
  2. Open the project in Xcode:

    open JarvisMacControll.xcodeproj
  3. Configure your API keys:

    • In Xcode, go to Product > Scheme > Edit Scheme...
    • Select the Run action and go to the Environment Variables tab
    • Add the following environment variables:
      • CLAUDE_API_KEY: Your Anthropic Claude API key
      • OPENAI_API_KEY: Your OpenAI API key
  4. Build and run the application

Project Structure

The project follows a clean architecture approach with the following components:

  • Domain: Contains business logic interfaces

    • AICodeGeneratorService: Interface for AI code generation services
    • CodeExecutorService: Interface for executing generated code
  • Infrastructure: Contains implementations of domain interfaces

    • ClaudeAICodeGeneratorService: Implementation using Anthropic's Claude API
    • OpenAICodeGeneratorService: Implementation using OpenAI's API
    • SwiftCodeExecutorService: Implementation for executing Swift code
    • AppConfig: Configuration management
  • Presentation: Contains UI components

    • CodeGeneratorViewModel: View model for the code generation UI
    • ContentView: Main SwiftUI view
  • Application: Contains app-level components

    • DependencyContainer: Manages dependencies and services
    • JarvisMacControllApp: Main application entry point

Dependencies

The project uses the following Swift packages:

Usage

  1. Launch the application
  2. Enter a natural language prompt describing the Swift code you want to generate
  3. Click "Generate Code" or press ⌘+Return
  4. Review the generated code
  5. Click "Execute Code" or press ⌘+Shift+Return to run the code

Example prompts:

  • "Create a simple to-do list app with the ability to add, delete and mark tasks as completed"
  • "Write code to fetch and display the current weather for a given city"
  • "Generate a basic calculator with addition, subtraction, multiplication, and division"

Security Note

This application requires API keys for Claude and OpenAI. These keys are stored in environment variables and used at runtime. Be careful not to share your project with the API keys included.

About

A semi dangerous macOS application for controlling macOS with LLMs.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages