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.4.tar.gz (33.2 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.4-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opsbox-0.2.4.tar.gz
  • Upload date:
  • Size: 33.2 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.4.tar.gz
Algorithm Hash digest
SHA256 410a33f38a01061678c51e6be21303656528b9cd60fcba5708ddddb116f627e9
MD5 27718b74cd72aeb9c117e8b74ea9e209
BLAKE2b-256 034a56ac64544fb9f6f25784cf23b7cdb2aced41bde9b4d6536ec9eba53e4d12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opsbox-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 30.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b00a5da3c52654c36829a1b96232cab6c5c23b5d8013ed409cb6e1610b1a8e19
MD5 fa274acb8502e9a630bcac6af576c66d
BLAKE2b-256 03904c3f3acfea9b85ea8e9d1ba75f821678bcc974cead60ae2b1080403ddbe2

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