-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: new CLI commands documentation (#413)
* Mise à jour de la documentation des commandes CLI * Apporte les modifications demandées * Apporte les modifications demandées * Ajout de .DS_Store au .gitignore et suppression du suivi * docs: add missing GitHub blockquotes * docs: add SLSA & publishing docs along with minor enhancements * Add detailed Markdown documentation for CLI commands (hydrate-db, lang, open, report, scorecard, summary, verify) * remove prefix 'commande' from CLI documentation link. * Remove .DS_Store files from repository * docs: harmonize available options across commands - Updated auto.md to include missing common options (--silent, --output) - Ensured consistency in the documentation of options across from, cwd, and auto commands - Centralized common options for easier maintenance and readability * docs: remove outdated sections from README.md - Removed the port configuration example from the CLI options table - Removed outdated IMPORTANT note about the auto command in README.md * Standardize documentation formatting: - Updated `scorecard` command description to include NPM packages and clarify use of OpenSSF scorecard. - Removed unnecessary spaces in documentation. - Standardized the presentation of options in the `auto` command documentation to match other commands. * file standardization * Addressed review comments - multiple fixes applied * Update docs/cli/open.md --------- Co-authored-by: fraxken <gentilhomme.thomas@gmail.com>
- Loading branch information
Showing
12 changed files
with
185 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,7 @@ vuln.json | |
tmp/ | ||
dist/ | ||
reports | ||
|
||
# macOS system files | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 🚀 Command `auto` | ||
|
||
The `auto` command combines the `cwd` and `from` commands to analyze and explore a local project or remote NPM packages in the WebUI. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure auto [spec] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|--| | ||
| `--depth` | `-d` | `4` | Specify the depth of dependency analysis. | | ||
| `--silent` | | | Suppress console output, making execution silent. | | ||
| `--output` | `-o` | `nsecure-result` | Specify the output file for the results. | | ||
| `--keep` | `-k` | `false` | Preserve temporary files after execution. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# ⚙️ Command `config` | ||
|
||
The `config` command allows you to manage the `.nodesecurerc` configuration file, which is used by NodeSecure components to customize their behavior. You can use this command to create a new configuration file or edit the existing one. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure config [sub-command] [options] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
### `create` Sub-command | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--cwd` | `-c` | `false` | Create the configuration file in the current working directory instead of the default location. | | ||
|
||
### `edit` Sub-command | ||
|
||
This sub-command does not have any specific options. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 📂 Command `cwd` | ||
|
||
The `cwd` command scans the project in the current working directory using the `package.json` and `package-lock.json` files, and stores the analysis results in a JSON file. You can then share this JSON or explore it in the WebUI using the `open` command. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure cwd [options] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--nolock` | `-n` | `false` | Do not use a lock file (package-lock.json or yarn.lock) for the analysis. | | ||
| `--full` | `-f` | `false` | Perform a full analysis of the project, including all dependencies. | | ||
| `--depth` | `-d` | `4` | Specify the depth of dependency analysis. | | ||
| `--silent` | | | Suppress console output, making execution silent. | | ||
| `--output` | `-o` | `nsecure-result` | Specify the output file for the results. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 📦 Command `from` | ||
|
||
The `from` command allows you to run a security analysis on a specific npm package, which must be available in the npm registry. This command is useful for evaluating the security of a package before including it in your project. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure from <package> [options] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--depth` | `-d` | `4` | Specify the depth of dependency analysis. | | ||
| `--output` | `-o` | `nsecure-result` | Specify the output file for the results. | | ||
| `--silent` | | | Suppress console output, making execution silent. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## 📝 Command `lang` | ||
|
||
The `lang` command allows you to set your preferred language. Use this command to customize the language used in the CLI or Web interfaces | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure lang | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## 📝 Command `open` | ||
|
||
The `open` command reads a specified JSON payload and starts a local HTTP server. This allows you to explore dependencies, their metrics, and potential threats directly in your web browser. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure open [json] | ||
``` | ||
|
||
> [!NOTE] | ||
> If the `[json]` property is omitted, the command will default to searching for a `nsecure-result.json` file in the current working directory. | ||
>[!NOTE] | ||
> If the `[json]` property is omitted, the command will default to searching for a `nsecure-result.json` file in the current working directory. | ||
> | ||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--port` | `-p` | `process.env.PORT` | Specify the port on which the HTTP server should run. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## 📝 Command `report` | ||
|
||
The `report` command generates a detailed security report for a repository in PDF format. The report can include all dependencies and can be customized with various options. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure report [repository] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--theme` | `-t` | `white` | Specify the theme for the report. | | ||
| `--includesAllDeps` | `-i` | `true` | Include all dependencies in the report. | | ||
| `--title` | `-l` | `NodeSecure Report` | Specify the title of the report. | | ||
| `--reporters` | `-r` | `["html"]` | Specify the format of the report (e.g., HTML, JSON). | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## 📝 Command `scorecard` | ||
|
||
The `scorecard` command is used to generate an OpenSSF scorecard for a specific GIT repository or NPM package. This command evaluates the repository and provides a security score based on various criteria. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure scorecard [repository] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--vcs` | | `github` | Specify the version control system (VCS) used by the repository. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## 📝 Command `summary` | ||
|
||
The `summary` command is used to generate a summarized report from a JSON security report. This command provides a concise overview of the security findings. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure summary [json] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## 📝 Command `verify` | ||
|
||
The `verify` command performs a deep analysis of a specified NPM package. It provides advanced information about the files in the tarball, including details on potential threats, file integrity, and more. | ||
|
||
## 📜 Syntax | ||
|
||
```bash | ||
nsecure verify [package] | ||
``` | ||
|
||
## ⚙️ Available Options | ||
|
||
| Name | Shortcut | Default Value | Description | | ||
|---|---|---|---| | ||
| `--json` | `-j` | `false` | Output the results in JSON format. | |