@bifos/dooray-cli 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # dooray-cli
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@bifos/dooray-cli.svg)](https://www.npmjs.com/package/@bifos/dooray-cli)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@bifos/dooray-cli.svg)](https://www.npmjs.com/package/@bifos/dooray-cli)
3
5
  [![CI](https://github.com/jon890/dooray-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/jon890/dooray-cli/actions/workflows/ci.yml)
6
+ [![license](https://img.shields.io/npm/l/@bifos/dooray-cli.svg)](https://github.com/jon890/dooray-cli/blob/main/LICENSE)
4
7
 
5
8
  NHN Dooray REST API를 래핑한 CLI 도구입니다. 터미널과 AI 에이전트 환경에서 Dooray 업무를 관리할 수 있습니다.
6
9
 
@@ -118,6 +121,16 @@ dooray post edit <project> 42 --title "새 제목" --body "새 본문"
118
121
  dooray post edit <project> 42 --body-file ./updated.md
119
122
  ```
120
123
 
124
+ #### 본문 변경 시 attachment 보호
125
+
126
+ `post edit` 와 `post comment edit` 는 본문을 통째로 replace 합니다. 새 본문에 기존 inline attachment markdown(`![](/files/<id>)`)이 빠져 있으면 stderr 에 경고를 띄우고 (y/N) 로 물어봅니다.
127
+
128
+ 자동화 환경 (pipe / non-TTY) 에서는 그대로 abort 됩니다. 의도한 변경이면 `--no-confirm` 으로 다시 실행하세요.
129
+
130
+ ```bash
131
+ echo "new body" | dooray post comment edit <project> <post-number> <comment-id> --body - --no-confirm
132
+ ```
133
+
121
134
  ### 댓글
122
135
 
123
136
  ```bash
@@ -128,31 +141,50 @@ dooray post comment add <project> 42 --body-file ./comment.md
128
141
 
129
142
  > table 출력의 Creator 컬럼은 프로젝트 멤버 캐시로 자동 enrich되며, `--json`은 raw 응답을 유지한다 (ADR-021).
130
143
 
131
- #### 멘션 (comment add / comment edit)
132
-
133
- `--mention <name>` (반복), `--mention-group <code>` (반복)으로 본문 앞에 멘션 마크업을 자동 prepend한다.
144
+ #### 멘션·내부 링크 자동 삽입
134
145
 
135
146
  ```bash
136
- # 멤버 멘션 1명
137
- dooray post comment add P 1 --mention 홍길동 --body "확인 부탁드립니다"
147
+ # 댓글에 멤버·그룹 멘션
148
+ dooray post comment add <project> <post-number> \
149
+ --body "주간 리포트 첨부" \
150
+ --mention "홍길동" \
151
+ --mention-group <project>/dev
152
+
153
+ # 본문에 다른 업무 링크 append
154
+ dooray post create <project> \
155
+ --title "이번 주 작업" \
156
+ --body "관련 이슈" \
157
+ --link-task <project>/470
158
+
159
+ # 송신 전 합성 결과 미리보기
160
+ dooray post comment add <project> <post-number> --body "..." --link-task <project>/470 --dry-run
161
+ ```
162
+
163
+ > `--mention` / `--mention-group` / `--link-task` / `--dry-run` 은 `post create`, `post edit`, `post comment add`, `post comment edit` 4 명령 모두 지원.
164
+ > 이전 버전 캐시는 orgId가 없으므로 첫 호출 시 자동 갱신됩니다 (또는 `dooray cache clear`).
138
165
 
139
- # 여러
140
- dooray post comment add P 1 --mention 홍길동 --mention 김철수 --body "..."
166
+ #### 참조자(cc) / 담당자(to) 변경 (ADR-025)
141
167
 
142
- # 그룹 멘션
143
- dooray post comment add P 1 --mention-group 개발 --body "검토 요청"
168
+ ```bash
169
+ # 멤버/그룹 추가 (기존 참조자 유지 + dedupe)
170
+ dooray post edit <project> <post-number> \
171
+ --cc 홍길동 --cc-group dev-team \
172
+ --to 김철수
144
173
 
145
- # 멤버 + 그룹 혼합
146
- dooray post comment add P 1 \
147
- --mention 홍길동 \
148
- --mention-group 개발 \
149
- --body "검토 부탁드립니다"
174
+ # 기존 참조자 전부 비우고 신규만
175
+ dooray post edit <project> <post-number> --cc-clear --cc 홍길동
150
176
 
151
- # comment edit에도 동일 옵션 사용 가능
152
- dooray post comment edit P 1 <commentId> --mention 홍길동 --body "수정 내용"
177
+ # 신규 업무 생성 그룹 cc 동봉
178
+ dooray post create <project> --title "주간 audit" --cc-group dev-team
153
179
  ```
154
180
 
155
- > 이전 버전 캐시는 orgId가 없으므로 호출 자동 갱신됩니다 (또는 `dooray cache clear`).
181
+ interactive ($EDITOR) 모드에서는 6개 옵션이 무시되고 stderr 경고가 출력됩니다.
182
+ `post edit --dry-run --json` 사용 시 출력에 `users: { to, cc }` 가 포함되어 API 호출 없이 변경 결과 미리보기 가능. (`post create --dry-run` 은 본문만 출력하며 `users` 는 포함하지 않음.)
183
+
184
+ ```bash
185
+ dooray post edit <project> <post-number> --cc-group dev-team --dry-run --json | jq '.users.cc'
186
+ # 출력 예: [{ "type": "group", "group": { "projectMemberGroupId": "...", "members": [] } }, ...]
187
+ ```
156
188
 
157
189
  #### comment list 필터 옵션
158
190
 
@@ -187,6 +219,18 @@ dooray post comment latest <project> 42 -n 3
187
219
  dooray post comment latest --url <dooray-url>
188
220
  ```
189
221
 
222
+ #### comment get
223
+
224
+ 단일 댓글 ID 로 본문·메타·attachments 를 직접 fetch. `comment list` 후 jq 필터링 없이 바로 사용할 수 있어 자동화 파이프라인에 적합하다.
225
+
226
+ ```bash
227
+ # 단일 댓글 조회 (자동화 친화)
228
+ dooray post comment get <project> <post-number> <comment-id> --json | jq -r '.body.content'
229
+
230
+ # ID / URL 모드
231
+ dooray post comment get --id <postId> --comment-id <commentId> --json
232
+ ```
233
+
190
234
  ### 상태 변경
191
235
 
192
236
  ```bash