squarecloud 0.1.0

Async Rust client for the SquareCloud API
Documentation

squarecloud-rs

Crates.io Docs.rs License: MIT

A lightweight, idiomatic, async Rust client for the SquareCloud API. Deploy applications, manage files and environment variables, provision databases, take snapshots, and organize workspaces, with compile-time type safety and zero-cost async through Tokio.

Installation

[dependencies]
squarecloud = { git = "https://github.com/robert-nogueira/squarecloud-rs" }
tokio = { version = "1", features = ["full"] }

Configuration

The client reads API_TOKEN on first use, either from the process environment or a .env file in the working directory.

Quick start

use squarecloud::ApiClient;

#[tokio::main]
async fn main() {
    let client = ApiClient::new();

    let me = client.me().await.unwrap();
    println!("Logged in as {} ({})", me.user.name, me.user.email);

    let status = client.app("application_id").status().await.unwrap();
    println!("CPU: {}  RAM: {}", status.cpu, status.ram);
}

Examples

The examples/ directory contains one file per method, organized by resource:

Folder Covers
apps/ info, status, logs, metrics, start/stop/restart, commit, delete, network, domain
env/ list, upsert, overwrite, delete
files/ list, read, write, move, delete
snapshots/ create, list, restore
deployments/ current deploy, history, webhook integration
database/ full lifecycle - create, status, metrics, credentials, snapshots, delete
workspaces/ create, members, permissions, leave, delete
cargo run --example me
cargo run --example app_status -- <app_id>
cargo run --example database_info -- <db_id>

License

MIT