Skip to content

feat: add clean --item to clean only the named artifacts without the interactive selector - #59

Merged
ohing504 merged 4 commits into
mainfrom
feat/clean-item
Oct 16, 2026
Merged

ohing504 merged 4 commits into
mainfrom
feat/clean-item

Conversation

@ohing504

@ohing504 ohing504 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

무엇이 바뀌나

  • clean --item <path>를 추가합니다. 스캔 결과 중 지정한 경로의 artifact만 남깁니다. 여러 개는 플래그를 반복해 넘기고, 쉼표는 경로의 일부로 취급합니다.
  • 아래 경우에는 아무것도 지우지 않고 종료 코드 1로 끝나며, 항목마다 이유를 출력합니다.
    • 지정한 경로가 스캔 결과와 하나도 맞지 않을 때
    • --yes가 지정한 항목을 건너뛸 때(caution인데 --include-caution이 없거나, protected일 때)
  • 터미널 없이 clean을 실행했을 때의 오류 메시지가 미리보기 명령을 --dry-run --yes로 명시합니다.

왜

  • 지금까지 터미널 없이 실행하는 clean은 생태계, 상태, safe 여부, 크기, 경로로만 대상을 좁힐 수 있었습니다. 그래서 ~/.npm처럼 artifact 하나만 지울 방법이 없었습니다.
  • 기존 메시지 "(add --dry-run to preview)"는 --dry-run만 붙이면 미리보기가 되는 것처럼 읽혔습니다. 실제로는 --dry-run만 붙이면 같은 오류로 다시 거부됩니다.

SPEC 변경

  • docs/SPEC.md § clean: 예시 한 줄을 추가하고 #### --item 절을 새로 썼습니다. 오류 메시지 예시 2개를 포함합니다.
  • docs/SPEC.md § clean: 터미널이 없을 때 출력하는 오류 메시지 예시를 바꿨습니다.
  • 결정 문서 변경은 없습니다.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DKZ2ySvoEcv2ezHfF7YmTY

ohing504 and others added 4 commits October 16, 2026 15:17
…interactive selector

Non-interactive clean could only narrow by ecosystem, status, safety, size
and path, so one artifact such as ~/.npm could not be cleaned alone without
a terminal. --item keeps only the scanned artifacts at the given paths and
fails before deleting anything when a path matches no artifact. The --yes
safety gate still applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKZ2ySvoEcv2ezHfF7YmTY
…mas as part of the path

--item now fails before deleting anything when --yes would skip a named
caution or protected artifact, listing each with its reason. The flag no
longer splits on commas; repeat it for more paths. A "~/" item is left
unexpanded when the home directory is unknown, and the no-match error names
the filters that narrow the scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKZ2ySvoEcv2ezHfF7YmTY
… --item matching

selectForYes now returns the items it keeps with their reason, so the
caution notice and the --item failure read one judgment instead of
recomputing it. keepItems tracks matches in one map, and the clean tests
share helpers for building trees and checking paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKZ2ySvoEcv2ezHfF7YmTY
…ew command is unambiguous

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKZ2ySvoEcv2ezHfF7YmTY
@ohing504
ohing504 merged commit 3d42e47 into main Oct 16, 2026
4 checks passed
@ohing504
ohing504 deleted the feat/clean-item branch October 16, 2026 07:02
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.

1 participant