Skip to content

feat(generate): add Services section to generated project README - #2934

Open
mikeland73 wants to merge 1 commit into
mainfrom
claude/focused-goldberg-plk85d
Open

feat(generate): add Services section to generated project README#2934
mikeland73 wants to merge 1 commit into
mainfrom
claude/focused-goldberg-plk85d

Conversation

@mikeland73

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2626.

devbox generate readme produces a project README that documents the
project's scripts, packages, environment variables, and shell init
hook
— but it never mentioned services. As the issue reporter points out,
services are as central to a Devbox environment as scripts and packages, so
their absence from the generated README both hid a useful feature and left
readers unaware that services exist at all.

This PR adds a Services section to the generated README, mirroring how
Scripts are documented:

  • Lists each service available to the project. Services are gathered the same
    way the rest of the CLI gathers them — via Devbox.Services(), which combines
    plugin-provided services with any defined in the project's
    process-compose.yaml.
  • Documents how to start (devbox services up), stop (devbox services stop),
    and list (devbox services ls) services, including targeting an individual
    service by name.
  • The section is omitted entirely when the project defines no services (the
    template guards it with {{- if .Services }}), so existing service-less
    projects generate an unchanged README.

Changes

  • internal/devbox/docgen/docgen.go — pass the project's services into the
    template data (propagating any error from Devbox.Services()).
  • internal/devbox/docgen/readme.tmpl — render the new Services section.
  • testscripts/generate/readme.test.txt — new testscript that defines two
    services via a project process-compose.yaml, runs devbox generate readme,
    and asserts the generated README lists both services and documents how to
    start/stop them.

How was it tested?

  • Added testscripts/generate/readme.test.txt covering the new behavior end to
    end (devbox initdevbox generate readme → assert the Services section and
    service names are present).
  • Rendered readme.tmpl directly against a sample data map (with and without
    services) to confirm the Services section appears when services are present,
    is omitted when they are absent, and that all other sections are unchanged.
  • go build ./..., go vet ./internal/devbox/docgen/, and gofmt are clean on
    the changed files.

cc @ametad (issue reporter) — thanks for the suggestion!

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qgu2wVkmAdXLRKcpgevoBW


Generated by Claude Code

`devbox generate readme` documented scripts, packages, environment
variables, and the shell init hook, but never mentioned services. This
made services less discoverable in a project's generated README even
though they are a first-class part of a Devbox environment.

Add a Services section to the generated README that lists each service
(from the project's plugins and its process-compose.yaml) and documents
how to start, stop, and list them. The section is omitted when the
project defines no services.

Fixes #2626

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qgu2wVkmAdXLRKcpgevoBW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add section about services to README.md file

2 participants