golem-create-agent-instance-moonbit

Creates MoonBit Golem agent instances via CLI with environment variables and configuration.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-create-agent-instance-moonbit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-create-agent-instance-moonbit
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/moonbit/golem-create-agent-instance-moonbit
Command: npx skills add https://github.com/golemcloud/golem --skill golem-create-agent-instance-moonbit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers building MoonBit agents on Golem often need to pre-create agent instances with specific environment variables, configuration, or WASI config before any method invocation, rather than relying on implicit creation during the first call.

Core Features & Use Cases

  • Explicit Agent Pre-Creation: Run golem agent new with an agent ID like ChatRoom("general") to initialize an idle agent without invoking any method.
  • Startup Configuration: Attach environment variables (--env), typed configuration (--config), and WASI config (--wasi-config) at creation time.
  • Auto-Deploy Support: Automatically builds and deploys the component first when run from an application directory if the agent is not yet deployed.
  • Use Case: Pre-create an OrderProcessor("us-east") agent with a database URL and retry configuration so it is fully configured before receiving its first invocation.

Quick Start

Ask the assistant to create a new Golem agent instance for your MoonBit agent type with the constructor parameters and environment variables you need.

Frequently Asked Questions about golem-create-agent-instance-moonbit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Golem agent instance without invoking a method?

Run `golem agent new 'AgentTypeName(params)'` with the golem or golem-cli binary. This initializes the agent with its constructor parameters in an idle state, ready to receive invocations later via `golem agent invoke`.

How do I pass environment variables when creating a Golem agent?

Use the repeatable `--env KEY=VALUE` flag, for example `golem agent new 'MyAgent("user-123")' --env API_KEY=sk-abc123`. You can also pass typed configuration with `--config` and WASI config with `--wasi-config`.

What is the difference between golem agent new and golem agent invoke?

`golem agent new` explicitly pre-creates an agent with environment variables or configuration before any call, while `golem agent invoke` calls a method and implicitly creates the agent on first invocation. An agent created with `new` can be invoked later using the same agent ID.

What format do constructor parameters use for MoonBit Golem agents?

Parameters use Rust syntax inside the agent ID, such as `MyAgent(MyConfig { region: "us-east", max_connections: Some(10) })`. Agent type names use PascalCase matching the MoonBit struct name, and parameterless agents use empty parentheses.

Does golem agent new deploy the component automatically?

Yes. If the agent's component has not been deployed yet and the CLI is run from an application directory, `golem agent new` automatically builds and deploys the component before creating the agent instance.