@chatbotkit/cli 1.21.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/bin/cbk.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,22 @@ Set your ChatBotKit API token as an environment variable:
|
|
|
25
25
|
export CHATBOTKIT_API_TOKEN=<your token here>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
### Environment Configuration
|
|
29
|
+
|
|
30
|
+
The CLI automatically loads environment variables from the following locations (in order of precedence):
|
|
31
|
+
|
|
32
|
+
1. `.env.local` - Project-specific local configuration (current directory)
|
|
33
|
+
2. `.env` - Project configuration (current directory)
|
|
34
|
+
3. `~/.cbk/env` - Global user configuration (home directory fallback)
|
|
35
|
+
|
|
36
|
+
This allows you to store your API token globally in `~/.cbk/env` for convenience, while still being able to override it per-project using local `.env` files.
|
|
37
|
+
|
|
38
|
+
**Example `~/.cbk/env` file:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
CHATBOTKIT_API_TOKEN=your_token_here
|
|
42
|
+
```
|
|
43
|
+
|
|
28
44
|
## Features
|
|
29
45
|
|
|
30
46
|
### API Commands
|
package/bin/cbk.js
CHANGED
|
@@ -4,9 +4,11 @@ import dotenv from 'dotenv'
|
|
|
4
4
|
import cli from '@chatbotkit/cli'
|
|
5
5
|
import { printError } from '@chatbotkit/cli/output'
|
|
6
6
|
|
|
7
|
+
import { homedir } from 'os'
|
|
8
|
+
import { join } from 'path'
|
|
9
|
+
|
|
7
10
|
dotenv.config({
|
|
8
|
-
|
|
9
|
-
path: ['.env.local', '.env'],
|
|
11
|
+
path: ['.env.local', '.env', join(homedir(), '.cbk', 'env')],
|
|
10
12
|
})
|
|
11
13
|
|
|
12
14
|
process.on('unhandledRejection', printError)
|