Skip to content

Update CLI ReadMe for Sync #37

@aboo

Description

@aboo

Document workbench --sync in README files

Description

PR #36 added the workbench --sync command — a 10-step flow that fetches managed files from the source workbench and merges them into the local workbench, with an auto-commit. The implementation is complete but the command is undocumented in both README files. This issue adds user-facing documentation for --sync in the root README.md and the CLI package README.md.

Context

Users who fork or clone the workbench repository need to stay in sync with upstream improvements (updated slash commands, skills, schemas, and README). The --sync command makes this seamless — it clones the source, applies configured sync.paths, and commits the result. Without documentation, users won't discover or understand this capability.

This is a documentation-only issue. No code changes. All sync implementation is already merged and committed in PR #36.

Requirements

Functional Requirements

  • Add a ## Syncing Your Workbench section to the root README.md, placed between "Code indexing with ck" and "Development Setup"
    • Brief description of what --sync does (fetches upstream managed files to keep workbench current)
    • Mention that sync auto-commits changes with a chore message
    • Mention the interactive confirmation prompt before files are overwritten
    • One-line usage example: workbench --sync
    • Cross-reference link to packages/workbench-cli/README.md for full flag documentation
    • Note: must be run from an initialized workbench (created via workbench --init)
    • Note: "Run periodically to stay updated" (non-prescriptive guidance)
  • Add a ## Sync section to packages/workbench-cli/README.md, placed after "Setup flags"
    • One-paragraph narrative explaining what sync does at a high level
    • Flag table (matching the "Init flags" / "Setup flags" pattern) with columns Flag | Description | Default
      • --sync — Sync workbench files (.opencode/, .workbench/schemas/, README.md) from the source repository — false
    • Note that sync auto-commits changes and prompts for confirmation before overwriting
  • Add workbench --sync to the existing "Examples" section in the CLI README
  • Add sync-specific error rows to the existing "Error scenarios" table in the CLI README:
    • No .workbench/config.yaml found — workbench not initialized → Run workbench --init first
    • No source.repository found in config — config predates sync feature → Re-initialize workbench
    • Working tree is not clean — uncommitted changes present → Commit or stash changes first
    • No sync.paths found in source — source workbench doesn't support sync → Contact source maintainer

Non-Functional Requirements

  • Follow the existing documentation style and formatting conventions of each README
  • Flag table in CLI README must match the column structure (Flag | Description | Default) of existing tables
  • Error table additions must match the existing Error | Cause | Resolution column structure

Current State

  • Root README.md (188 lines): Sections include Getting Started, Folder Structure, Working on issues, Project Management, Code indexing with ck, Development Setup, etc. No mention of --sync anywhere.
  • CLI README.md (166 lines): Has "Init flags" table and "Setup flags" table. --sync is absent from both. Has "Examples" section and "Error scenarios" table. No mention of sync anywhere.
  • --help output (packages/workbench-cli/src/args.ts): Already includes --sync in USAGE, OPTIONS, and EXAMPLES blocks (lines 68, 83, 95). No changes needed here — this is explicitly out of scope.

Desired State

After this issue, a user reading either README will:

  1. Discover that workbench --sync exists and understand what it does
  2. Know the prerequisites (must be in an initialized workbench)
  3. Know what to expect (confirmation prompt, file overwrites, auto-commit)
  4. Know how to troubleshoot common errors
  5. Be able to navigate from the root README to the CLI README for full flag details

Research Context

Keywords to Search

  • sync — flag name and command; used in args.ts, sync.ts, settings.yml
  • --sync — exact CLI flag format
  • workbench --sync — usage string
  • executeSync — main implementation function in packages/workbench-cli/src/commands/sync.ts
  • sync.paths — configuration key in .workbench/settings.yml
  • source.repository — config dependency in .workbench/config.yaml

Patterns to Investigate

  • Flag table pattern in CLI README — "Init flags" and "Setup flags" use | Flag | Description | Default | three-column format. New sync table must match exactly.
  • Section structure pattern in root README — h2 sections (##) with brief prose and no tables. New "Syncing Your Workbench" section should follow this style.
  • Error table pattern in CLI README — uses | Error | Cause | Resolution | three-column format. Sync error rows must match.
  • Cross-reference pattern — root README line 37 already links to CLI README with See [packages/workbench-cli/README.md](...) for full CLI documentation. New section should use a similar link.

Key Decisions Made

  • Root README: New ## Syncing Your Workbench section inserted between "Code indexing with ck" and "Development Setup" — scope confirmed in Q&A
  • CLI README: New ## Sync section after "Setup flags" with flag table + narrative paragraph — scope confirmed in Q&A
  • Auto-commit behavior must be documented (users need to know sync creates a commit) — confirmed in Q&A
  • Interactive confirmation prompt must be mentioned — confirmed in Q&A
  • sync.paths configuration is NOT documented for end users — works out of the box — confirmed in Q&A
  • --help output update, CONTRIBUTING.md update, sync.paths defaults, snapshot/rollback — all explicitly out of scope
  • No code changes — documentation only

Environment Context

  • Pathway mode: workbench
  • ck CLI available: false (disabled in settings)
  • PM tool: github-issues

Success Criteria

Automated Verification

  • No verification steps applicable (documentation-only change)

Manual Verification

  • Root README.md contains a ## Syncing Your Workbench section between "Code indexing with ck" and "Development Setup" with description, example, and cross-reference
  • CLI README.md contains a ## Sync section after "Setup flags" with flag table and narrative paragraph
  • CLI README "Examples" section includes workbench --sync
  • CLI README "Error scenarios" table includes the four sync-specific error rows
  • workbench --help output remains unchanged (out of scope)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions