@snelusha/noto 1.1.6 → 1.1.8

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
@@ -63,6 +63,7 @@ var AvailableModelsSchema = z.enum([
63
63
  "gemini-1.5-pro",
64
64
  "gemini-1.5-pro-latest",
65
65
  "gemini-2.0-flash-001",
66
+ "gemini-2.0-flash-exp",
66
67
  "gemini-2.0-flash-lite-preview-02-05",
67
68
  "gemini-2.5-pro-exp-03-25"
68
69
  ]);
@@ -135,7 +136,7 @@ var exit = async (code) => {
135
136
  var withAuth = (fn, options = { enabled: true }) => {
136
137
  return async (opts) => {
137
138
  const storage = await StorageManager.get();
138
- const apiKey = storage.llm?.apiKey || process.env.NOTO_API_KEY;
139
+ const apiKey = process.env.NOTO_API_KEY || storage.llm?.apiKey;
139
140
  if (!apiKey && options.enabled) {
140
141
  p.log.error(
141
142
  dedent`${color.red("noto api key is missing.")}
@@ -282,7 +283,7 @@ var NotoError = class _NotoError extends Error {
282
283
  var google = createGoogleGenerativeAI({
283
284
  apiKey: (await StorageManager.get()).llm?.apiKey ?? "api-key"
284
285
  });
285
- var defaultModel = "gemini-2.0-flash-001";
286
+ var defaultModel = "gemini-2.0-flash-lite-preview-02-05";
286
287
  var models = {
287
288
  "gemini-1.5-flash": google("gemini-1.5-flash"),
288
289
  "gemini-1.5-flash-latest": google("gemini-1.5-flash-latest"),
@@ -291,6 +292,7 @@ var models = {
291
292
  "gemini-1.5-pro": google("gemini-1.5-pro"),
292
293
  "gemini-1.5-pro-latest": google("gemini-1.5-pro-latest"),
293
294
  "gemini-2.0-flash-001": google("gemini-2.0-flash-001"),
295
+ "gemini-2.0-flash-exp": google("gemini-2.0-flash-exp"),
294
296
  "gemini-2.0-flash-lite-preview-02-05": google(
295
297
  "gemini-2.0-flash-lite-preview-02-05"
296
298
  ),
@@ -1000,7 +1002,7 @@ var listCommand = () => {
1000
1002
  };
1001
1003
 
1002
1004
  // package.json
1003
- var version = "1.1.6";
1005
+ var version = "1.1.8";
1004
1006
 
1005
1007
  // src/index.ts
1006
1008
  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.8",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,15 +42,15 @@
42
42
  "cli"
43
43
  ],
44
44
  "devDependencies": {
45
- "@types/node": "^22.14.1",
45
+ "@types/node": "^22.15.2",
46
46
  "tsup": "^8.4.0",
47
47
  "typescript": "^5.8.3",
48
48
  "vitest": "^3.1.2"
49
49
  },
50
50
  "dependencies": {
51
- "@ai-sdk/google": "^1.2.12",
51
+ "@ai-sdk/google": "^1.2.13",
52
52
  "@clack/prompts": "^0.10.1",
53
- "ai": "^4.3.9",
53
+ "ai": "^4.3.10",
54
54
  "arg": "^5.0.2",
55
55
  "clipboardy": "^4.0.0",
56
56
  "dedent": "^1.5.3",