556 Commits

Author SHA1 Message Date
di-sukharev
2540c169dc 3.2.8 v3.2.8 2025-06-08 11:17:08 +03:00
di-sukharev
75147e91e7 refactor(git.ts): improve git add completion message for clarity 2025-06-08 10:42:07 +03:00
di-sukharev
59b6edb49c format 2025-06-08 10:41:16 +03:00
di-sukharev
7683004464 build 2025-06-08 10:41:13 +03:00
di-sukharev
e1f657939f chore(deps): bump esbuild from 0.15.18 to 0.25.5 and @actions/github from 5.1.1 to 6.0.1 2025-06-08 10:40:42 +03:00
GPT8
55904155a8 Merge pull request #472 from kakakakakku/fgm
feat(cli.ts): enhance fgm flag to include description and default value for better usability
2025-05-30 10:15:00 +03:00
GPT8
c1be5138b6 Merge pull request #477 from jonsguez/fix/one-line-commit
fix(prompts.ts): edited contradictory assistant output
2025-05-30 10:13:35 +03:00
GPT8
063aa94576 Merge pull request #476 from benleibowitz/master
feat(config): add 'describe' mode to config command for detailed parameter info
2025-05-30 10:11:24 +03:00
jonsguez
668e149ae3 fix(prompts.ts): edited contradictory assistant output
When user wants one line commits the system prompt and the user/assistant one-shot example were contradicting each other, confusing the LLM. This fix modifies the assistant output so that prompt and one-shot are consistent.
2025-05-29 23:09:10 -04:00
Ben Leibowitz
b5fca3155f feat(config): add 'describe' mode to config command for detailed parameter info
This commit adds a new 'describe' mode to the config command, allowing users
to get detailed information about configuration parameters. It includes:

1. New CONFIG_MODES.describe enum value
2. Functions to generate and print help messages for config parameters
3. Updated configCommand to handle the new 'describe' mode
4. README updates to document the new 'describe' functionality
2025-05-29 15:46:48 -04:00
GPT8
bc514f8f4d Merge pull request #461 from kaovilai/dep-updates
fix tests
2025-05-29 21:56:45 +03:00
Tiger Kaovilai
3b868ce6df fix: enable git push functionality in e2e tests
- Added OCO_GITPUSH='true' environment variable to all e2e test commands
- Fixed ESM module import issues in commitlint tests by using process.cwd()
- Replaced import.meta.url usage with relative paths from project root
- All e2e tests now properly test the git push prompt functionality
2025-05-29 12:05:28 -05:00
Tiger Kaovilai
aad62d4fa1 fix: remove duplicate modulePathIgnorePatterns in Jest config
- Fixed Jest configuration error by removing duplicate modulePathIgnorePatterns property
- Consolidated the ignore patterns into a single declaration
- This resolves the TypeScript compilation error preventing tests from running
2025-05-29 12:05:13 -05:00
GPT8
21e92164e7 Merge branch 'master' into dep-updates 2025-05-29 12:37:48 +03:00
kakakakakku
f0381c8b12 feat(cli.ts): enhance fgm flag to include description and default value for better usability 2025-05-19 09:04:31 +09:00
GPT8
f6de2dc775 Merge pull request #467 from EmilienMottet/master
Add OCO_API_CUSTOM_HEADERS
2025-05-03 12:06:21 +03:00
EmilienMottet
6aae1c7bd7 ♻️(engine): extract custom header parsing and update OpenAiEngine
- export parseCustomHeaders from src/utils/engine.ts
- use parseCustomHeaders in OpenAiEngine for config.customHeaders
- remove try/catch and inline JSON.parse logic
- update config test to expect headers as object and drop JSON.parse

Centralize header parsing for reuse and simplify engine code
Update tests to match new header format for clarity
2025-04-30 21:43:44 +02:00
EmilienMottet
71a44fac28 ♻️ refactor OpenAI client options and unify custom headers parsing
Use OpenAI.ClientOptions for stronger typing and clarity
Extract custom headers parsing into parseCustomHeaders util
Simplify getEngine by delegating header parsing to helper
Improve maintainability and reduce code duplication
2025-04-30 14:46:54 +02:00
EmilienMottet
6c48c935e2 add custom HTTP headers support via OCO_API_CUSTOM_HEADERS
Add OCO_API_CUSTOM_HEADERS variable to README, config enum,
and env parsing to allow JSON string of custom headers.
Validate that custom headers are valid JSON in config validator.
Extend AiEngineConfig with customHeaders and pass headers to
OllamaEngine and OpenAiEngine clients when creating requests.
Parse custom headers in utils/engine and warn on invalid format.
Add unit tests to ensure OCO_API_CUSTOM_HEADERS is handled
correctly and merged from env over global config.

