| Crates.io | generate-did |
| lib.rs | generate-did |
| version | 0.1.1 |
| created_at | 2025-05-29 11:16:47.550324+00 |
| updated_at | 2025-07-10 13:17:52.419682+00 |
| description | A tool to generate Candid (.did) files for Internet Computer Rust canisters |
| homepage | https://github.com/Stephen-Kimoi/generate-did |
| repository | https://github.com/Stephen-Kimoi/generate-did |
| max_upload_size | |
| id | 1693692 |
| size | 22,396 |
A command-line tool to generate Candid (.did) files for Internet Computer Rust canisters.
Install from crates.io:
cargo install generate-did
From your project root or from inside the canister directory, run:
generate-did <canister_name>
<canister_name> with the directory name of your canister (must contain a Cargo.toml)..did file will always be placed in the canister directory.cargo install candid-extractor
export_candid macro at the end of your lib.rs file:use ic_cdk::query;
use ic_cdk::update;
#[query]
fn hello(name: String) -> String {
format!("Hello, {}!", name)
}
#[update]
fn world(name: String) -> String {
format!("World, {}!", name)
}
// Enable Candid export
ic_cdk::export_candid!();
Cargo.toml and buildable to WASM.This project is licensed under the MIT License.