Skip to content

Audit CLI help output against README documentation #22

@gregpriday

Description

@gregpriday

Summary

Verify that the live copytree --help output exactly matches the flags, examples, and descriptions documented in the README to ensure consistency between documentation and implementation.

Problem Statement

As the CLI evolves, discrepancies can emerge between:

  • Documented flags in README vs actual implementation
  • Flag descriptions and examples
  • Command aliases and shortcuts
  • Default values and behavior

This affects:

  • New users learning the tool from documentation
  • Documentation accuracy and trust
  • Support burden from incorrect examples
  • Developer experience

Current State

Documentation Sources:

Known Areas to Verify:

  • All 8 commands exist and work: copy, profile:list, profile:validate, copy:docs, config:validate, config:inspect, cache:clear, install:copytree
  • Flag aliases match (-i/--display, -S/--stream, -t/--only-tree, -r/--as-reference)
  • Default formats (XML is default)
  • Format options (xml, json, markdown, tree)
  • Git integration flags (-m/--modified, -c/--changed)
  • Output destinations (clipboard, file, display, stream)
  • All documented examples are runnable

Proposed Solution

Create systematic audit to verify:

  1. All documented flags exist in CLI implementation
  2. All CLI flags are documented
  3. Descriptions match between docs and --help
  4. Examples in README work as written
  5. Aliases are consistent
  6. Default values are correct

Affected Components

Implementation Approach

  1. Create Automated Test:

    • Create tests/e2e/cli-help.test.js
    • Snapshot test for copytree --help output
    • Test for each command's help
    • Verify flag presence
  2. Manual Audit Checklist:

    • Compare README "Frequently Used Flags" vs actual options
    • Test each example from "Common Recipes"
    • Verify all format options work
    • Check flag aliases
    • Verify default behaviors
  3. Update as Needed:

    • Fix discrepancies (prefer implementation over docs if both work)
    • Add missing documentation
    • Remove outdated flags from docs
    • Update examples to match current behavior

Tasks

  • Create tests/e2e/cli-help.test.js with snapshot tests for help output
  • Test copytree --help matches README introduction
  • Test copytree copy --help matches documented copy command flags
  • Test all 8 commands have help: profile:list, profile:validate, copy:docs, config:validate, config:inspect, cache:clear, install:copytree
  • Verify all flags in "Frequently Used Flags" exist and work
  • Test all examples from "Common Recipes" section
  • Verify format options: --format xml, --format json, --format markdown, --format tree
  • Verify git flags: -m/--modified, -c/--changed <ref>
  • Verify output flags: -i/--display, -o/--output, -S/--stream, --clipboard
  • Verify special flags: -t/--only-tree, -r/--as-reference, --with-line-numbers, --with-git-status
  • Check that undocumented flags are intentional (internal/experimental)
  • Update README if implementation is correct but docs are wrong
  • Update CLI descriptions if docs are correct but implementation is unclear
  • Add missing aliases if commonly needed
  • Document any breaking changes from mismatches

Acceptance Criteria

  • All documented flags exist in copytree --help output
  • All examples in README can be copy-pasted and work
  • CLI help text matches README descriptions
  • No undocumented flags appear in help (unless intentionally internal)
  • Snapshot tests prevent future drift between docs and implementation
  • Default values documented correctly (format: xml, output: clipboard)
  • All flag aliases work as documented
  • All 8 commands appear in help and work

Additional Context

Flags documented in README to verify:

  • --format <xml|json|markdown|tree> - Output format (default: xml)
  • -t, --only-tree - Tree structure only
  • -i, --display - Print to terminal
  • --clipboard - Force clipboard
  • -S, --stream - Stream output
  • -C, --char-limit <n> - Character budget
  • --with-line-numbers - Line numbers
  • --info - File metadata
  • --show-size - File sizes
  • --with-git-status - Git status
  • -r, --as-reference - Generate reference
  • --always <pattern...> - Force include
  • --dedupe - Remove duplicates
  • --sort <path|size|modified|name|extension> - Sort files

Commands to verify:

  1. copytree [path] - Main copy command (default)
  2. copytree profile:list - List profiles
  3. copytree profile:validate <name> - Validate profile
  4. copytree cache:clear - Clear caches
  5. copytree config:validate - Validate config
  6. copytree config:inspect - Inspect config
  7. copytree copy:docs - Copy documentation
  8. copytree install:copytree - Installation wizard

Good Examples of CLI/Docs Parity:

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-3 🌿Low impact polish/minor bugs/chores. Backlog if capacity allows.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions