Zut, Git! Claude로 {saperlipopette}를 터미널에 포팅하기

R-Blogger · 블로그·해설 · 2026-03-01

R-Blogger블로그·해설한국어2026-03-01

Zut, Git! Claude로 {saperlipopette}를 터미널에 포팅하기

Rust 기반 CLI 도구 'zut' 개발 및 활용 배경 저는 얼마 전 Rust를 배우기로 결심했습니다. 책을 구매하고 몇 달 뒤에 열어 작은 부수 프로젝트를 시작했어요. 바로 R 패키지 saperlipopette를 Rust로 작성한 CLI로 터미널에서 실행할 수 있도록 포팅했습니다. 그 후에는 동력이 사라져 프로젝트를 버리게 되었죠. 하지만 saperlipopette로 Git을 가르치는 과정이 계속 이어지면서 R 밖에서도 같은 교육을 제공하고 싶다는 생각이 들었습니다. 그 중에서도 Claude Code(Opus 4.6) 같은 LLM을 사용하면 CLI를 완성하는 데 큰 도움이 될 것 같았어요. 'zut' CLI의 기존 기능 이 CLI 프로젝트에는 이미 saperlipopette의 “Oh shit, Git!” 연습문제들이 포함되어 있습니다. 이름은 ‘ohcrabgit’이었는데, ‘Oh crap, Git!’과 러스트 로고를 연상시키는 문어에서 유래했죠. 반복해서 터미널에 입력하기엔 별로 좋은 이름이 아니었습니다. 인터페이스는 다음과 같습니다: 폴더 안에서 명령어를 입력해 연습문제를 만들고, 그 폴더를 열어 instructions.txt와 tip.txt를 읽어야 합니다. 이 구조는 간단하고 Git을 사용하는 대부분의 사람에게 호환됩니다. 내부적으로 git.rs 파일이 init_playground, create_branch 같은 유틸리티 함수를 갖고 있습니다. git2 크레이트를 활용했습니다. 새로운 목표와 Claude Code 활용 저는 더 이상 Rust 코드를 직접 작성할 의사가 없었습니다. 대신 CLI를 saperlipopette와 동일한 기능(더 많은 연습문제, 프랑스어와 스페인어 번역)으로 성장시키고 싶었어요. 또한 도움말 포맷과 설치 가이드를 개선하고자 했습니다. Claude Code를 활용해 다음과 같은 작업을 수행했습니다: 도움말 포맷 개선: ANSI 문자열을 대체하고 보다 접근성 좋은 색상 사용을 요청했습니다. CLI 명칭 변경: ‘zut’(프랑스어 욕설 “zut”)으로 바꿨고, Claude가 전역적으로 교체했습니다. 설치 명령 업데이트: cargo install --git https://github.com/maelle/zut로 바꾸었습니다. 언어 선택 기능 추가: 시스템 로케일, 환경 변수, 플래그를 통해 프랑스어, 영어, 스페인어를 자동 또는 수동 선택하도록 했습니다. 유닛 테스트와 통합 테스트 추가: Claude가 자동으로 작성해 주었고, 제가 요청한 테스트도 추가했습니다. 모든 saperlipopette 연습문제를 프랑스어, 영어, 스페인어 버전으로 변환했습니다. 일부는 R 스크립트를 셸 스크립트로 변환했습니다. 폴더 외부에서 실행되던 버그를 수정했습니다. 현재 'zut' 상태 설치: cargo install --git https://github.com/maelle/zut 도움말 조회: zut --help 출력 예시 (일부만 발췌): Create example Git messes to solve, inspired by https://ohshitgit.com/ Usage: zut [TARGET]. Arguments: Name of the exercise Possible values: - time-machine: Oh shit, I did something terribly wrong, please tell me git has a magic time machine!?! - small-change: Oh shit, I committed and immediately realized I need to make one small change! - latest-message: Oh shit, I need to change the message on my last commit! - committed-to-main: Oh shit, I accidentally committed something to main that should have been on a brand new branch! - committed-to-wrong: Oh shit, I accidentally committed to the wrong branch! - undo-commit: Oh shit, I need to undo a commit from like 5 commits ago! - undo-file: Oh shit, I need to undo my changes to a file! - split-changes: Hey I'd like to split these changes to the same file into several commits! - clean-dir: Hey, how do I remove all my debugging left-over stuff at once? - conflict: Hey I'd like to see what merge conflicts look like! - rebase-i: Hey I'd like to make my commits in a branch look informative and smart! (interactive rebase) - reset: Hey I'd like to restart from scratch and reorganize my commits! (git reset --mixed) - bisect: Hey I'd like to find which commit introduced a bug! - log-deleted-file: I want to find which commit deleted a file! - log-deleted-line: I want to find which commit deleted a line! - revparse: I want to understand ancestry references like HEAD~5 and HEAD^^! - blame: I want to find who added a specific line and when! - worktree: I need to see what the project looked like at a certain version! Options: --lang Language (default: auto-detected from system locale) [possible values: en, fr, es] -h, --help Print help (see a summary with '-h') -V, --version Print version Examples: zut small-change # creates the small-change exercise folder in a temporary folder. zut latest-message .. # creates the latest-message exercise folder in the parent of the current folder. zut blame ..
원문 URL
전체 글은 원문 페이지에서 이어서 읽을 수 있습니다.
원문에서 전체 글 읽기
작성자
R-Blogger
출처
R-Blogger
플랫폼
R-Blogger
분류
블로그·해설
언어
한국어
발행일
2026-03-01