@snelusha/noto 1.1.5 → 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.
Files changed (3) hide show
  1. package/README.md +30 -2
  2. package/dist/index.js +16 -3
  3. package/package.json +2 -2
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,8 @@ 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
- if (!storage.llm?.apiKey && options.enabled) {
138
+ const apiKey = process.env.NOTO_API_KEY || storage.llm?.apiKey;
139
+ if (!apiKey && options.enabled) {
139
140
  p.log.error(
140
141
  dedent`${color.red("noto api key is missing.")}
141
142
  ${color.dim(`run ${color.cyan("`noto config key`")} to set it up.`)}`
@@ -298,7 +299,7 @@ var models = {
298
299
  var availableModels = Object.keys(models);
299
300
  var getModel = async () => {
300
301
  let model2 = (await StorageManager.get()).llm?.model;
301
- if (!model2 || model2 === "gemini-2.0-pro-exp-02-05") {
302
+ if (!model2) {
302
303
  model2 = defaultModel;
303
304
  await StorageManager.update((current2) => ({
304
305
  ...current2,
@@ -710,6 +711,18 @@ var command3 = {
710
711
  flag: "--delete",
711
712
  alias: "-d",
712
713
  description: "delete a branch"
714
+ },
715
+ {
716
+ type: Boolean,
717
+ flag: "--force",
718
+ alias: "-f",
719
+ description: "force delete a branch"
720
+ },
721
+ {
722
+ type: Boolean,
723
+ flag: "--all",
724
+ alias: "-a",
725
+ description: "select all branches except the current one"
713
726
  }
714
727
  ],
715
728
  execute: withRepository(
@@ -987,7 +1000,7 @@ var listCommand = () => {
987
1000
  };
988
1001
 
989
1002
  // package.json
990
- var version = "1.1.5";
1003
+ var version = "1.1.7";
991
1004
 
992
1005
  // src/index.ts
993
1006
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "@types/node": "^22.14.1",
46
46
  "tsup": "^8.4.0",
47
47
  "typescript": "^5.8.3",
48
- "vitest": "^3.1.1"
48
+ "vitest": "^3.1.2"
49
49
  },
50
50
  "dependencies": {
51
51
  "@ai-sdk/google": "^1.2.12",