Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@denyhs/cortex-cli
Advanced tools
CLI tool to generate commit messages based on repository changes
A command-line tool to generate commit messages based on your repository changes.
npm install -g @denyhs/cortex-cli
Before using the CLI, you need to set your API token as an environment variable:
export CORTEX_GENERATE_COMMIT_MESSAGE_TOKEN=your_token_here
Or create a .env
file in your project root:
CORTEX_GENERATE_COMMIT_MESSAGE_TOKEN=your_token_here
You can also create a .cortexrc
file in your project root to set default options:
{
"stageChanges": true,
"include": ["src/**/*.js", "lib/**/*.js"],
"exclude": ["test/**", "**/*.test.js"],
"header": "feat: ",
"commitStaged": true
}
To make your IDE treat .cortexrc
as a JSON file:
VS Code
The repository includes .vscode/settings.json
with the correct configuration:
{
"files.associations": {
".cortexrc": "json"
}
}
JetBrains IDEs (WebStorm, IntelliJ, etc.)
The repository includes .idea/fileTypes/cortexrc.xml
with the correct configuration. If you're not using the provided configuration:
cortexrc
pattern under "File name patterns"Vim/Neovim Add to your configuration:
autocmd BufNewFile,BufRead .cortexrc setfiletype json
The CLI follows a strict priority order when applying configurations:
.cortexrc
file settings (lower priority)For example, if you have this .cortexrc
:
{
"include": ["src/**/*.js"],
"header": "feat: "
}
And run:
cortex commit-message --include "lib/**/*.js" --header "fix: "
The CLI will use:
include: ["lib/**/*.js"]
(from command line)header: "fix: "
(from command line)The values in .cortexrc
are overridden by the command-line flags.
Here are some common .cortexrc
configurations:
// Basic configuration for a JavaScript project
{
"stageChanges": true,
"include": ["src/**/*.js", "lib/**/*.js"],
"exclude": ["**/*.test.js", "**/*.spec.js"],
"header": "feat: "
}
// TypeScript project with automatic commit
{
"stageChanges": true,
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["**/*.test.ts", "**/__tests__/**"],
"commitStaged": true,
"header": "fix: "
}
// Full-stack project configuration
{
"stageChanges": true,
"include": [
"frontend/src/**/*.{js,jsx,ts,tsx}",
"backend/src/**/*.js",
"shared/**/*.js"
],
"exclude": [
"**/*.test.*",
"**/*.spec.*",
"**/dist/**",
"**/build/**"
],
"commitAndPush": true
}
// Configuration for documentation changes
{
"stageChanges": true,
"include": [
"docs/**/*.md",
"**/*.mdx",
"**/README.md"
],
"header": "docs: ",
"commitStaged": true
}
cortex commit-message [options]
--onlyStaged
: Same as default, generate message for staged changes--onlyUnstaged
: Generate message for unstaged changes--all
: Generate message for all changes (staged and unstaged)--stageChanges
: Stage changes before generating the message--include <patterns...>
: Include only files matching these patterns when staging (supports glob patterns)--exclude <patterns...>
: Exclude files matching these patterns when staging (supports glob patterns)--header <text>
: Add a custom header to the commit message (will be added above the generated message)--commitStaged
: After generating the message, prompt to commit staged changes--commitAndPush
: After generating the message, prompt to commit staged changes and push them to the remote repository--verbose
: Show detailed information about the current configuration and execution# Generate message for staged changes
cortex commit-message
# Generate message for all changes
cortex commit-message --all
# Stage specific files and generate message
cortex commit-message --stageChanges --include "src/**/*.js" --exclude "**/*.test.js"
# Stage changes in specific directories
cortex commit-message --stageChanges --include "src/**" "lib/**" --exclude "test/**"
# Stage changes with patterns and commit
cortex commit-message --stageChanges --include "src/**/*.js" --header="feat: new feature" --commitStaged
# Stage filtered changes, generate message, and commit and push
cortex commit-message --stageChanges --include "src/**" --exclude "test/**" --commitAndPush
# Generate message with a custom header
cortex commit-message --header="feat: new feature implementation"
# Generate message, commit, and push with a custom header
cortex commit-message --commitAndPush --header="fix: resolve critical bug"
.cortexrc
file or command-line optionsFAQs
CLI tool to generate commit messages based on repository changes
The npm package @denyhs/cortex-cli receives a total of 0 weekly downloads. As such, @denyhs/cortex-cli popularity was classified as not popular.
We found that @denyhs/cortex-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.