@bitnami/readme-generator-for-helm

中文文档
2.7.2发布于 2025/07/14Apache-2.0CommonJS近 30 天下载 2.8万

Autogenerate READMEs tables and OpenAPI schemas for Helm Charts

原始使用文档
文档目录15 节
  1. How it works
  2. Requirements
  3. Install
  4. Single Binary
  5. Test
  6. Lint
  7. Basic usage
  8. values.yaml Metadata
  9. Configuration file
  10. Pre-commit
  11. Versions
  12. 2.8.0
  13. 2.4.0
  14. 2.0.0
  15. License

Readme Generator For Helm

  • Autogenerate Helm Charts READMEs' tables based on values YAML file metadata.
  • Autogenerate an OpenAPI compliant JSON schema defining the values.yaml structure of the Helm Chart. The file generated will be a JSON file formatted according to the OpenAPIv3 SchemaObject definition.

How it works

The tool expects some metadata for the descriptions in the provided values.yaml file. It will parse and check the metadata against the real values. If the metadata is consistent with the real values, it will generate and insert the values table into the provided README.md file. If the metadata is not correct, it will print the full list of errors. It checks whether there is metadata for non-existing values or there is missing metadata for an existing value.

The table that will be inserted into the readme.md will have the following structure:

## Parameters

### Section 1 title

| Name      | Description             | Default        |
|:----------|:------------------------|:---------------|
| `value_1` | Description for value 1 | `defaultValue` |
| `value_2` | Description for value 2 | `defaultValue` |
| `value_3` | Description for value 3 | `defaultValue` |

### Section 2 title

| Name      | Description             | Default        |
|:----------|:------------------------|:---------------|
| `value_1` | Description for value 1 | `defaultValue` |
| `value_2` | Description for value 2 | `defaultValue` |
| `value_3` | Description for value 3 | `defaultValue` |

...

The number of # characters needed for the section titles is dynamically calculated, and the title of the Parameters section can be configured via the configuration file. The README.md file with a ## Parameters section must be created before running the tool, the Parameters section should have two # or more symbols.

Requirements

The project has been developed and tested with node version 22.x.

Install

Execute the following commands to install the tool:

git clone https://github.com/bitnami/readme-generator-for-helm
npm install ./readme-generator-for-helm

Depending on how you installed NodeJS in your system, you may need to modify your PATH environment variable to be able to execute the tool.

Single Binary

Execute the following commands to create a single executable binary for the tool:

git clone https://github.com/bitnami/readme-generator-for-helm
cd ./readme-generator-for-helm
npm install
npm install -g @yao-pkg/pkg
pkg . -o readme-generator-for-helm

Test

We use Jest to implement the tests. In order to test your changes, execute the following command:

npm run-script test

Lint

After modifying the code execute the following command to pass the linter:

npm run-script lint

Basic usage

Usage: readme-generator [options]

Options:
  -v, --values <path>  Path to the values.yaml file
  -r, --readme <path>  Path to the README.md file
  -c, --config <path>  Path to the config file
  -s, --schema <path>  Path for the OpenAPI Schema output file
  --version            Show Readme Generator version
  -h, --help           display help for command

values.yaml Metadata

For the tool to work, you need to add some metadata to your values.yaml file.

By default we use a format similar to Javadoc, using @xxx for tags followed by the tag structure.

The following are the tags supported at this very moment:

  • For a parameter: ## @param fullKeyPath [modifier?] Description.
  • For a section: ## @section Section Title".
  • To skip an object and all its children: ## @skip fullKeyPath Description?.
  • To add a description for an intermediate object (i.e. not final in the YAML tree): ## @extra fullkeyPath Description.

All the tags as well as the two initial # characters for the comments style can be configured in the configuration file.

[!IMPORTANT] tags' order or position in the file is NOT important except for the @section tag. The @section that will include in the section all the parameters after it until a new section is found or the file ends.

The modifier is optional and it will change how the parameter is processed. Several modifiers can be applied by separating them using commas (,). When affecting the value, the last one takes precedence.