This enables users to send additional headers such as
Authorization or tracing headers with LLM API calls.
2025-04-29 20:51:24 +02:00
GPT8
25c6a0d5d4 Merge pull request #462 from jcppkkk/master
refactor(commitlint): update commitlint configuration and prompts
2025-04-25 16:21:42 +03:00
GPT8
b277bf3d50 Merge pull request #465 from jcppkkk/fix-tests
Fix tests
2025-04-25 16:19:59 +03:00
Jethro Yu
83b6e0bbaf fix(removeContentTags): keep newlines to preserve formatting
The space normalization logic is updated to replace only multiple spaces
and tabs with a single space, while preserving newlines. This change
ensures that the formatting of the content is maintained, especially
when dealing with empty line requirements and max line length.
2025-04-25 18:44:06 +08:00
Jethro Yu
2726e51c2a fix(test): Stabilize Jest ESM configuration for CI
Resolves persistent `ReferenceError: exports is not defined` errors
encountered during unit tests (`unit-test (20.x)` job) in the GitHub
Actions CI environment. These errors occurred specifically when
importing `cli-testing-library` in the global Jest setup file
(`test/jest-setup.ts`), despite tests passing locally with the same
Node.js version (v20.19.0).

After iterative testing, the following Jest configuration combination
was identified as necessary to ensure consistent ESM handling and test
success in both local and CI environments:

- Set preset to `ts-jest/presets/default-esm` for stricter ESM rules.

- Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`.

- Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`.

- Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies.

- Retained `moduleNameMapper` for `.js` imports for reliable module resolution.

- Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`).

- Removed test cache clearing from the `test:unit` script in `package.json`.

This configuration now passes reliably across environments.
2025-04-25 18:44:05 +08:00
Jethro Yu
da2742edb1 chore(package.json): add rimraf as a development dependency for improved file management
Including rimraf in the project allows for easier and more efficient
removal of files and directories, enhancing the development workflow,
especially for tasks like cleaning up build artifacts.
2025-04-25 18:44:05 +08:00
Jethro Yu
0ebff3b974 fix(removeContentTags): keep newlines to preserve formatting
The space normalization logic is updated to replace only multiple spaces
and tabs with a single space, while preserving newlines. This change
ensures that the formatting of the content is maintained, especially
when dealing with empty line requirements and max line length.
2025-04-25 18:40:50 +08:00
Jethro Yu
a52589e9fe fix(test): Stabilize Jest ESM configuration for CI
Resolves persistent `ReferenceError: exports is not defined` errors
encountered during unit tests (`unit-test (20.x)` job) in the GitHub
Actions CI environment. These errors occurred specifically when
importing `cli-testing-library` in the global Jest setup file
(`test/jest-setup.ts`), despite tests passing locally with the same
Node.js version (v20.19.0).

After iterative testing, the following Jest configuration combination
was identified as necessary to ensure consistent ESM handling and test
success in both local and CI environments:

- Set preset to `ts-jest/presets/default-esm` for stricter ESM rules.

- Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`.

- Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`.

- Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies.

- Retained `moduleNameMapper` for `.js` imports for reliable module resolution.

- Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`).

- Removed test cache clearing from the `test:unit` script in `package.json`.

