Skip to content

Commit 2f0d8b2

Browse files
Documentation updates from Promptless
1 parent 3b8d3be commit 2f0d8b2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/get-started/installation/index.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,39 @@ You should see output in the terminal indicating the progress and results of the
4848

4949
[![Sample test screenshot](./example.png)](./example.png)
5050

51+
## Configuration via environment variable
52+
53+
You can configure Doc Detective using the `DOC_DETECTIVE_CONFIG` environment variable without creating a config file.
54+
55+
Set the environment variable to a JSON string containing your configuration:
56+
57+
```bash title="Basic usage"
58+
export DOC_DETECTIVE_CONFIG='{"logLevel":"debug"}'
59+
npx doc-detective
60+
```
61+
62+
For example, to disable telemetry and set a custom output directory:
63+
64+
```bash title="Multiple options"
65+
export DOC_DETECTIVE_CONFIG='{"logLevel":"error","telemetry":{"send":false},"output":"./test-results"}'
66+
npx doc-detective --input sample.spec.json
67+
```
68+
69+
### Configuration priority
70+
71+
When multiple configuration sources are present, Doc Detective applies them in this order (later values override earlier ones):
72+
73+
1. Default values
74+
2. Config file values (`.doc-detective.json`, etc.)
75+
3. **Environment variable values** (`DOC_DETECTIVE_CONFIG`)
76+
4. Command-line arguments (highest priority)
77+
78+
:::note
79+
80+
Make sure your JSON is properly formatted and values are valid. If `DOC_DETECTIVE_CONFIG` contains invalid JSON or values, Doc Detective will display an error and exit.
81+
82+
:::
83+
5184
## Next steps
5285

5386
Next up, take a look at some of the [concepts](/docs/get-started/concepts) native to Doc Detective, check out some of the guided [tutorials](/docs/category/tutorials), or explore how to write [tests](/docs/get-started/tests) and [actions](/docs/category/actions) to automate your documentation testing.

docs/references/schemas/config.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
Configuration options for Doc Detective operations.
55

6+
:::note
7+
8+
You can also configure Doc Detective using the `DOC_DETECTIVE_CONFIG` environment variable instead of a config file. Set it to a JSON string with your configuration options. See the [installation guide](/docs/get-started/installation#configuration-via-environment-variable) for details.
9+
10+
:::
11+
612
## Fields
713

814
Field | Type | Description | Default

0 commit comments

Comments
 (0)