GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.contentstack.com — Audit Plugin | V2.x.x | Contentstack Audit PluginupdateLast updated August 13, 2026 Contentstack CLI lets you use the Audit plugin to perform audit operations on the exported stack data, helping you identify and fix issues. The Audit plugin provides users with detailed reports about any issues related to the following, in a given stack data:
Additionally, it includes commands that validate and resolve these issues, including missing references, invalid field values, missing mandatory fields, incomplete publish details, field rule violations, and content type mismatches. This step-by-step guide lets you install and use the Audit plugin in CLI. Prerequisites
Supported ModulesCommandsThe Audit plugin lets you perform the following operation in Contentstack CLI: Issue IdentificationThe cm:stacks:audit command allows you to validate exported stack data and identify various issues across all supported modules.
You successfully ran an audit operation to find data issues in your stack. Alternatively, you can pass the path in the command as given below: 1 csdx cm:stacks:audit --data-dir <path> 1 csdx cm:stacks:audit Options
NoteIf the custom role or the workflow module has branches enabled and you want audit to operate on all the branches except a particular branch, then you can provide that specific branch name using the --config flag as given below: 123 {
"branch": "<branch-name>"
}Examples
Issue ResolutionThe cm:stacks:audit:fix command allows you to validate exported stack data and actively resolve the identified issues.
You successfully ran an audit operation to fix data issues in your stack. Alternatively, you can pass the path in the command as given below: 1 csdx cm:stacks:audit:fix --data-dir <path> 1 csdx cm:stacks:audit:fix Options
Note
Examples
Module-Specific Audit ChecksContent Types ModuleThe Content Types module audits the following:
Report files generated: Global Fields ModuleThe Global Fields module audits the same issues as the Content Types module, using the same audit logic.
Report files generated: Entries ModuleThe Entries module audits the following:
Report files generated:
Extensions ModuleThe Extensions module audits the following:
Report files generated: Workflows ModuleThe Workflows module audits the following:
Report files generated: Custom Roles ModuleThe Custom Roles module audits the following:
Report files generated: Assets ModuleThe Assets module audits the following:
Report files generated: Field Rules ModuleThe Field Rules module audits the following:
Report files generated: Summary ReportA summary report provides an overview of all audited modules. Report file: Summary report structure:
Module DependenciesSome modules require other modules to be present in the exported data for proper auditing. Understanding these dependencies helps ensure accurate audit results. Entries Module DependenciesThe Entries module requires the following modules to be present in the exported data to perform a complete audit:
Note If required dependencies are missing, the Entries audit may return incomplete or inaccurate results. Assets Module DependenciesThe Assets module requires the following modules to be present in the exported data to perform a complete audit:
Field Rules Module DependenciesThe Field Rules module requires the following modules to be present in the exported data to perform a complete audit:
Other ModulesThe following modules have no dependencies and can be audited independently:
Common Use CasesThis section outlines complete workflows for common developer use cases with the Audit plugin. Pre-Import ValidationValidate exported data before importing it into another stack to identify and fix issues early. Complete Workflow: 1234567891011121314151617 # Step 1: Export data from the source stack csdx cm:stacks:export --data-dir ./exported-data # Step 2: Audit the exported data csdx cm:stacks:audit --data-dir ./exported-data --report-path ./audit-reports # Step 3: Review the Summary report cat ./audit-reports/Summary.json # Step 4: If issues are found, fix them csdx cm:stacks:audit:fix --data-dir ./exported-data --copy-dir --report-path ./audit-reports # Step 5: Verify fixes by auditing again csdx cm:stacks:audit --data-dir ./exported-data --report-path ./audit-reports-verify # Step 6: Import the fixed data csdx cm:stacks:import --data-dir ./exported-data Post-Export Quality CheckAfter exporting, run a quality check on critical modules to ensure data integrity and structural completeness. Complete Workflow: 12345678910111213141516171819 # Step 1: Export data csdx cm:stacks:export --data-dir ./my-export # Step 2: Run a quick audit (focus on critical modules) csdx cm:stacks:audit \ --data-dir ./my-export \ --modules=content-types \ --modules=entries \ --modules=assets \ --report-path ./quick-audit # Step 3: Check for any critical issues in the export if [ -s ./quick-audit/Summary.json ]; then echo "Issues found. Review the reports in ./quick-audit" # Review specific reports cat ./quick-audit/entries.json else echo "Export completed. No issues detected." fi Fixing Before MigrationAutomatically fix all audit-detected issues to prepare your data for a clean migration. Complete Workflow: 1234567891011121314151617181920212223242526272829 # Step 1: Export data from the source stack csdx cm:stacks:export --data-dir ./migration-data # Step 2: Perform a full audit to identify all issues csdx cm:stacks:audit \ --data-dir ./migration-data \ --report-path ./migration-audit \ --show-console-output # Step 3: Review which issues can be fixed automatically cat ./migration-audit/Summary.json | grep -A 5 "Fixable" # Step 4: Fix all fixable issues with backup csdx cm:stacks:audit:fix \ --data-dir ./migration-data \ --copy-dir \ --copy-path ./migration-data-backup \ --report-path ./migration-fix-reports # Step 5: Verify the fixes csdx cm:stacks:audit \ --data-dir ./migration-data \ --report-path ./migration-verify # Step 6: Compare results before and after echo "Before fix:" cat ./migration-audit/Summary.json echo "After fix:" cat ./migration-verify/Summary.json Selective Module AuditingRun audits only on specific modules when you want to target known problem areas or speed up the process for large stacks. Complete Workflow: 123456789101112131415161718 # Step 1: Audit only the entries module (recommended for large stacks) csdx cm:stacks:audit \ --data-dir ./exported-data \ --modules=entries \ --report-path ./entries-audit # Step 2: If entry issues are found, audit dependent modules csdx cm:stacks:audit \ --data-dir ./exported-data \ --modules=content-types \ --modules=global-fields \ --report-path ./dependencies-audit # Step 3: Fix entry-specific issues csdx cm:stacks:audit:fix \ --data-dir ./exported-data \ --modules=entries \ --copy-dir Branch Migration PreparationAudit branch-specific issues before merging or migrating to the main branch. Complete Workflow: 123456789101112131415161718192021222324252627 # Step 1: Export branch data
csdx cm:stacks:export \
--data-dir ./branch-data \
--branch my-feature-branch
# Step 2: Audit branch data (excluding main branch from workflows/roles)
csdx cm:stacks:audit \
--data-dir ./branch-data \
--config branch-config.json \
--report-path ./branch-audit
# Where branch-config.json contains:
# {
# "branch": "main"
# }
# Step 3: Fix issues in the branch data
csdx cm:stacks:audit:fix \
--data-dir ./branch-data \
--config branch-config.json \
--copy-dir
# Step 4: Verify the branch data is clean
csdx cm:stacks:audit \
--data-dir ./branch-data \
--config branch-config.json \
--report-path ./branch-verifyCI/CD Pipeline IntegrationAutomate auditing in your deployment pipeline. Complete Workflow (GitHub Actions example): 1234567891011121314151617181920212223242526272829303132333435363738 # .github/workflows/audit.yml
name: Audit Exported Data
on: [push, pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Export stack data
run: |
csdx cm:stacks:export --data-dir ./exported-data
- name: Run audit
run: |
csdx cm:stacks:audit \
--data-dir ./exported-data \
--report-path ./audit-reports \
--output json
- name: Check for issues
run: |
if [ -s ./audit-reports/Summary.json ]; then
echo "Issues found in exported data!"
cat ./audit-reports/Summary.json
exit 1
else
echo "No issues found. Data is clean!"
fi
- name: Upload audit reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: audit-reports
path: ./audit-reportsShell Script Example:123456789101112131415161718192021222324 #!/bin/bash # audit-check.sh EXPORT_DIR="./exported-data" AUDIT_DIR="./audit-reports" # Export data csdx cm:stacks:export --data-dir "$EXPORT_DIR" # Run audit csdx cm:stacks:audit \ --data-dir "$EXPORT_DIR" \ --report-path "$AUDIT_DIR" \ --output json # Check if issues were found if [ -s "$AUDIT_DIR/Summary.json" ]; then echo "Audit failed: Issues found" cat "$AUDIT_DIR/Summary.json" exit 1 else echo "Audit passed: No issues found" exit 0 fi Fixing Select Field IssuesAutomatically fix invalid select field values in the entries. Complete Workflow: 12345678910111213141516171819202122232425262728 # Step 1: Audit entries to find select field issues
csdx cm:stacks:audit \
--data-dir ./exported-data \
--modules=entries \
--report-path ./audit-reports
# Step 2: Review the select field issues report
cat ./audit-reports/Entries_Select_field.json
# Step 3: Create a configuration file to enable select field fixing
cat > select-fix-config.json << EOF
{
"fixSelectField": true
}
EOF
# Step 4: Fix select field issues using the configuration
csdx cm:stacks:audit:fix \
--data-dir ./exported-data \
--config select-fix-config.json \
--copy-dir \
--report-path ./fix-reports
# Step 5: Verify that select field issues were resolved
csdx cm:stacks:audit \
--data-dir ./exported-data \
--modules=entries \
--report-path ./verify-reportsTroubleshootingCommon Issues
Best Practices
Limitation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |