diff --git a/README.md b/README.md index 291fb8a..0427902 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ A dagger sdk written in rust for rust. -## Disclaimer +# Usage -Work in progress. This is not ready for usage yet +See [dagger-sdk](./crates/dagger-sdk/README.md) ### Status @@ -23,7 +23,7 @@ Work in progress. This is not ready for usage yet - [x] Add codegen to hook into querier - [ ] fix build / release cycle - [ ] general api stabilisation -- [ ] document usage +- [x] document usage - [ ] make async variant ## Architecture diff --git a/crates/dagger-sdk/README.md b/crates/dagger-sdk/README.md index bdfeac8..3636e7c 100644 --- a/crates/dagger-sdk/README.md +++ b/crates/dagger-sdk/README.md @@ -2,14 +2,46 @@ A dagger sdk written in rust for rust. -## Disclaimer +## Examples -Work in progress. This is not ready for usage yet +See [examples](./examples/) -### Status +Run them like so -- [x] dagger cli downloader -- [x] dagger network session -- [ ] graphql rust codegen (User API) -- [ ] fix build / release cycle -- [ ] general api stabilisation +```bash +cargo run --example first-pipeline +``` + +The examples match the folder name in each directory in examples + +## Install + +Simply install like: + +```bash +cargo install dagger-sdk +``` + +### Usage + +```rust +fn main() -> eyre::Result<()> { + let client = dagger_sdk::client::connect()?; + + let version = client + .container(None) + .from("golang:1.19".into()) + .with_exec(vec!["go".into(), "version".into()], None) + .stdout(); + + println!("Hello from Dagger and {}", version.trim()); + + Ok(()) +} +``` + +And run it like a normal application: + +```bash +cargo run +``` diff --git a/crates/dagger-sdk/image-fs.tar b/crates/dagger-sdk/image-fs.tar deleted file mode 100644 index e69de29..0000000