一键导入
golem-add-rust-crate
Add a new Rust crate dependency to a Rust Golem project. Use when the user asks to add a library, crate, or dependency.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new Rust crate dependency to a Rust Golem project. Use when the user asks to add a library, crate, or dependency.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Invoking a Rust Golem agent method from the CLI. Use when asked to call, invoke, or run a method on a deployed agent using golem agent invoke.
Defining environment variables for Golem agents. Use when configuring env vars in golem.yaml at the component template, component, agent type, or preset level, passing env vars to individual agent instances via CLI, or using template substitution and merge modes.
Exposing a Rust Golem agent over HTTP. Use when the user asks to add HTTP endpoints, mount an agent to a URL path, or expose agent methods as a REST API.
Adding secrets to Rust Golem agents. Use when the user needs to store sensitive configuration such as API keys, passwords, or tokens that should not be checked into source control.
Calling Golem agents from external Rust applications using generated bridge SDKs. Use when the user wants to invoke agents from outside the Golem platform, from a Rust CLI, server, or any native Rust application.
Setting up a Golem Cloud account from scratch. Use when creating a Golem Cloud account, authenticating with Golem Cloud via the CLI, setting up a cloud profile, or deploying to Golem Cloud for the first time.
| name | golem-add-rust-crate |
| description | Add a new Rust crate dependency to a Rust Golem project. Use when the user asks to add a library, crate, or dependency. |
wasm32-wasip2 — only crates that support this target will work.mmap, networking via std::net, or platform-specific C libraries will not compile.wasm32-wasi generally work.golem build to find out.Add the dependency to Cargo.toml
In the component's Cargo.toml (not a workspace Cargo.toml), add the crate under [dependencies]:
[dependencies]
my-crate = "1.0"
If the project has a Cargo workspace with [workspace.dependencies], add the version there and reference it with my-crate = { workspace = true } in the component crate.
Build to verify
golem build
Do NOT run cargo build directly — always use golem build.
If the build fails
wasm32-wasip1.wasm or wasi feature flag if the crate provides one.These crates are already in the project's Cargo.toml — do NOT add them again:
golem-rust — Golem agent framework, durability, transactionswstd — WASI standard library (HTTP client, async I/O)log — loggingserde / serde_json — serializationUse wstd::http for HTTP requests. The standard std::net module is not available on WASM.
To add AI capabilities, add the relevant golem-ai-* provider crate (e.g., golem-ai-llm-openai) and configure the provider in the component's golem.yaml dependencies section.