This configuration now passes reliably across environments.
2025-04-15 15:58:53 +08:00
Jethro Yu
5381c5e18b chore(package.json): add rimraf as a development dependency for improved file management
Including rimraf in the project allows for easier and more efficient
removal of files and directories, enhancing the development workflow,
especially for tasks like cleaning up build artifacts.
2025-04-15 14:54:06 +08:00
Jethro Yu
9ffcdbdb3b refactor(commitlint): update commitlint configuration and prompts for improved clarity and consistency
The commitlint configuration and prompts have been refactored to enhance
clarity and maintain consistency throughout the codebase. The type
assertion for commitLintConfig is updated to use 'as any' for better
type handling. Additionally, formatting adjustments are made in the
prompts to ensure proper readability and alignment with the defined
conventions. These changes aim to streamline the commit message
generation process and improve overall code maintainability.
2025-04-15 14:00:09 +08:00
Tiger Kaovilai
6bc1d90469 npm run test:unit passing locally
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2025-04-14 05:06:45 -04:00
Tiger Kaovilai
5fb3d75412 fix tests
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2025-04-14 04:57:53 -04:00
GPT8
b3700ae685 Merge pull request #458 from kaovilai/thiknagain
Extends #445 to other providers which many provides deepseek
2025-04-14 11:19:20 +03:00
GPT8
1d81229931 Merge pull request #459 from kaovilai/imp1
chore: update GitHub Actions workflows to use latest action versions and improve configurations
2025-04-14 11:18:29 +03:00
GPT8
22f96b34a5 Merge pull request #460 from Heyian/fix/punycode
Fix the punycode deprecated message from the source (survives building from eslint.config.ts).
2025-04-14 11:17:23 +03:00
Marc-Antoine Favreau
beecedf6f3 chore(deps): update eslint and typescript-eslint dependencies
feat(package.json): add overrides for ajv and whatwg-url packages
fix(deepseek.ts): correct import path for OpenAiEngine and OpenAiConfig
2025-04-12 11:36:12 -04:00
Tiger Kaovilai
566a9b1a52 reuse function
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2025-04-12 04:51:11 -04:00
Tiger Kaovilai
aecc832529 chore: update GitHub Actions workflows to use latest action versions and improve configurations
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2025-04-12 04:33:35 -04:00
GPT8
9418f67636 Merge pull request #457 from jcppkkk/feat/commitlint-improve-consistency-handling
refactor(prompts): streamline commit message generation logic
2025-04-12 10:40:30 +03:00
Tiger Kaovilai
f5c6c313fc Extends #445 to other providers which many provides deepseek 2025-04-11 12:50:16 -04:00
Jethro Yu
fb533f838d refactor(prompts): streamline commit message generation logic
This update introduces a new structure for generating commit messages by defining a constant for commit types and consolidating the logic into a single function. The changes enhance readability and maintainability while ensuring consistent formatting based on the OCO_OMIT_SCOPE configuration.
2025-04-10 16:16:26 +08:00
GPT8
60a7650e1c Merge pull request #456 from kvokka/fix-config-default-settings 2025-04-08 11:19:53 +03:00
Mikhail Beliakov
beb623cdcd fix: config default settings 2025-03-28 19:17:02 +00:00
GPT8
cd5198a96f Merge pull request #454 from jcppkkk/master
feat(commitlint): add additional search path for @commitlint
2025-03-17 11:40:01 +03:00
Jethro Yu
44bd14d2c5 feat(commitlint): add additional search path for @commitlint
This change allows opencommit to locate commitlint installed globally
(with opencommit), which is useful for project that does not use node.js
environment or dose not have opencommit and @commitlint installed locally.
2025-03-17 11:42:54 +08:00
di-sukharev
7feb3ec00e build 2025-03-11 11:37:11 +03:00
di-sukharev
ff896fc225 3.2.7 v3.2.7 2025-03-11 11:37:10 +03:00
di-sukharev
6485b8381b 3.2.6 2025-03-11 11:36:57 +03:00
GPT8
7945f44259 Merge pull request #453 from bbauti/omit-scope-feature
feat(config): Add OCO_OMIT_SCOPE option to control scope inclusion in commit messages
2025-03-11 11:30:43 +03:00
di-sukharev
44a35da245 3.2.6 2025-03-11 11:30:21 +03:00
Bautista Igarzabal
f8ce0d32d5 feat(scope): add OMIT_SCOPE config option 2025-03-09 00:41:30 -03:00
Satoru Hoshino
b55bcd5c0b feat(engine): add DeepSeekEngine (#446)
Add DeepSeekEngine to support DeepSeek API.  This
includes a new DeepSeekConfig interface and updates to
the engine selection logic.

feat(README.md, src/commands/config.ts): Add DeepSeek support

Adds support for the DeepSeek AI provider.  Updates the README,
config validation, and model list to include DeepSeek.  This
allows users to utilize DeepSeek models with the OpenCommit
tool.

fix(deepseek.ts): update DeepSeek API base URL to include version number v1

refactor(deepseek.ts): improve DeepSeekEngine constructor

The DeepSeekEngine constructor is refactored to use the
spread syntax for better readability and maintainability
when merging config parameters.  The baseURL is now
explicitly set within the constructor.

fix(README.md): remove Groq from the list of supported AI providers

refactor(deepseek.ts): rename interface DeepseekConfig to DeepSeekEngineeekConfig and fix typo

Revert "refactor(deepseek.ts): rename interface DeepseekConfig to DeepSeekEngineeekConfig and fix typo"

This reverts commit f492367d3885fa97cd685feca889f93d6c465b2f.

refactor(deepseek.ts): Rename DeepseekConfig to DeepSeekConfig for consistency

 feat(engine): add DeepSeekEngine to support DeepSeek API

♻️ refactor(engine): improve OpenAiEngine and create a
    new DeepSeekEngine class to handle DeepSeek API
    requests.  The DeepSeekEngine class inherits from
    OpenAiEngine and overrides the
    generateCommitMessage method to use the DeepSeek
    API.  This change improves code organization and
    maintainability.

🐛 Fix: Correct DeepSeekEngine import and class name

The import path and class name for DeepSeekEngine were
incorrect, causing a runtime error. This commit corrects
the import path and class name to `DeepseekEngine` to
resolve the issue.

Revert "🐛 Fix: Correct DeepSeekEngine import and class name"

This reverts commit 738fd36c434d9df9c3a458b1e8230c974bd2a76e.

🐛 Fix: Correct DeepSeekEngine import and class name

The import path and class name for DeepSeekEngine were corrected to match the actual file and class name.  This fixes a runtime error.

Restore ./out directory to master state
2025-02-10 13:21:39 +03:00