AI-enriched OpenAPI specifications. FoxBase DocuFox uses an LLM to improve your OpenAPI (Swagger) specs: it rewrites and expands descriptions, and generates realistic examples for parameters, request bodies, and responses.
- Endpoint summaries and descriptions — Clear, consistent wording for each operation
- Parameter documentation — Descriptions and generated examples based on schemas
- Request body content — Descriptions and example payloads for
application/jsonand other media types - Response documentation — Descriptions and example responses per status and media type
- Incremental updates — Only changed endpoints are re-processed (via
x-docufox-hash), so runs stay fast and cost-effective - Configurable — Use a
docufox.yamlconfig file and optional custom rules to steer the model
- Node.js (v18+ recommended)
- An OpenAI-compatible API key (OpenAI or a compatible endpoint)
npm install @foxbase/docufoxOr run with npx without installing:
npx @foxbase/docufox-
Set your API key (required):
export DOCUFOX_API_KEY=your-api-keyOr put it in a
.envfile in the directory where you run DocuFox:DOCUFOX_API_KEY=your-api-key -
Optionally add a config file — In the same directory, create
docufox.yaml(see Configuration). -
Run FoxBase DocuFox from the directory that contains your OpenAPI file (or where
docufox.yamlpoints):npx docufox
By default, DocuFox reads
./openapi.yamland writes./openapi-enriched.yaml. Usedocufox.yamlto change paths, model, or API URL.
Create a docufox.yaml in the directory where you run FoxBase DocuFox:
| Option | Default | Description |
|---|---|---|
inputFile |
./openapi.yaml |
Path to the source OpenAPI specification |
outputFile |
./openapi-enriched.yaml |
Path where the enriched spec will be written |
apiUrl |
https://api.openai.com/v1 |
Base URL of the OpenAI-compatible API |
model |
gpt-5.4-mini-2026-03-17 |
Model name used for generation |
rules |
[] |
List of extra instructions for the model (e.g. domain rules) |
Example docufox.yaml:
inputFile: ./openapi.yaml
outputFile: ./openapi-enriched.yaml
apiUrl: https://api.openai.com/v1
model: gpt-5.4-mini-2026-03-17
rules:
- When people are mentioned in the specification, always assume that people means characters from the Star Wars films.| Variable | Required | Description |
|---|---|---|
DOCUFOX_API_KEY |
Yes | API key for the LLM endpoint |
- FoxBase DocuFox parses and dereferences your OpenAPI spec.
- For each path and method, it checks an
x-docufox-hashon the operation; if the operation is unchanged since the last run, it is skipped. - For endpoints that need work, it calls the LLM to:
- Improve
summaryanddescription - Improve parameter
descriptions and generateexamplesfrom schemas - Improve request body
descriptionand generate body examples - Improve response
descriptions and generate response examples
- Improve
- The enriched spec is written to
outputFile(after each endpoint so progress is saved).
This section describes how to set up FoxBase DocuFox for local development and contribution.
- Node.js v18 or newer
- npm
- Git
-
Clone the repository:
git clone https://github.com/foxbase/docufox.git cd docufox -
Install dependencies:
npm install
-
Build the project:
npm run build
This compiles TypeScript from
src/todist/and copies the prompt templates fromsrc/prompts/intodist/prompts/. -
Set your API key (same as for normal usage). Create a
.envin the directory from which you will run DocuFox, e.g. inexample/when testing:DOCUFOX_API_KEY=your-api-key
-
Using node to directly run the CLI (with a
docufox.yamland OpenAPI file in the same directory):cd example node ../dist/index.js -
Using npm install inside the example directory:
cd example npm install npx docufoxnpm installneeds to be executed after everynpm run buildin the project root.In addition to
npx docufoxthere is also anenrichscript defined in theexample/package.jsonfile:npm run enrich
-
Link the CLI globally (optional) so you can run
docufoxfrom anywhere during development:npm link cd example docufoxAfter linking the CLI globally, you can also link the package inside the example directory, so it gets updated automatically after every
npm run buildin the project root.cd example npm link @foxbase/docufox npm run enrich
| Script | Description |
|---|---|
npm run build |
Compiles TypeScript and copies prompts to dist/. Run after code changes. |
npm run check |
Runs Biome for formatting and linting (fixes and organizes imports). |
Before submitting changes, run npm run check so formatting and lint rules pass.
| Path | Purpose |
|---|---|
src/index.ts |
CLI entry point; orchestrates parsing, enrichment, and writing. |
src/ai.ts |
LLM calls (text and example generation). |
src/config.ts |
Loads docufox.yaml and defines defaults. |
src/context-objects/ |
Builds context objects passed to prompts (API, endpoint, parameter, etc.). |
src/prompts/ |
Markdown prompt templates used for summaries, descriptions, and examples. |
example/ |
Sample OpenAPI spec and docufox.yaml for manual testing. |
Editing prompts in src/prompts/ requires a rebuild (npm run build) so that dist/prompts/ is updated; the runtime reads prompts from dist/prompts/.
MIT © FoxBase GmbH