lerd-add-service
Add or edit a lerd service preset (database, cache, search engine, admin dashboard) as YAML in the lerd-services store. Use whenever the task is to add a new service, a new version of a service, or wire a service into projects — never add services in Go.
- License 许可
- MIT
- 所属仓库
- lerd-env/lerd
- 最近更新
- 2026-11-11
- Stars
- ★ 1.5k
- Forks
- 96
01 前言 Front Matter
- name
- lerd-add-service
- description
- Add or edit a lerd service preset (database, cache, search engine, admin dashboard) as YAML in the lerd-services store. Use whenever the task is to add a new service, a new version of a service, or wire a service into projects — never add services in Go.
03 SKILL.md 正文
Add a lerd service preset
Services are submitted to the lerd-env/services repo
(https://github.com/lerd-env/services) as services/<name>.yaml,
one file per service. They are data, not Go. lerd ships only the default stack
(mysql, postgres, redis, meilisearch, rustfs, mailpit); everything else is a preset
there and reaches every install within ~24h with no binary release.
The lerd-services/ directory in the lerd repo is a local checkout you can edit
and test against, but the pull request goes to lerd-env/services.
Procedure
-
Find the closest existing preset and copy it. The existing YAML is the schema of record — do not invent fields. For a Redis-alike copy
valkey.yaml; for a database copymariadb.yamlormongo.yaml; for an admin dashboard copyphpmyadmin.yaml/pgadmin.yaml. -
Fill the core fields (see
valkey.yamlfor the minimal shape):name,description,family(family groups alternates + admin UIs)image(pin a specific tag),ports("host:container")data_dirfor the persistent volumeenv_vars— the host/port/credentials injected into a linked site's.envconnection_urlwhere applicable
-
Avoid host-port collisions. If the service shares a protocol/port with a default (e.g. Valkey vs Redis on 6379), publish it on a shifted host port so both can coexist, and note why in a short comment. lerd also auto-shifts collisions, but pick a sane default.
-
Declare dependencies and mounted config if the preset needs them (an admin dashboard depends on its database family; some presets mount a generated config file for auto-login). Copy the pattern from the matching existing preset.
For a database engine, also add an
introspect.list_databasescommand so it appears in the web UI's Databases tab. It runs viash -cinside the container and must print onename<TAB>size_bytesrow per user database, filtering the engine's own system databases. Copy the block frommariadb.yaml(MySQL family),postgres-pgvector.yaml(Postgres), ormongo.yaml(Mongo). lerd passes thelerdadmin password via the exec env, so no inline credentials are needed for MySQL/Postgres. -
Give it its mark and its colour.
categoryplaces it in a discovery section andcoloris its brand tint, a plain hex literal (#00758f) and nothing else — a colour function or CSS variable is dropped. For the mark, either name a built-in glyph withicon:or ship the service's own asservices/<name>.svgbeside the YAML. That file is monochrome: a single silhouette of filled paths with nofill,stroke,styleorclassof its own, in a bare<svg viewBox="…">, since lerd strips everything but the geometry on the way in and paints it in the declared colour. Not a full-colour brand mark; it renders beside the built-in glyphs and has to flip themes. -
Update the store README table in the lerd-env/services
README.mdso the new service is listed. -
Validate end-to-end with a real lerd install:
lerd service search <name> lerd service preset <name>Confirm the container starts, the port is reachable, and a linked site's
.envgets the expected vars.
Rules
- The PR goes to lerd-env/services, not the lerd binary repo.
- One service per file. No Go changes. No new mergers.
- Pin image tags; never rely on
latest. - Keep
descriptionone line; it shows inlerd service search.
04 同仓库更多 Skills
lerd-hello
Greets lerd sites. Use when the user asks to greet a site.
lerd-preflight
Run the full local verification gate for lerd before committing — build, test, vet, gofmt, UI tests, installer tests, then install the local build and smoke-test. Use before every commit or PR, and whenever asked to "verify", "check CI locally", or "make sure it's green".
lerd-open-pr
Draft and open a pull request the lerd way — issue-first, correct issue linking, human prose, none of the banned sections. Use when asked to open, prepare, or draft a PR for lerd. Never creates anything on GitHub without explicit per-action approval.
lerd-add-framework
Add or extend a lerd framework definition (a new PHP framework or a new major version) as versioned YAML in the lerd-frameworks store. Use whenever the task involves framework detection, per-framework workers, env wiring, doctor checks, custom commands, or scaffolding — never branch on a framework name in Go.