@snelusha/noto 1.1.6 → 1.1.7

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 CHANGED
@@ -24,13 +24,41 @@ After installation, you can run `noto` from any terminal.
24
24
 
25
25
  ## Prerequisites
26
26
 
27
- Before using noto, you must configure your [Google Generative API](https://aistudio.google.com/app/apikey) key. Run the following command to set it up:
27
+ Before using noto, you must configure your [Google Generative API](https://aistudio.google.com/app/apikey) key. You can now provide your API key in two ways:
28
+
29
+ ### 1. Using an environment variable (recommended)
30
+
31
+ Set the `NOTO_API_KEY` environment variable globally os it's available across your system.
32
+
33
+ #### macOS/Linux (eg., in .bashrc, .zshrc or .profile)
34
+
35
+ ```bash
36
+ export NOTO_API_KEY=your_api_key_here
37
+ ```
38
+
39
+ Then reload your terminal or run:
40
+
41
+ ```bash
42
+ source ~/.zshrc # or ~/.bashrc or ~/.profile
43
+ ```
44
+
45
+ #### Windows (Command Prompt or PowerShell):
46
+
47
+ ```bash
48
+ setx NOTO_API_KEY "your_api_key_here"
49
+ ```
50
+
51
+ > Note: You may need to restart your terminal (or system) for changes to take effect.
52
+
53
+ ### 2. Using the built-in configuration command
28
54
 
29
55
  ```bash
30
56
  noto config key # or simply noto config key YOUR_API_KEY
31
57
  ```
32
58
 
33
- Optionally, if you wish to configure a different Gemini model (the default model will be used if not configured), run:
59
+ > noto will first look for the `NOTO_API_KEY` environment variable. If it's not found, it will fall back to the local configuration.
60
+
61
+ You can also configure a specific Gemini mode (optional):
34
62
 
35
63
  ```bash
36
64
  noto config model
package/dist/index.js CHANGED
@@ -135,7 +135,7 @@ var exit = async (code) => {
135
135
  var withAuth = (fn, options = { enabled: true }) => {
136
136
  return async (opts) => {
137
137
  const storage = await StorageManager.get();
138
- const apiKey = storage.llm?.apiKey || process.env.NOTO_API_KEY;
138
+ const apiKey = process.env.NOTO_API_KEY || storage.llm?.apiKey;
139
139
  if (!apiKey && options.enabled) {
140
140
  p.log.error(
141
141
  dedent`${color.red("noto api key is missing.")}
@@ -1000,7 +1000,7 @@ var listCommand = () => {
1000
1000
  };
1001
1001
 
1002
1002
  // package.json
1003
- var version = "1.1.6";
1003
+ var version = "1.1.7";
1004
1004
 
1005
1005
  // src/index.ts
1006
1006
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",