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.3.tar.gz (33.1 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.3-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opsbox-0.2.3.tar.gz
  • Upload date:
  • Size: 33.1 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.3.tar.gz
Algorithm Hash digest
SHA256 6a898892d675f5adee9bc7fd1f97bc54c5232ed14df5eaf49b69a10ae6da34db
MD5 26ef01f43502277220342d2236b4c3d4
BLAKE2b-256 5a0ae04ecd063d1183708dbc45251a6c4c5a5c4b8ba64336589c65bc96620076

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opsbox-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 30.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0440bc87487d7a7e0761ee43d49aa68848538e6b873772e29b8fbae372400ecf
MD5 a9a82631e43e72b242f25cde27b399af
BLAKE2b-256 9c86e209b145b23271726b9f0a66ab00bc34a857fae9245db9b4af102740a11b

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