golem-add-secret-scala

Adds typed secrets to Scala Golem agents using Secret[T] config fields and CLI commands.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Storing API keys, passwords, and tokens for a Scala Golem agent requires per-environment secret management rather than hardcoding values. This Skill shows how to declare typed secrets in config case classes, read them lazily at runtime, and manage their values through the Golem CLI.

Core Features & Use Cases

  • Typed Secret Declaration: Wrap sensitive fields with Secret[T] inside config case classes, with automatic Schema derivation via zio-blocks.
  • Lazy Secret Reading: Call .get on a Secret[T] to reveal the value, pinning the resolved revision for deterministic retries and replay.
  • CLI Secret Management: Create, list, update, and delete secrets with golem secret commands using camelCase paths matching Scala field names.
  • Use Case: You are building a Scala Golem agent that connects to a database. Declare password: Secret[String] in your DbConfig, set a dev default in golem.yaml, and create the production value with golem secret create db.password.

Quick Start

Ask the agent to add a secret API key field to your Scala Golem agent's config class and show the CLI command to set its value.

Frequently Asked Questions about golem-add-secret-scala

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

FAQPage Schema
How do I add secrets to a Scala Golem agent?

Declare sensitive fields as Secret[T] inside your config case class, such as password: Secret[String]. Secret[T] has an implicit Schema, so Schema.derived works automatically on the parent case class, and you reveal the value at runtime by calling .get.

How do I create and update Golem secrets from the CLI?

Use golem secret create with a camelCase path, --secret-type, and --secret-value, for example golem secret create db.password --secret-type String --secret-value s3cret. Update with golem secret update-value and remove with golem secret delete, optionally using --id instead of the path.

What secret types does the Golem CLI support for Scala agents?

The --secret-type argument accepts Scala type names such as String, Int, Boolean, List[String], and Option[Int]. JSON-encoded analysed types like '{"type":"Str"}' are also supported as a fallback.

Can I set default secret values in golem.yaml for local development?

Yes, use the secretDefaults section in golem.yaml to provide values per environment for local development. Production secrets should be managed through the golem secret CLI instead of being committed to configuration files.

Why does my Golem agent fail to start when a secret is missing?

Missing required secrets cause agent creation to fail because the config schema declares them as mandatory Secret[T] fields. Create the secret via the CLI or add a secretDefaults entry for the environment before deploying the agent.