color - Colorize C# Code by Concern
The color command generates syntax-highlighted HTML output that colorizes C# source lines according to their code concern category. Two analysis modes are available:
- Cross-cutting concerns (default) — classifies lines by concern type such as logging, caching, or security using rule-based classification.
- Structural/Syntactic (
--structural) — classifies lines by syntactic role such as methods, properties, and fields.
The command operates in two modes based on the input path:
- Single-file mode — input is a
.csfile; output defaults to<input>.htmlnext to the source file. - Multi-file mode — input is a
.csproj,.slnx, or directory; an output directory must be supplied.
nmbl color <InputFile.cs> [OutputFile.html] [--no-summary] [--structural]
nmbl color <Project.csproj|Solution.slnx|Directory> <OutputDirectory> [--no-summary] [--structural]
InputPath- Required. A.csfile (single-file mode) or a.csproj,.slnx, or directory (multi-file mode).OutputPath- Output HTML file (single-file mode) or output directory (multi-file mode). Required in multi-file mode; defaults to<InputPath>.htmlin single-file mode.
--no-summary- Suppress the per-run concern summary printed after generation.--structural- Use structural/syntactic analysis instead of cross-cutting concern classification.
Writes one HTML file. After generation, prints the output path and (unless --no-summary is set) a summary of the top 5 concern categories by line count.
Writes one HTML file per discovered C# source file into the output directory, using the original filename with .html appended (e.g., MyService.cs becomes MyService.cs.html). After generation, prints a count of successfully processed files and the output directory path.
0- Success (including when no C# files are found).1- Missing required arguments, unsupported input type, or an error during analysis.
nmbl color src/Services/OrderService.cs
Creates src/Services/OrderService.cs.html next to the source file.
nmbl color src/Services/OrderService.cs output/OrderService.html
Writes the HTML to the specified path.
nmbl color src/Services/OrderService.cs --no-summary
Generates the HTML but skips printing the concern breakdown.
nmbl color src/Services/OrderService.cs --structural
Colors lines by syntactic role (methods, properties, fields, etc.) instead of cross-cutting concerns.
nmbl color MyProject.csproj ./output
Generates one HTML file per .cs file discovered in the project, written to ./output/.
nmbl color MySolution.slnx ./colorized
Discovers all C# files across all projects in the solution and writes HTML files to ./colorized/.
nmbl color src/ ./colorized --no-summary
Processes all C# files found under src/ and suppresses the summary.
nmbl color MyProject.csproj ./output --structural
Uses structural analysis for all files in the project.
The default mode classifies each line by its concern type using a rule engine. Examples of concern categories include logging, caching, security, data access, and exception handling. Lines not matching any concern rule are left uncolored.
Classifies lines by their syntactic role within the C# code structure. Examples include methods, properties, fields, constructors, and type declarations.