codeslick-cli 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -8
- package/bin/codeslick.cjs +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,22 @@ Catch security vulnerabilities before they enter your codebase with automated pr
|
|
|
15
15
|
- **CI/CD Ready** - JSON output mode for automation
|
|
16
16
|
- **OWASP Top 10:2025 Compliant** - 268 comprehensive security checks
|
|
17
17
|
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
**Git is required** - CodeSlick CLI works with any git repository (local or remote):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Initialize git in your project (if not already done)
|
|
24
|
+
git init
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Note**: You do NOT need GitHub, GitLab, or any remote hosting. CodeSlick works with local git repositories, GitHub repositories, GitLab, Bitbucket, or any git-based workflow.
|
|
28
|
+
|
|
29
|
+
**System Requirements**:
|
|
30
|
+
- Node.js 18.0.0 or higher
|
|
31
|
+
- Git (any version)
|
|
32
|
+
- macOS, Linux, or Windows
|
|
33
|
+
|
|
18
34
|
## Installation
|
|
19
35
|
|
|
20
36
|
### Option 1: Use `npx` (Recommended - No Installation Required)
|
|
@@ -60,10 +76,18 @@ npx codeslick-cli init
|
|
|
60
76
|
|
|
61
77
|
## Quick Start
|
|
62
78
|
|
|
63
|
-
### 1.
|
|
79
|
+
### 1. Make Sure You Have Git Initialized
|
|
64
80
|
|
|
65
81
|
```bash
|
|
66
82
|
cd your-project/
|
|
83
|
+
|
|
84
|
+
# If not already a git repository, initialize it first:
|
|
85
|
+
git init
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2. Initialize CodeSlick in Your Repository
|
|
89
|
+
|
|
90
|
+
```bash
|
|
67
91
|
npx codeslick-cli init
|
|
68
92
|
# or if you installed globally:
|
|
69
93
|
codeslick init # or: cs init
|
|
@@ -71,18 +95,18 @@ codeslick init # or: cs init
|
|
|
71
95
|
|
|
72
96
|
This will:
|
|
73
97
|
- Create `.codeslick.json` configuration file
|
|
74
|
-
- Install pre-commit hook
|
|
98
|
+
- Install pre-commit hook in `.git/hooks/`
|
|
75
99
|
- Configure automatic scanning
|
|
76
100
|
|
|
77
|
-
###
|
|
101
|
+
### 3. Configure Severity Threshold (Optional)
|
|
78
102
|
|
|
79
103
|
```bash
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
104
|
+
npx codeslick-cli config set severity critical # Block only CRITICAL issues
|
|
105
|
+
npx codeslick-cli config set severity high # Block HIGH+ issues (recommended)
|
|
106
|
+
npx codeslick-cli config set severity medium # Block MEDIUM+ issues (default)
|
|
83
107
|
```
|
|
84
108
|
|
|
85
|
-
###
|
|
109
|
+
### 4. Commit as Usual
|
|
86
110
|
|
|
87
111
|
```bash
|
|
88
112
|
git add .
|
|
@@ -350,12 +374,22 @@ codeslick init --force # Re-install hook
|
|
|
350
374
|
|
|
351
375
|
**Problem**: Running `codeslick init` in a non-git directory.
|
|
352
376
|
|
|
377
|
+
**Why this happens**: CodeSlick CLI requires git to:
|
|
378
|
+
- Install pre-commit hooks in `.git/hooks/` directory
|
|
379
|
+
- Track staged files for scanning
|
|
380
|
+
- Work with your existing git workflow
|
|
381
|
+
|
|
353
382
|
**Solution**: Initialize git first:
|
|
354
383
|
```bash
|
|
384
|
+
# Initialize git in your project
|
|
355
385
|
git init
|
|
356
|
-
|
|
386
|
+
|
|
387
|
+
# Now run CodeSlick init
|
|
388
|
+
npx codeslick-cli init
|
|
357
389
|
```
|
|
358
390
|
|
|
391
|
+
**Note**: You do NOT need GitHub or any remote repository. CodeSlick works with local git repositories.
|
|
392
|
+
|
|
359
393
|
### "No staged files found" error
|
|
360
394
|
|
|
361
395
|
**Problem**: Running `codeslick scan --staged` with no staged files.
|
package/bin/codeslick.cjs
CHANGED
|
@@ -25,6 +25,7 @@ const { scanCommand } = require('../dist/packages/cli/src/commands/scan');
|
|
|
25
25
|
const { initCommand } = require('../dist/packages/cli/src/commands/init');
|
|
26
26
|
const { configCommand } = require('../dist/packages/cli/src/commands/config');
|
|
27
27
|
const { loginCommand, logoutCommand, whoamiCommand } = require('../dist/packages/cli/src/commands/auth');
|
|
28
|
+
const { version } = require('../package.json');
|
|
28
29
|
|
|
29
30
|
// Detect if running as 'cs' or 'codeslick'
|
|
30
31
|
const scriptName = process.argv[1].includes('/cs') ? 'cs' : 'codeslick';
|
|
@@ -146,7 +147,7 @@ yargs(hideBin(process.argv))
|
|
|
146
147
|
.demandCommand(1, 'You must provide a command')
|
|
147
148
|
.help()
|
|
148
149
|
.alias('help', 'h')
|
|
149
|
-
.version(
|
|
150
|
+
.version(version)
|
|
150
151
|
.alias('version', 'v')
|
|
151
152
|
.epilog('For more information, visit https://codeslick.dev/docs/cli')
|
|
152
153
|
.strict()
|