You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ Local config still has more priority than Global config, but you may set `OCO_MO
135
135
Simply set any of the variables above like this:
136
136
137
137
```sh
138
-
oco config set OCO_OPENAI_API_KEY=gpt-4
138
+
oco config set OCO_MODEL=gpt-4
139
139
```
140
140
141
141
Configure [GitMoji](https://gitmoji.dev/) to preface a message.
@@ -209,6 +209,31 @@ oco '$msg #205’
209
209
210
210
> opencommit examines placeholders in the parameters, allowing you to append additional information before and after the placeholders, such as the relevant Issue or Pull Request. Similarly, you have the option to customize the OCO_MESSAGE_TEMPLATE_PLACEHOLDER configuration item, for example, simplifying it to $m!"
211
211
212
+
### Message Template Placeholder Config
213
+
214
+
#### Overview
215
+
216
+
The `OCO_MESSAGE_TEMPLATE_PLACEHOLDER` feature in the `opencommit` tool allows users to embed a custom message within the generated commit message using a template function. This configuration is designed to enhance the flexibility and customizability of commit messages, making it easier for users to include relevant information directly within their commits.
217
+
218
+
#### Implementation Details
219
+
220
+
In our codebase, the implementation of this feature can be found in the following segment:
221
+
```javascript
222
+
commitMessage = messageTemplate.replace(
223
+
config?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
224
+
commitMessage
225
+
);
226
+
```
227
+
This line is responsible for replacing the placeholder in the `messageTemplate` with the actual `commitMessage`.
228
+
229
+
#### Usage
230
+
231
+
For instance, using the command `oco '$msg #205’`, users can leverage this feature. The provided code represents the backend mechanics of such commands, ensuring that the placeholder is replaced with the appropriate commit message.
232
+
233
+
#### Committing with the Message
234
+
235
+
Once users have generated their desired commit message, they can proceed to commit using the generated message. By understanding the feature's full potential and its implementation details, users can confidently use the generated messages for their commits.
236
+
212
237
### Ignore files
213
238
214
239
You can remove files from being sent to OpenAI by creating a `.opencommitignore` file. For example:
0 commit comments