CLI Commands
Unentropy provides a command-line interface for local development and testing. Use these commands to initialize configuration, validate setup, and preview reports before pushing to CI.
Generate configuration file with sensible defaults for your project type.
Behavior
Section titled “Behavior”- Detects project type from marker files
- Creates
unentropy.jsonwith appropriate metrics - Displays GitHub Actions workflow examples
- Suggests next steps
Options
Section titled “Options”--type, -t
Section titled “--type, -t”Force specific project type.
Values: javascript, php, go, python
Use this when:
- Auto-detection picks the wrong type
- You have a multi-language project
- Marker files are in subdirectories
--storage, -s
Section titled “--storage, -s”Select storage backend.
Values: artifact (default), s3, local
artifact: GitHub Actions artifacts (90-day retention)s3: S3-compatible storage (unlimited retention)local: Local file (development only)
--force, -f
Section titled “--force, -f”Overwrite existing configuration.
Warning: This replaces your existing unentropy.json. Back up custom changes first.
--dry-run
Section titled “--dry-run”Preview configuration without writing files.
Displays what would be created without modifying anything.
Project Type Detection
Section titled “Project Type Detection”Unentropy detects your project type from these files:
| Type | Detection Files |
|---|---|
| JavaScript | package.json, tsconfig.json, bun.lockb, pnpm-lock.yaml, yarn.lock, package-lock.json |
| PHP | composer.json, composer.lock |
| Go | go.mod, go.sum |
| Python | pyproject.toml, setup.py, requirements.txt, Pipfile, setup.cfg |
Priority order when multiple types detected: JavaScript > PHP > Go > Python
Example Output
Section titled “Example Output”Exit Codes
Section titled “Exit Codes”- 0: Success
- 1: Configuration already exists (use
--forceto overwrite) - 1: Project type cannot be detected (use
--typeto specify) - 1: Invalid
--typevalue
Validate configuration and run metric collection locally without persisting data.
Behavior
Section titled “Behavior”- Validates
unentropy.jsonschema - Runs metric collection commands sequentially
- Displays results with values, units, and timing
- Exits with appropriate code based on results
Options
Section titled “Options”--config, -c
Section titled “--config, -c”Specify alternate configuration file.
Default: unentropy.json
--timeout
Section titled “--timeout”Override per-metric timeout in milliseconds.
Default: 30000ms (30 seconds)
Per-metric timeouts in config take precedence when not specified.
Example Output
Section titled “Example Output”Success:
Failure:
Exit Codes
Section titled “Exit Codes”- 0: All metrics collected successfully
- 1: Configuration validation failed
- 2: One or more metrics failed to collect
preview
Section titled “preview”Generate HTML report with empty/placeholder data to preview report structure.
Behavior
Section titled “Behavior”- Validates
unentropy.jsonschema - Generates HTML report with all configured metrics
- Shows metrics with no data (empty state)
- Opens report in default browser
Options
Section titled “Options”--config, -c
Section titled “--config, -c”Specify alternate configuration file.
Default: unentropy.json
--output, -o
Section titled “--output, -o”Specify output directory.
Default: unentropy-preview
Creates directory if it doesn’t exist. Report is written to <output>/index.html.
--no-open
Section titled “--no-open”Don’t open browser automatically.
Report is generated but browser doesn’t launch. Useful in headless/CI environments.
--force, -f
Section titled “--force, -f”Overwrite existing non-empty output directory.
Warning: This deletes existing content in the output directory.
Example Output
Section titled “Example Output”Exit Codes
Section titled “Exit Codes”- 0: Report generated successfully
- 1: Configuration validation failed
- 1: Output directory exists and is not empty (use
--force) - 1: Report generation failed
- 1: Configuration file not found
verify
Section titled “verify”Validate configuration file schema and structure.
Arguments
Section titled “Arguments”- config (optional): Path to configuration file. Defaults to
unentropy.json.
Behavior
Section titled “Behavior”Validates:
- JSON syntax
- Required fields present
- Valid metric definitions
- Storage configuration correct
- Threshold syntax valid
Example Output
Section titled “Example Output”Success:
Failure:
Exit Codes
Section titled “Exit Codes”- 0: Configuration is valid
- 1: Validation failed
Global Options
Section titled “Global Options”These options work with all commands:
--help, -h
Section titled “--help, -h”Show help for a command.
--version
Section titled “--version”Show Unentropy version.
Common Workflows
Section titled “Common Workflows”First-Time Setup
Section titled “First-Time Setup”After Changing Configuration
Section titled “After Changing Configuration”Debugging Metric Collection
Section titled “Debugging Metric Collection”Multi-Project Setup
Section titled “Multi-Project Setup”Related Resources
Section titled “Related Resources”- Getting Started Guide - Initial setup walkthrough
- Configuration Reference - Config file syntax
- Metrics Guide - Metric configuration