cindy-cli 0.2.1

Managing infrastructure at breakneck speed.
<p align="center">
  <img src="https://raw.githubusercontent.com/cindy-rs/cindy/main/assets/logo.png" alt="Cindy" width="520">
</p>

# Cindy

[![crates.io](https://img.shields.io/crates/v/cindy.svg?logo=rust&color=e6731b)](https://crates.io/crates/cindy)
[![docs.rs](https://img.shields.io/docsrs/cindy?logo=docs.rs&color=e6731b)](https://docs.rs/cindy)
[![Home Page](https://img.shields.io/badge/home-cindy.rs-e6731b?logo=firefox)](https://cindy.rs)
[![License](https://img.shields.io/crates/l/cindy.svg?color=e6731b)](https://github.com/cindy-rs/cindy)
[![Discord](https://img.shields.io/badge/chat-Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/M7x6hyq57h)

> A remarkably simple infrastructure management solution.

The purpose of this project is to provide a faster, safer, simpler, and overall better alternative
to current provisioning tools like Ansible and Salt.

It aims to solve all of the pain points of Ansible, while still being "agent-less" and easy to use.

You write Rust. That's it.

You get the full power of the Rust language and ecosystem, on the orchestrator *and* on the remote machine.

A minimal example demonstrating the sample use:

```rust,no_run
#[cindy::wire]
struct Vars {
    my_var_a: u64,
    my_var_b: String,
}

#[cindy::inventory]
fn inventory() -> cindy::Inventory<Vars> {
    cindy::Inventory::new([
            cindy::Host::new(
                "host-a.myenterprise.net",
                ["location:prague", "service:grafana"],
                Vars {
                    my_var_a: 42,
                    my_var_b: "Hello".into(),
                },
            ),
            cindy::Host::new(
                "host-b.myenterprise.net",
                ["location:prague", "service:nginx"],
                Vars {
                    my_var_a: 77,
                    my_var_b: "Hiya".into(),
                },
            ),
        ],
    )
}

#[cindy::remote]
async fn do_stuff(x: u64) -> cindy::Result<u64> {
    let result = x * 3;
    println!("{result}");
    Ok(result)
}

#[cindy::main]
async fn main(host: cindy::Host<Vars>) -> cindy::Result<()> {
    let mut result = do_stuff(host.vars.my_var_a).await?;
    result += 23;
    result = do_stuff(result).await?;
    println!("Final result: {result}");

    Ok(())
}
```

Running it is as simple as running `cindy play --limit 'location:prague & !service:nginx'`