Skip to main content

AI-powered infrastructure management

Project description

Opsbox

AI-Powered Infrastructure Management

Welcome to Opsbox, the open-source platform that adds a dash of AI magic to your infrastructure management. With our flexible plugin system and policy-as-code approach using Rego, managing your infrastructure has never been this enjoyable!

Features

  • 🎛️ Plugin System: Customize and extend functionality with ease.
  • 📝 Policy-as-Code with Rego: Define compliance checks and policies efficiently.
  • 🤖 AI Assistance: Leverage AI models to analyze and process your infrastructure data.
  • 💻 Command-Line Interface: An interactive CLI.
  • 📚 Documentation Support: Generate and view documentation effortlessly using mkdocs.

Installation

Prerequisites

Ensure you have Python 3.11 installed.

For an isolated installation, use either UV or pipx.

For development or installing from source, you'll need UV.

For Rego plugins, install OPA.


(Recommended) Install in an Isolated Environment

Installing in an isolated environment avoids system conflicts and pollution.

Using UV

Installation

uv tool install opsbox

To install with extras:

uv tool install --with "opsbox-cli-output" "opsbox[aws]"

To add packages after installation:

uv tool install --with "existing-packages new-package"

Warning: If UV downloads the wrong version or can't find a package, clear the cache:

uv cache clean

Execution

uv tool run opsbox ...

Or:

uvx opsbox ...

Warning: Do not use --with during execution; it creates a temporary environment.

Using pipx

Installation

pipx install opsbox

To install additional packages:

pipx inject opsbox opsbox-cli-output

To ensure opsbox is in your PATH:

pipx ensurepath

Run opsbox directly in your shell.


(Not Recommended) Install from Source

For development or debugging, install from source using UV.

Installation

git clone https://github.com/sudoersllc/opsbox-core.git
cd opsbox-core
uv sync

Note: If you encounter Python versioning issues:

uv python install 3.11
rm .python-version
uv python pin 3.11

Execution

Run opsbox/main.py inside the virtual environment:

uv run ./opsbox/main.py ...

Installing OPA for Rego Compatibility

If using Rego (e.g., AWS plugins), install OPA and add it to your system PATH.

Adding OPA to PATH

Linux/macOS

echo 'export PATH=$PATH:/path/to/opa' >> ~/.bashrc
source ~/.bashrc  # or source ~/.zshrc

Windows

  1. Open "Edit the system environment variables" > "Environment Variables...".
  2. Edit "Path" and add C:\path\to\opa\directory.
  3. Restart your terminal.

Note: To use an existing OPA server, pass its URL in opa_url.


Example Usage

Want to run a specific pipeline? Here's how:

uv run opsbox --modules your_input-your_optional_assistant-your_output

A recommended command to start is stray_ebs make sure you have opsbox[aws] and opsbox-cli-output installed

uv run opsbox --modules stray_ebs-cli_out --aws_access_key_id {YOUR_ACCESS_KEY_ID} --aws_secret_access_key {YOUR_SECRET_ACCESS_KEY} --aws_region us-east-1

Configuration

Opsbox is flexible when it comes to configuration. You can provide options via:

  • Command-Line Arguments
  • Configuration Files
  • Environment Variables

Using a Configuration File

Create a file named .opsbox_conf.json in your home directory:

{
  "aws_access_key_id": "YOUR_ACCESS_KEY_ID",
  "aws_secret_access_key": "YOUR_SECRET_ACCESS_KEY",
  "aws_region": "YOUR_AWS_REGION",
}

To run a command with a config it will follow this format

uv run opsbox --modules stray_ebs-cli_out --config config.json

Command-Line Arguments

You can also provide configuration options directly through the command line:

uvx opsbox --modules example_module --aws_access_key_id YOUR_ACCESS_KEY_ID --aws_secret_access_key YOUR_SECRET_ACCESS_KEY --aws_region YOUR_AWS_REGION

Plugins

You'll probably want some plugins to get started!

Opsbox plugins published by gsudoers normally take the format of opsbox-<name>-<plugin_type>, and are accessible and searchable through PyPI.

There's also a collection of plugins available for AWS systems, installable by using the pip extras group aws:

pip install 'opsbox[aws]'

Let's Get Started!

Now that you're all set, it's time to unleash the power of AI on your infrastructure. Happy automating!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opsbox-0.2.5.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opsbox-0.2.5-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file opsbox-0.2.5.tar.gz.

File metadata

  • Download URL: opsbox-0.2.5.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for opsbox-0.2.5.tar.gz
Algorithm Hash digest
SHA256 f54b6c1fc291b32db60f350cb95a3856bb7b418b4b76635742a80798ae363cc2
MD5 6d80fa4a4a03e92fa295ffc6b1dd8508
BLAKE2b-256 1fa12b7cda149dae5fe2ec642715c903081d26efa06ba828dbd9e6aeddee35c6

See more details on using hashes here.

File details

Details for the file opsbox-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: opsbox-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for opsbox-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 42bf512b131c0ce6e77f134ce20323d02ff860be022f16724dc154e5ca0042f7
MD5 e1ab0a5b648fcc00abd473f10917c513
BLAKE2b-256 a15bc0d73d9d8bea16ded32ba72ef1cf8ce5258b18a2053788a2ba0660cfebd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page