10000 GitHub - vonglasow/gaia: Gaia is a command-line interface (CLI) tool for interacting with language models via a local API. It features a beautiful terminal UI, robust configuration management, and multiple interaction modes (default, describe, code, shell) for versatile assistance with programming, system administration, and more.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ gaia Public

Gaia is a command-line interface (CLI) tool for interacting with language models via a local API. It features a beautiful terminal UI, robust configuration management, and multiple interaction modes (default, describe, code, shell) for versatile assistance with programming, system administration, and more.

License

Notifications You must be signed in to change notification settings

vonglasow/gaia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
View all files

Repository files navigation

Gaia

pre-commit.ci status

Gaia is a command-line interface (CLI) tool that provides a convenient way to interact with language models through a local API. It features a beautiful terminal UI, configuration management, and support for different interaction modes.

Features

  • πŸš€ Simple and intuitive command-line interface
  • 🎨 Beautiful terminal UI with progress bars
  • βš™οΈ Configurable settings with YAML support
  • πŸ”„ Support for different interaction modes (default, describe, code, shell)
  • πŸ“¦ Automatic model management (pull if not present)
  • πŸ”Œ Local API integration

Installation

Prerequisites

  • Go 1.22.2 or later
  • A running instance of a compatible language model API (e.g., Ollama)

Building from Source

git clone https://github.com/vonglasow/gaia.git
cd gaia
go build

Configuration

Gaia stores its configuration in ~/.config/gaia/config.yaml. The following settings are available:

  • model: The language model to use (default: "mistral")
  • host: API host (default: "localhost")
  • port: API port (default: 11434)
  • roles: Different interaction modes with their respective prompts

Available Roles

  • default: General programming and system administration assistance
  • describe: Command description and documentation
  • shell: Shell command generation
  • code: Code generation without descriptions

Usage

Basic Commands

# Ask a question
gaia ask "What is the meaning of life?"

# Start an interactive chat session
gaia chat

# Configure settings
gaia config set model llama2
gaia config set host 127.0.0.1
gaia config set port 8080

# View current configuration
gaia config list

# Get specific configuration value
gaia config get model

# Show configuration file path
gaia config path

# Check version
gaia version

Using Different Roles

# Use default role (general assistance)
gaia ask "How do I create a new directory?"

# Use describe role for command documentation
gaia ask --role describe "ls -la"

# Use shell role for command generation
gaia ask --role shell "list files in current directory"

# Use code role for code generation
gaia ask --role code "Hello world in Python"

Chat Mode

The chat mode provides an interactive session where you can have a continuous conversation with the model. The conversation history is maintained throughout the session, allowing the model to reference previous messages.

# Start a chat session
gaia chat

# Type your messages and press Enter
# Type 'exit' to end the chat session

Example Usage

$ cat CVE-2021-4034.py | gaia ask "Analyze and explain this code"
This code is a Python script that exploits the CVE-2021-4034 vulnerability in Python. It was originally written by Joe Ammond, who used it as an experiment to see if he could get it to work in Python while also playing around with ctypes.

The code starts by importing necessary libraries and defining variables. The `base64` library is imported to decode the payload, while the `os` library is needed for certain file operations. The `sys` library is used to handle system-level interactions, and the `ctypes` library is used to call the `execve()` function directly.

The code then decodes a base64 encoded ELF shared object payload from a previous command (in this case, using msfvenom). This payload is created with the PrependSetuid=true flag so that it can run as root instead of just the user.

An environment list is set to configure the call to `execve()`. The code also finds the C library, loads the shared library from the payload, creates a temporary file for exploitation, and makes necessary directories.

The code ends with calling the `execve()` function using the C library found earlier, passing in NULL arguments as required by `execve()`.

Development

Project Structure

  • api/: API interaction and streaming functionality
  • commands/: CLI command definitions
  • config/: Configuration management
  • main.go: Application entry point

Dependencies

License

This project is licensed under the terms specified in the LICENSE file.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Gaia is a command-line interface (CLI) tool for interacting with language models via a local API. It features a beautiful terminal UI, robust configuration management, and multiple interaction modes (default, describe, code, shell) for versatile assistance with programming, system administration, and more.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages

0