Skip to content

Commit efae23d

Browse files
authored
Merge pull request #12 from hmasdev/11-feat-improve-api-key-management-using-secretstorage
Add API key management and update documentation
2 parents ff074d4 + c09bcb8 commit efae23d

11 files changed

Lines changed: 1837 additions & 81 deletions

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You can install this extension in two ways:
6060
4. Build the extension:
6161

6262
```sh
63-
vsce package
63+
npx vsce package
6464
```
6565

6666
5. Install the extension with `install from VSIX...` in VS Code in the same way as the [above](#download-vsix-file).
@@ -69,11 +69,16 @@ You can install this extension in two ways:
6969

7070
### Preparation(Configuration)
7171

72+
#### Required Configuration
73+
74+
Open the command palette with `Ctrl+Shift+P` and type `QuickTypoFix: Register API Key`.
75+
Then type your OpenAI API key and press `Enter`.
76+
77+
#### Optional Configuration
78+
7279
Open the setting page with `Ctrl+,` and search `quicktypofix`.
7380
Then you can customize this extension as follows:
7481

75-
- **REQUIRED**
76-
- `quicktypofix.apiKey`: The API key for typo corrections. Default is an empty string;
7782
- **Optional**
7883
- `quicktypofix.apiEndpoint`: The OpenAI-compatible chat completion API endpoint for typo corrections. Default is [https://api.openai.com/v1/chat/completions](https://api.openai.com/v1/chat/completions);
7984
- `quicktypofix.modelName`: The LLM model name for typo corrections. Default is `gpt-4o-mini`;
@@ -88,24 +93,34 @@ During writing codes or texts in VS Code, you can use the QuickTypoFix command t
8893

8994
1. `Ctrl+Shift+P` to open the command palette, then type `Fix typo in this line` and select the command.
9095

91-
or
96+
or
9297

9398
2. `Crtl+K Ctrl+N` to execute the command directly.
9499

95100
- NOTE: You can remeber the shortcut by `Ctrl+K` followed by `Ctrl+N` as "これ直して(Kore Naoshite)".
96101

97102
After fixed, the typo will be highlighted for a short period of time. Check them.
98103

104+
#### Optional Usage
105+
106+
Here is the list of ways to use this extension in the command palette:
107+
108+
1. `"QuickTypoFix: Register API Key"`: to register your OpenAI API key.
109+
2. `"QuickTypoFix: Clear Stored API Key"`: to clear the stored OpenAI API key.
110+
3. `"QuickTypoFix: Preview Masked API Key"`: to preview your OpenAI API key with the masked format.
111+
- For example, if your OpenAI API key is `sk-1234567890890890`, the masked format is `sk-**********890`.
112+
4. `"QuickTypoFix: Fix typo in this line"`: to fix the typos in the current line, which is the same as the default shortcut `Ctrl+K Ctrl+N`.
113+
99114
## Development
100115

101-
### Requirements
116+
### Development Requirements
102117

103118
- [Node.js](https://nodejs.org/) >= v20.11.1
104119
- [npm](https://www.npmjs.com/get-npm)
105120
- Dependencies (See the [package.json](./package.json) for the details)
106121
- [vsce](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) >= 2.24.0
107122
- [diff](https://www.npmjs.com/package/diff) >= 5.2.0
108-
- [node-fetch](https://www.npmjs.com/package/ node-fetch) >= 2.6.7
123+
- [node-fetch](https://www.npmjs.com/package/node-fetch) >= 2.6.7
109124

110125
### How to Develop
111126

0 commit comments

Comments
 (0)