Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

When CKB init fails, users encounter "not an init folder" errors but cannot remove the corrupted config to reinitialize. The existing -d flag removed only data while keeping the broken config.

Changes

  • Inverted -d flag semantics:

    • offckb clean (default): Removes chain data only, preserves config files
    • offckb clean -d: Deep clean—removes everything including corrupted config
  • Updated help text: Flag description now indicates deep clean behavior

  • Updated README: Removed -d from config modification workflow since default now preserves config

Usage

Fix corrupted init:

offckb clean -d    # Remove everything including broken config
offckb node        # Reinitializes cleanly

Reset chain, keep config:

offckb clean       # Remove data, preserve custom config
offckb node        # Restart with existing config

Breaking Change

This inverts the previous behavior where default removed everything and -d removed data only. New behavior makes default safer and flag more aggressive, aligning with typical CLI conventions.

Original prompt

This section details on the original issue you should resolve

<issue_title>offckb clean -d to remove init config folder</issue_title>
<issue_description>When running offckb node, sometimes the users has ckb init process went wrong then ckb complaints with the error that isnot a init folder. offckb clean does not remove the init folder, only chain data folder. passing a -d to do this.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…deep clean

Co-authored-by: RetricSu <23436060+RetricSu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add clean command to remove init config folder Invert offckb clean -d behavior: default preserves config, -d enables deep clean Jan 15, 2026
Copilot AI requested a review from RetricSu January 15, 2026 00:06
@RetricSu RetricSu marked this pull request as ready for review January 15, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

offckb clean -d to remove init config folder

2 participants