Currently supported modifiers:

  • [array] Indicates that the value of the parameter must be set to [].
  • [object] Indicates that the value of the parameter must be set to {}.
  • [string] Indicates that the value of the parameter must be set to "".
  • [nullable] Indicates that the parameter value can be set to null.
  • [default: DEFAULT_VALUE] Sets the default value to DEFAULT_VALUE.

The modifiers are also customizable via the configuration file.

In case you are adding a custom modifier to a parameter that does not have value in the values file you must add one of the supported modifiers as last modifier.

Example:

Values file

# @param noDefaultValue [number, nullable] Description
# noDefaultValue: 1

Custom configuration snippet:

{
  ...
    "modifiers": {
    "array": "array",
    "object": "object"
    "string": "string"
    "nullable": "nullable",
    "number": "number"
  },
  ...
}

Configuration file

The configuration file has the following structure:

{
  "comments": {
    "format": "##"                               <-- Which is the comments format in the values YAML
  },
  "tags": {
    "param": "@param",                           <-- Tag that indicates a parameter
    "section": "@section",                       <-- Tag that indicates a section
    "descriptionStart": "@descriptionStart",     <-- Tag that indicates the beginning of a section description
    "descriptionEnd": "@descriptionEnd",         <-- Tag that indicates the end of a section description
    "skip": "@skip",                             <-- Tag that indicates the object must be skipped
    "extra": "@extra"                            <-- Tag to add a description for an intermediate object
  },
  "modifiers": {
    "array": "array",                            <-- Modifier that indicates an array type
    "object": "object"                           <-- Modifier that indicates an object type
    "string": "string"                           <-- Modifier that indicates a string type
    "nullable": "nullable"                       <-- Modifier that indicates a parameter that can be set to null
  },
  "regexp": {
    "paramsSectionTitle": "Parameters"           <-- Title of the parameters section to replace in the README.md
  }
}

Pre-commit

Add this to your .pre-commit-config.yaml:

- repo: https://github.com/bitnami/readme-generator-for-helm
  rev: "main"
  hooks:
    - id: helm-readme-generator
      # in order to run helm-readme-generator only once
      pass_filenames: false
      always_run: true
      # default args are [--readme=chart/README.md, --values=chart/values.yaml]
      args: [--readme=path/to/README.md, --values=path/to/values.yaml]

Versions

2.8.0

Descriptions now discard only a single whitespace. This way, code blocks can use proper indentation.

2.4.0

Add descriptionStart and descriptionEnd config options (default tags: @descriptionStart and @descriptionEnd) to allow text block upfront each section table in README.md. When changing the tag values for these, ensure to not being conflicted with section config option.

If you are using a customized configuration file, please add the new default tags to prevent any incorrect behavior.

2.0.0

The -m (--metadata) option has been renamed to -s (--schema) in order to properly identify what it generates.

License

Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

版本与发布记录

@bitnami/readme-generator-for-helm 共发布 10 个版本,首次发布于 2022/10/19;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.7.2latest2025/07/141.3 年前
2.7.12025/06/251.4 年前
2.7.02025/01/231.8 年前
2.6.12024/04/222 年前
2.6.02023/10/193 年前
2.5.22023/10/113 年前

关于 @bitnami/readme-generator-for-helm 的常见问题

@bitnami/readme-generator-for-helm 是什么?

Autogenerate READMEs tables and OpenAPI schemas for Helm Charts

如何安装 @bitnami/readme-generator-for-helm?

在项目目录运行 npm install @bitnami/readme-generator-for-helm,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 readme-generator,可以用 npx readme-generator 直接运行。

@bitnami/readme-generator-for-helm 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bitnami__readme-generator-for-helm 是否存在。

@bitnami/readme-generator-for-helm 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bitnami/readme-generator-for-helm 可以商用吗?

@bitnami/readme-generator-for-helm 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bitnami/readme-generator-for-helm 的下载量有多少?

根据 npm 官方下载统计,@bitnami/readme-generator-for-helm 在 2026/10/08 – 2026/11/06 这 30 天内被下载 27,599 次,日均约 920 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bitnami/readme-generator-for-helm 还在维护吗?

最新版本 2.7.2 发布于 2025/07/14(1.3 年前);至今共发布 10 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/10/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。