Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ Versions follow [Semantic Versioning](https://semver.org/).

---

## v3.3.0 — 2026-05-16

**npm package + CLI quickstart.**

- Published to npm as `code-warden` — install with `npx code-warden init`
- Added `bin/code-warden.js` — CLI wrapper dispatching to existing tools: `init`, `report`, `doctor`, `list`, `hooks`, `uninstall-hooks`
- Added `"bin"` field to `package.json` for global/npx invocation
- Added `"files"` field to control tarball contents (41 files, 39 kB, zero runtime deps)
- Added `"engines": { "node": ">=18" }`
- Added `"keywords"`, `"repository"`, `"homepage"`, `"bugs"` metadata
- Updated README with `npx code-warden init` as primary install path and CLI command table

---

## v3.2.0 — 2026-05-16

**Governance Evidence Artifact.**
Expand Down
45 changes: 19 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://github.com/Kodaxadev/Code-Warden/actions/workflows/code-warden.yml">
<img src="https://github.com/Kodaxadev/Code-Warden/actions/workflows/code-warden.yml/badge.svg" alt="Code-Warden Quality Gate" />
</a>
<img src="https://img.shields.io/badge/version-3.2.0-blue" alt="Version 3.2.0" />
<img src="https://img.shields.io/badge/version-3.3.0-blue" alt="Version 3.3.0" />
<img src="https://img.shields.io/badge/license-MIT-yellow" alt="MIT License" />
<img src="https://img.shields.io/badge/Claude%20Hooks-PreToolUse-purple" alt="Claude Code PreToolUse Hooks" />
<img src="https://img.shields.io/badge/AI%20Governance-enforced-red" alt="AI Governance Enforced" />
Expand Down Expand Up @@ -121,38 +121,31 @@ Start where you have the most immediate pain.
## Install

```bash
git clone https://github.com/Kodaxadev/Code-Warden.git
cd Code-Warden/code-warden
node install.js
npx code-warden init
```

The auto-installer scans for installed AI apps and deploys to all of them in one step.
Supports Claude Code, Cursor, Warp, OpenAI Codex, Windsurf, and generic agent runtimes.

### Common commands
Or install globally:

```bash
node install.js --all # install without prompt
node install.js --dry-run # preview, write nothing
node install.js --list # show detected apps
node install.js --doctor # verify source + install health
node install.js --verify-target=claude # strict per-target check, exits nonzero on failure
node install.js --hooks=claude # install Claude Code PreToolUse hooks
node install.js --uninstall-hooks=claude # remove Claude Code hooks
node install.js --hooks=codex # install Codex PreToolUse hooks (partial)
node install.js --uninstall-hooks=codex # remove Codex hooks
npm install -g code-warden
code-warden init
```

### npm scripts
The installer scans for AI runtimes and deploys to all of them in one step.
Supports Claude Code, Cursor, Warp, OpenAI Codex, Windsurf, and generic agent runtimes.

### CLI commands

```bash
npm run lint # scan full project tree for oversized files
npm run check-secrets # scan full project tree for hardcoded credentials
npm run report # governance report — writes .code-warden-report.json
npm run report:md # governance report as Markdown (pipe to PR summary)
npm run ci # lint + secrets + test + doctor
npm run install-auto # node install.js
npm run install-doctor # node install.js --doctor
code-warden init # install to detected AI runtimes
code-warden report # generate governance report
code-warden report --format=md # Markdown output (pipe to PR summary)
code-warden doctor # verify source + install health
code-warden list # show detected runtimes
code-warden hooks claude # install Claude Code PreToolUse hooks
code-warden hooks codex # install Codex PreToolUse hooks (partial)
code-warden uninstall-hooks claude
code-warden uninstall-hooks codex
```

## Invoke
Expand Down Expand Up @@ -256,7 +249,7 @@ Full template: [`code-warden/templates/ci/github-actions.yml`](code-warden/templ

## Version

v3.2.0 — See [`CHANGELOG.md`](CHANGELOG.md) for full changelog.
v3.3.0 — See [`CHANGELOG.md`](CHANGELOG.md) for full changelog.

## Author

Expand Down
27 changes: 23 additions & 4 deletions code-warden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,31 @@ See [`templates/ci/github-actions.yml`](templates/ci/github-actions.yml) for the
## Install

```bash
git clone https://github.com/Kodaxadev/Code-Warden.git
cd Code-Warden/code-warden
node install.js
npx code-warden init
```

### Installer commands
Or install globally:

```bash
npm install -g code-warden
code-warden init
```

### CLI commands

| Command | Purpose |
|---------|---------|
| `code-warden init` | Install to all detected AI runtimes |
| `code-warden report` | Generate governance report |
| `code-warden report --format=md` | Markdown output for PR summaries |
| `code-warden doctor` | Verify source integrity + install health |
| `code-warden list` | Show detected runtimes |
| `code-warden hooks claude` | Install Claude Code PreToolUse hooks |
| `code-warden hooks codex` | Install Codex PreToolUse hooks (partial) |
| `code-warden uninstall-hooks claude` | Remove Claude Code hooks |
| `code-warden uninstall-hooks codex` | Remove Codex hooks |

### Direct installer commands

| Command | Purpose |
|---------|---------|
Expand Down
82 changes: 82 additions & 0 deletions code-warden/bin/code-warden.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env node
'use strict';

const { spawnSync } = require('child_process');
const path = require('path');

const ROOT = path.join(__dirname, '..');

const COMMANDS = {
init: { desc: 'Install Code-Warden to detected AI runtimes', run: ['install.js', '--all'] },
doctor: { desc: 'Verify source integrity and install health', run: ['install.js', '--doctor'] },
report: { desc: 'Generate governance report (.code-warden-report.json)', run: ['tools/governance-report.js', '.'] },
list: { desc: 'Show detected AI runtimes', run: ['install.js', '--list'] },
};

const HOOK_TARGETS = ['claude', 'codex'];

function usage() {
console.log('Usage: code-warden <command> [options]\n');
console.log('Commands:');
for (const [name, { desc }] of Object.entries(COMMANDS)) {
console.log(` ${name.padEnd(22)} ${desc}`);
}
console.log(` ${'hooks <target>'.padEnd(22)} Install PreToolUse hooks (${HOOK_TARGETS.join(', ')})`);
console.log(` ${'uninstall-hooks <target>'.padEnd(22)} Remove PreToolUse hooks`);
console.log(`\nExamples:`);
console.log(` npx code-warden init`);
console.log(` npx code-warden report`);
console.log(` npx code-warden report --format=md`);
console.log(` npx code-warden hooks claude`);
}

function run(scriptPath, args) {
const result = spawnSync(process.execPath, [path.join(ROOT, scriptPath), ...args], {
stdio: 'inherit',
cwd: process.cwd(),
});
process.exit(result.status ?? 1);
}

const args = process.argv.slice(2);
const command = args[0];
const rest = args.slice(1);

if (!command || command === '--help' || command === '-h') {
usage();
process.exit(0);
}

if (command === '--version' || command === '-v') {
const pkg = require(path.join(ROOT, 'package.json'));
console.log(pkg.version);
process.exit(0);
}

if (COMMANDS[command]) {
const entry = COMMANDS[command];
const scriptArgs = [...entry.run.slice(1), ...rest];
run(entry.run[0], scriptArgs);
}

if (command === 'hooks') {
const target = rest[0];
if (!target || !HOOK_TARGETS.includes(target)) {
console.error(`Usage: code-warden hooks <${HOOK_TARGETS.join('|')}>`);
process.exit(1);
}
run('install.js', [`--hooks=${target}`]);
}

if (command === 'uninstall-hooks') {
const target = rest[0];
if (!target || !HOOK_TARGETS.includes(target)) {
console.error(`Usage: code-warden uninstall-hooks <${HOOK_TARGETS.join('|')}>`);
process.exit(1);
}
run('install.js', [`--uninstall-hooks=${target}`]);
}

console.error(`Unknown command: ${command}\n`);
usage();
process.exit(1);
42 changes: 41 additions & 1 deletion code-warden/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
{
"name": "code-warden",
"version": "3.2.0",
"version": "3.3.0",
"description": "Verifiable governance for AI-assisted development — checks, hooks, and evidence.",
"main": "SKILL.md",
"bin": {
"code-warden": "bin/code-warden.js"
},
"files": [
"bin/",
"tools/",
"references/",
"templates/",
"examples/",
"SKILL.md",
"CONFIGURE.md",
"DECISIONS.md",
"README.md",
"codewarden.json",
"install.js",
"install.ps1",
"install.sh"
],
"scripts": {
"lint": "node tools/warden-lint.js .",
"check-secrets": "node tools/verify-secrets.js .",
Expand All @@ -17,6 +35,28 @@
"test": "node tools/tests/run-tests.js",
"ci": "npm run lint && npm run check-secrets && npm run test && node install.js --doctor"
},
"engines": {
"node": ">=18"
},
"keywords": [
"ai",
"governance",
"claude",
"codex",
"cursor",
"windsurf",
"code-review",
"linter",
"secrets",
"ci",
"hooks"
],
"repository": {
"type": "git",
"url": "https://github.com/Kodaxadev/Code-Warden.git"
},
"homepage": "https://github.com/Kodaxadev/Code-Warden",
"bugs": "https://github.com/Kodaxadev/Code-Warden/issues",
"author": "Justin Davis",
"license": "MIT"
}
Loading