Skip to content
Kitbay
Skill

add-setting-env

NOASSERTIONUpdated on Nov 11, 202684,974GitHub stars

A maintainer skill in the LobeHub repository, run only when called, for adding a server-side environment variable that sets the default for a user setting.

What the skill teaches

A maintainer skill in the LobeHub repository, run only when called, for adding a server-side environment variable that sets the default for a user setting. A user's own choice still wins, then the server variable, then the built-in default. The steps define the variable with a Zod schema in the env package, and for a new settings domain also extend the server config type, map the variable in the global server config and merge it into the user store. The variable is then documented in .env.example and in the English and Chinese self-hosting docs. A worked example adds a variable for the default number of generated images, allowed from 1 to 20.

Capabilities

  • Define a typed server environment variable
  • Feed it into default user settings
  • Document it in .env.example and self-hosting docs