curl -LsSf https://raw.githubusercontent.com/Ch-aOS-Ch/Ch-aOS/refs/heads/main/install.sh | sudo bash
here you go, hot-head!
- Ch-aOS is meant to be a way to declaratively manage your linux system, from installation to post-install configuration, in a modular, safe, and didactic way.
- The chaos CLI uses Python, Pyinfra and OmegaConf as it's main engine, allowing for a declarative paradigm approach in a simpler way.
- It also uses sops as its main encryption engine, orchestrating multiple of sops' commands and configurations in order to provide a safe environment.
- It allows for modularity through plugins, meaning that you can extend it's functionality by adding new plugins to it, either made by me or by the community.
- My plugins include: Ch-aronte (an Arch Linux core), chaos-dots (a dotfile manager), and chaos-secrets, a secrets templater that uses jinja2 for sops.
- Yes! The chaos CLI is basically just the CLI itself, with no backends at all, the backends are plugins themselves, this means that you can create your own backend for your own distro if you want to!
- Some examples of possible backends are found inside of the external_plugins folder, including a mock backend for testing and a chaos-dots backend for dotfile management! (This one i use myself!)
- That's where the "cores" come in, cores are just pre-made plugins that manage specific distros, like Ch-aronte for Arch Linux!
- These are made by me, myself and I, but anyone can create their own core if they want to... yk... cause they're plugins.
- Cores should contain all the bare minimum to manage a system, such as package management, user management, service management, etc.
- Clone this repo (i'm working on making it pip/aur installable, but for now, this is the only way to get it)
- Go to ./cli/build/b-coin/ and run
makepkg -fcsito install the chaos CLI. - (optional) go to ../../Ch-aronte/build/core and run
makepkg -fcsito install the Ch-aronte core. - (optional) go to ../../external_plugins/chaos-dots and run
makepkg -fcsito install the chaos-dots plugin. - Now you can run
chaos -hto see the help menu andchaos check [roles/explanations/aliases/secrets]!
- What is it? At its core, Ch-aOS allows you to define the desired state of your system in simple YAML files called "Ch-obolos". The
chaos applycommand then reads this data and executes "roles" (Python scripts usingpyinfra) to make your system's actual state match the declared state. - Why use it? It enforces a strict separation of data (what your system should be) from logic (how to achieve that state). This makes your configurations readable, reusable, and version-controllable. You can apply specific parts of your configuration (e.g., just users or just packages) without running through everything.
- How is it used?
- Create a Ch-obolo file: Define variables for your system, like
users,packages, orservicesinside of YAML dicts, these should be documented by the plugin itself (maybe even onchaos explain), if a plugin is well made, it will also come with akeysentry_point to make surechaos init chobolocan handle the boiler plates for you. - Apply roles: Run
chaos apply <role_tag>(e.g.,chaos apply users pkgs). Ch-aOS finds the corresponding roles from its installed plugins and executes them, using the data from your Ch-obolo, optionally you can run with the-s/--secretsflag to make sure your secrets are loaded as well (don't forget to configure your.config/chaos/config.ymlso the plugin is recognized as a secret-having plugin as well!). - Safety First: Use
chaos apply --dry(or-d) to see a preview of all the changes that would be made without actually applying them, if you really want to get to understand what exactly the plugin is doing, run wit-vvvfor maximum verbosity.
- Create a Ch-obolo file: Define variables for your system, like
- What is it? The
fleetfeature extendschaosto multi-machine orchestration. By adding afleetblock to your Ch-obolo file, you can define a group of remote hosts and runchaos apply --fleetroles across all of them simultaneously. - Why use it? It's essential for managing any infrastructure with more than one machine. Whether you're maintaining a cluster of web servers, a set of development VMs, or any group of computers that need consistent configuration, the fleet feature allows you to apply your declarative roles to all of them from a single command.
- How is it used?
- Define your fleet: In your Ch-obolo file, create a
fleetkey. Inside it, define yourhostsand their SSH connection details (e.g.,ssh_user,ssh_port,ssh_key). You can also set aparallelismlevel to control how many hosts are configured at once. - Apply to the fleet: Run your
applycommand with the--fleetflag (e.g.,chaos apply packages --fleet).chaoswill then connect to each host defined in your fleet via SSH and execute thepackagesrole on all of them.
- Define your fleet: In your Ch-obolo file, create a
- What is it? Ch-aOS is built to be minimal and modular. Most of its functionality, including system management tasks ("cores"), command aliases, documentation (
explain), and even secret provider integrations, is provided through external plugins. - Why use it? This design means you only install the functionality you need. It also allows the community to extend Ch-aOS for different distributions or add new tools without modifying the central CLI. The CLI is just an engine; the plugins provide the power.
- How is it used?
- Cores: A "core" is a plugin that provides the basic set of roles for managing a specific Linux distribution (e.g.,
ch-arontefor Arch Linux), these tend to be quite big (In functionality, not in size), as managing different systems do require a LOT of different ways to calculate deltas or even managing different things (for instance, managing an user is as a concept is ALIEN to managing packages). - Functionality Plugins: Other plugins can add specialized tools, like
chaos-dotsfor dotfile management. - Secret Providers: Integrations with password/secret managers like Bitwarden and 1Password are implemented as plugins via the
chaos.providersentry point, allowing for new providers to be added easily, Ch-aOS comes with these two specific cases from the get-go. - Discovery: The
chaos check rolesandchaos check explanationscommands let you see all the features available from your installed plugins. Runchaos -uto update the plugin cache after installing new plugins (sorry for the hassle, its for optimization).
- Cores: A "core" is a plugin that provides the basic set of roles for managing a specific Linux distribution (e.g.,
- What is it? A built-in documentation system that provides detailed (if you so wish) explanations for every feature, command, and concept within Ch-aOS. It's powered by the same plugin system that provides roles, so documentation may even live alongside the functionality it describes, so if you don't want to read about the plugin online, you can just install it and read about it locally, it comes all packaged together!
- Why use it? It offers a didactic and discovery based way to learn Ch-aOS. Instead of just reading a static man page, you can progressively request more detailed information (
--details basic|intermediate|advanced) on any topic, from high-level concepts to deep technical specifics (and even syntax-highlighted scripts of how to manage your system manually), only on the specific plugins you already have. - How is it used?
- Explore topics: Run
chaos check explanationsto see all available documentation topics. - Get an explanation: Use
chaos explain <topic>to read about a feature (e.g.,chaos explain apply). - Drill down: Use
topic.subtopicto get more specific information (e.g.,chaos explain apply.dry). You can usetopic.listto see all available subtopics. - Increase detail: Use the
-dflag to get more advanced information (e.g.,chaos explain secrets.sops -d advanced), some explanations come baked in, so give it a go!
- Explore topics: Run
- What is it? A suite of commands (
chaos secrets) that acts as an orchestrator for Mozilla'ssops. It allows you to safely store sensitive data (like passwords, tokens, and API keys) in encrypted YAML files that can be committed to a Git repository. - Why use it? It simplifies the entire
sopsworkflow, from key rotation to editing encrypted files. It provides a secure way to manage secrets alongside your configuration, ensuring that sensitive values are never exposed in plain text. - How is it used?
- Initialization:
chaos init secretsruns an interactive wizard to set up your encryption keys (ageorgpg) and create your initialsopsconfiguration. - Editing:
chaos secrets editseamlessly decrypts your secrets file into a temporary buffer, opens it in your$EDITOR, and automatically re-encrypts it on save. - Key Management:
chaos secrets rotate-addandrotate-rmallow you to easily grant or revoke access by adding or removingage/pgp/vaultkeys from the configuration. - Access Control: Use
chaos secrets shamirto configure an M-of-N policy, requiring a quorum of keys to decrypt a file, enhancing security and redundancy.
- Initialization:
- What are they? So, you already have your secrets set-up, but... Where do you store your private key?? Well, secret
providersin Ch-aOS are integrations with external password managers (like Bitwarden and 1Password). They allow thechaosCLI to access encryption keys (AGE, GPG, Vault tokens) securely stored in these services, without needing to keep them permanently on the local filesystem (they can even not touch the disk, like ever!) - Why use them? They provide a significantly enhanced security posture and convenience.
- Ephemeral Keys: Instead of managing key files on every developer's machine,
chaoscan fetch the necessary decryption keys ephemerally (they exist only in memory for the duration of a single command). This approach allows you to manage exactly who, how and when anyone can access your secrets (provided your provider allows for that), while also reducing the attack surface of any given secret! - Centralized & Auditable Access: Storing master keys in a password manager provides a central and trusty source. Access can be managed through the password manager's own policies, and in many cases, it is auditable.
- Secure Onboarding: It simplifies the process of securely distributing keys to new team members. They only need access to the password manager to start decrypting secrets.
- Ephemeral Keys: Instead of managing key files on every developer's machine,
- How are they used?
- Configuration: You can configure default secret providers in the
secret_providerssection of~/.config/chaos/config.yml. You can define named providers for specific backends and key types (e.g.,bw.age). - Ephemeral Usage: Many commands that interact with secrets (like
chaos apply,secrets edit, andramble read) accept a-pflag to use a provider. For example,chaos apply users --secrets -p bw.agewill fetch the age key from Bitwarden to decrypt your configured secrets to give to theusersrole. Manual flags for direct item access are also available (-bfor Bitwarden,-ofor 1Password, etc. These are given by the plugin, so they will always be available). - Secure Export/Import: The
chaos secrets export <provider>andimport <provider>commands create a secure workflow for backing up master keys or bootstrapping a new machine. - Enhanced Export Security (
--no-import): When exporting a key withchaos secrets export, you can use the-Nor--no-importflag. This embeds a special marker in the secret stored in the password manager. Thechaos secrets importcommand will refuse to import any key with this marker. This creates a one-way-trip for a key, allowing it to be distributed for use but preventing it from being extracted from the password manager back to a local file, enforcing a stricter security model where desired. If any plugin doesn't support this feature, you can also just add the marker manually to the secret's notes, the text is, letter for letter "# NO-IMPORT", this can be placed anywhere on the note and Ch-aOS will use it.
- Configuration: You can configure default secret providers in the
- What is it? The team management in Ch-aOS is designed to facilitate collaboration and the sharing of configurations and secrets within a work group. It implements a standard structure for team repositories, allowing members to share
ramblings(encrypted notes), secret files, and declarative configurations in an organized and secure way. - Why use it?
- Secure Collaboration: Allows different team members to access and manage secrets and configurations relevant to their projects, using integrated access control mechanisms (like Shamir's Secret Sharing in SOPS).
- Standardized Structure: Enforces a directory hierarchy for secrets and
ramblings(e.g.,secrets/dev,secrets/prod,ramblings/person), making organization and understanding easier. - Clear Workflows: Offers dedicated commands to initialize, clone, activate, and deactivate team environments, simplifying new member onboarding and project maintenance.
- How is it used?
- Naming Convention: Teams are identified by a
company.teamconvention (e.g.,MyCompany.DevTeam.MyName). This hierarchy is used to organize files and control access. - Initialization: The command
chaos team init MyCompany.DevTeam.MyNamecreates a new team repository locally, setting up the directory structure for secrets andramblings, and generating asops-config.ymlfile tailored for team secret sharing using Shamir's Secret Sharing. - Cloning and Activation: Team members can clone an existing team repository (
chaos team clone <REPO_URL>) or activate an existing one (chaos team activate [path]). Activation creates symlinks, registering the team in your local Ch-aOS environment (~/.local/share/chaos/teams). - Deactivation and Pruning: Commands like
chaos team deactivateandchaos team prunehelp remove or clean up records of no longer used teams.
- Naming Convention: Teams are identified by a
- What is it? The
ramblecommand provides a built-in, file-based personal knowledge base or wiki system. It allows you to create, edit, search, and encrypt notes directly from the command line. - Why use it? It's a convenient place to store technical notes, documentation, code snippets, and ideas co-located with your system management tools. Since rambles can be encrypted with
sops, it's also a safe place for sensitive information. - How is it used?
- Organization: Notes are organized into "rambles" (directories) and "ramblings" (YAML files) within
~/.local/share/chaos/ramblings/. - CRUD Operations: Use
chaos ramble create journal.pageto make a new note,editto modify it,readto view it, anddeleteto remove it. - Encryption: A ramble page can be encrypted with
chaos ramble encrypt journal.page. All subsequentreadandeditoperations will handle decryption and re-encryption on their own. - Search: The
chaos ramble findcommand can perform a case-insensitive search through the content of all your rambles by adding a keyword or sentence at the end of the command, or by a tag inside of a dedicatedtagsfield inside of the rambling, by using the--tagflag, oh, btw it can find these even if the rambling is encrypted.
- Organization: Notes are organized into "rambles" (directories) and "ramblings" (YAML files) within
- Ch-iron -- a fedora core for Ch-aOS
- Ch-ronos -- a debian core for Ch-aOS
- Mapping for distro agnosticity (probably impossible)
- Direct SSH integration for chaos init and chaos providers, as sops has native integration with it
- chaos.boats entry_point for dinamically discovered fleet definitions from external sources (like chaos providers, but for fleets)
- Ch-imera: a Ch-aOS entry_point for mini ch-obolo-to-nix compilers (this one is going to be my undergrads degree!)
Contributions are highly welcomed. If you have ideas to improve Ch-aOS, your help is very welcome! Check out CONTRIBUTING.md to get started.
Areas of particular interest include:
- Suggestions and implementations for post-install configurations.
- Creation of issues.
- Creation of plugins and cores for other distros. These can be very simple, btw, one role at a time can make a true turn of events!!
- Creation of new providers, btw if you create one, PLEASE either 1: put it under GPL/AGPL or 2: create a new PR in this repo, it'd be for the interest of everyone to keep chaos both 1 free and 2 open source (although you CAN always just make it proprietary, either way the more, the merrier)!
- Help with documentation and examples.
- Help to integrate for Windows machines (this could be done by contributing directly to pyinfra!!)