com um clique
gmail
// gogcli를 사용하여 Gmail 메일을 검색, 조회, 발송하는 skill. "메일 검색해줘", "이메일 보내줘", "gmail search", "메일 확인해줘", "최근 메일", "신규 메일", "메일 답장", "gmail send", "메일 보내줘", "안 읽은 메일" 등 Gmail 관련 요청에 트리거된다.
// gogcli를 사용하여 Gmail 메일을 검색, 조회, 발송하는 skill. "메일 검색해줘", "이메일 보내줘", "gmail search", "메일 확인해줘", "최근 메일", "신규 메일", "메일 답장", "gmail send", "메일 보내줘", "안 읽은 메일" 등 Gmail 관련 요청에 트리거된다.
| name | gmail |
| description | gogcli를 사용하여 Gmail 메일을 검색, 조회, 발송하는 skill. "메일 검색해줘", "이메일 보내줘", "gmail search", "메일 확인해줘", "최근 메일", "신규 메일", "메일 답장", "gmail send", "메일 보내줘", "안 읽은 메일" 등 Gmail 관련 요청에 트리거된다. |
gogcli(gog) CLI를 사용하여 Gmail 메일을 검색, 조회, 발송한다.
gmail/
├── SKILL.md
└── references/
└── gog-gmail-commands.md # 주요 명령어 레퍼런스
스크립트 없이 gog CLI를 직접 실행한다.
which gog
명령이 실패하면 사용자에게 설치를 안내한다:
gogcli 설치 안내
brew install gogcli설치 완료 후 다시 시도해주세요.
설치가 확인되면 다음 단계로 진행한다.
gog auth list
계정이 없으면 OAuth 설정을 안내한다:
Gmail 인증 설정 가이드
- Google Cloud Console에서 프로젝트 생성
- Gmail API 활성화
- OAuth 동의 화면 설정 → 테스트 사용자 추가
- OAuth 클라이언트 생성 → "Desktop app" → JSON 다운로드
- 터미널에서 아래 명령 실행:
gog auth credentials ~/Downloads/client_secret_....json gog auth add <your-email@gmail.com> --services gmail브라우저가 열리면 Google 계정으로 로그인하여 권한을 허용해주세요.
인증이 확인되면 GOG_ACCOUNT 환경변수 또는 --account 플래그로 계정을 지정한다.
사용자 요청을 아래 중 하나로 분류하여 실행한다.
gog gmail search '<Gmail 검색 쿼리>' --max <N> --json
출력 스키마 — envelope 객체로 감싸져 있으며, 각 thread의 필드는 아래가 전부다. snippet·to·body 필드는 없다:
{
"nextPageToken": "",
"threads": [
{ "id": "...", "date": "YYYY-MM-DD HH:MM", "from": "...",
"subject": "...", "labels": ["INBOX", ...], "messageCount": 2 }
]
}
자주 쓰는 검색 쿼리:
newer_than:7dis:unreadfrom:someone@example.comhas:attachmentfrom:boss@example.com newer_than:3d is:unreadgog gmail messages search '<query>' --max <N> --include-body --json
출력 스키마 — 역시 envelope 객체다. snippet 필드는 없고, 본문은 --include-body 플래그를 붙여야 body로 들어온다:
{
"nextPageToken": "...",
"messages": [
{ "id": "...", "threadId": "...", "date": "YYYY-MM-DD HH:MM",
"from": "...", "subject": "...", "labels": [...],
"body": "..." }
]
}
gog gmail thread get <threadId> --json
gog gmail get <messageId> --json
gog gmail send --to <수신자> --subject "<제목>" --body "<본문>"
CC/BCC 추가:
gog gmail send --to <수신자> --cc <참조> --bcc <숨은참조> --subject "<제목>" --body "<본문>"
HTML 본문:
gog gmail send --to <수신자> --subject "<제목>" --body "Plain fallback" --body-html "<p>HTML 본문</p>"
gog gmail send --reply-to-message-id <messageId> --quote --to <수신자> --subject "Re: <원제목>" --body "<답장 내용>"
gog gmail labels list --json
gog gmail thread get <threadId> --download --out-dir <다운로드경로>
# 초안 목록
gog gmail drafts list --json
# 초안 생성
gog gmail drafts create --to <수신자> --subject "<제목>" --body "<본문>"
# 초안 발송
gog gmail drafts send <draftId>
JSON 결과를 파싱하여 사용자에게 읽기 좋게 정리한다:
messages search --include-body로 재조회한다 (search 결과에 snippet 필드는 없음)메일을 외부 채널(Discord 등)로 알리기 전에, 반드시 아래 스크립트를 실행하여 판정한다:
python3 .claude/skills/gmail/scripts/check_filter.py \
--from "<발신자>" \
--subject "<제목>"
| 출력 | exit code | 의미 |
|---|---|---|
always_inbox | 0 | 반드시 알림 전송 |
ignore | 1 | 알림 건너뜀 |
notify | 2 | 기본 동작 (알림 전송) |
필터 규칙 추가/수정은 data/filter-prefs.json에서 한다.
--json 플래그를 붙여 파싱 가능한 출력을 얻는다GOG_ACCOUNT 환경변수가 설정되어 있으면 우선 사용한다gog gmail search / messages search의 --json 출력은 항상 envelope 객체({threads: [...]} 또는 {messages: [...]})다. 과거에 아래 실수들이 반복되어 전부 에러로 터졌다:
.snippet 필드를 가정 → 존재하지 않음. 본문이 필요하면 gog gmail messages search --include-body 또는 gog gmail thread get <id>.jq 'map(...)', jq 'length') → envelope 객체이므로 실패하거나 엉뚱한 값(객체 key 수)을 돌려준다. 먼저 .threads / .messages로 드릴다운해야 한다.jq '.threads | length, (.threads | map(.id))' 같이 쓰면 |보다 , 우선순위가 낮아 전체가 .threads | (length, (.threads | map(.id)))로 파싱되고 두 번째 .threads가 배열에 적용돼 터진다. 첫 드릴다운은 한 번만, 혹은 envelope을 유지한 채 두 표현식을 쓰자.안전 패턴:
# 안전: 한 번만 드릴다운
... --json | jq '.threads | map({id, from, subject, date})'
# envelope을 그대로 유지하며 두 값 뽑기
... --json | jq '{count: (.threads|length), ids: [.threads[].id]}'
# envelope이 귀찮으면 --results-only 로 배열만 받기
gog gmail search '...' --json --results-only | jq 'map({id, from, subject})'
--max 플래그로 결과 수를 제한한다.--track 옵션으로 읽음 추적이 가능하나, 사전 설정이 필요하다.Create git commits following project conventions. Use this skill whenever committing changes — it enforces the project's prefix rules, message style, and commit separation policy. Triggers for any commit request, "커밋해줘", "commit this", "commit push", or when wrapping up a task that produced file changes.
코드베이스에 새 프로젝트를 추가하는 skill. "새 프로젝트 만들어줘", "프로젝트 추가", "프로젝트 생성", "new project" 등 프로젝트 생성 관련 요청에 트리거된다. 프로젝트 목적과 담당자(DRI)를 포함한 자연어 프롬프트를 받아 처리한다.