Editor Integration
GenSense does not yet ship a dedicated editor extension. The following patterns integrate it into existing development workflows using tools that are already available.
VS Code
Option 1: Task Runner
Add a task to .vscode/tasks.json. This lets you invoke GenSense on demand from the Command Palette or Ctrl+Shift+B.
Create or update .vscode/tasks.json in your project root:
{
"version": "2.0.0",
"tasks": [
{
"label": "GenSense: Audit Project",
"type": "shell",
"command": "npx @friehub/gensense audit ${workspaceFolder}",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared",
"clear": true
},
"problemMatcher": []
},
{
"label": "GenSense: Audit Current File",
"type": "shell",
"command": "npx @friehub/gensense audit ${file}",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared",
"clear": true
},
"problemMatcher": []
}
]
}Run via: Terminal > Run Task or Ctrl+Shift+B.
Option 2: On-Save Integration
Install the Run on Save VS Code extension, then add this to your settings.json:
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.(rs|ts|js|sol)$",
"cmd": "npx @friehub/gensense audit ${file}",
"isAsync": true
}
]
}
}This runs a file-level audit every time you save a supported file. Output appears in the Run on Save output channel.
Option 3: Workspace Recommended Extensions
To ensure all contributors on a project can quickly set up editor integration, add a .vscode/extensions.json file:
{
"recommendations": [
"emeraldwalk.RunOnSave"
]
}This will prompt new contributors to install the recommended extension when they open the workspace.
Pre-Commit Hook
Integrate GenSense into the git commit lifecycle so no findings reach the repository.
Using Husky (Node.js projects)
npm install --save-dev husky
npx husky init
echo "npx @friehub/gensense audit . --tag security" > .husky/pre-commitUsing a Shell Script (any project)
Create .git/hooks/pre-commit:
#!/bin/sh
echo "Running GenSense audit..."
npx @friehub/gensense audit . --tag security
if [ $? -ne 0 ]; then
echo "GenSense found issues. Commit blocked."
exit 1
fiMake it executable:
chmod +x .git/hooks/pre-commitCI / GitHub Actions
Add GenSense as a quality gate in your CI pipeline. The process exits with code 1 if any findings are produced.
Audit on Pull Request
name: Code Quality
on:
pull_request:
branches: [main]
jobs:
gensense:
name: Semantic Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install GenSense
run: npm install -g @friehub/gensense
- name: Run Audit
run: gensense audit . --tag security --tag reliabilityFail Only on Critical Findings
If you want to block CI only on Critical severity findings, you can pipe output and filter:
gensense audit . | grep -q "Critical" && exit 1 || exit 0JetBrains IDEs (RustRover, WebStorm)
Use the built-in External Tools feature:
- Go to Settings > Tools > External Tools.
- Click + to add a new tool.
- Configure:
- Name: GenSense Audit
- Program:
npx - Arguments:
@friehub/gensense audit $FilePath$ - Working Directory:
$ProjectFileDir$
- Optionally bind it to a keyboard shortcut via Keymap.