@rlarua/agentteams-cli 0.0.9 → 0.0.11

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.
Files changed (118) hide show
  1. package/API-CLI-WORKFLOW.md +418 -0
  2. package/LICENSE +201 -0
  3. package/README.md +220 -128
  4. package/dist/api/comment.d.ts +11 -0
  5. package/dist/api/comment.d.ts.map +1 -0
  6. package/dist/api/comment.js +33 -0
  7. package/dist/api/comment.js.map +1 -0
  8. package/dist/api/plan.d.ts +13 -0
  9. package/dist/api/plan.d.ts.map +1 -0
  10. package/dist/api/plan.js +43 -0
  11. package/dist/api/plan.js.map +1 -0
  12. package/dist/api/postmortem.d.ts +6 -0
  13. package/dist/api/postmortem.d.ts.map +1 -0
  14. package/dist/api/postmortem.js +33 -0
  15. package/dist/api/postmortem.js.map +1 -0
  16. package/dist/api/report.d.ts +6 -0
  17. package/dist/api/report.d.ts.map +1 -0
  18. package/dist/api/report.js +33 -0
  19. package/dist/api/report.js.map +1 -0
  20. package/dist/api/status.d.ts +12 -0
  21. package/dist/api/status.d.ts.map +1 -0
  22. package/dist/api/status.js +33 -0
  23. package/dist/api/status.js.map +1 -0
  24. package/dist/commands/agentConfig.d.ts.map +1 -1
  25. package/dist/commands/agentConfig.js +10 -3
  26. package/dist/commands/agentConfig.js.map +1 -1
  27. package/dist/commands/agentConfigCommand.d.ts +2 -0
  28. package/dist/commands/agentConfigCommand.d.ts.map +1 -0
  29. package/dist/commands/agentConfigCommand.js +20 -0
  30. package/dist/commands/agentConfigCommand.js.map +1 -0
  31. package/dist/commands/comment.d.ts +2 -0
  32. package/dist/commands/comment.d.ts.map +1 -0
  33. package/dist/commands/comment.js +55 -0
  34. package/dist/commands/comment.js.map +1 -0
  35. package/dist/commands/config.d.ts +2 -0
  36. package/dist/commands/config.d.ts.map +1 -0
  37. package/dist/commands/config.js +30 -0
  38. package/dist/commands/config.js.map +1 -0
  39. package/dist/commands/convention.d.ts +25 -0
  40. package/dist/commands/convention.d.ts.map +1 -1
  41. package/dist/commands/convention.js +492 -43
  42. package/dist/commands/convention.js.map +1 -1
  43. package/dist/commands/conventionRouter.d.ts +3 -0
  44. package/dist/commands/conventionRouter.d.ts.map +1 -0
  45. package/dist/commands/conventionRouter.js +46 -0
  46. package/dist/commands/conventionRouter.js.map +1 -0
  47. package/dist/commands/dependency.d.ts.map +1 -1
  48. package/dist/commands/dependency.js +2 -1
  49. package/dist/commands/dependency.js.map +1 -1
  50. package/dist/commands/dependencyCommand.d.ts +2 -0
  51. package/dist/commands/dependencyCommand.d.ts.map +1 -0
  52. package/dist/commands/dependencyCommand.js +27 -0
  53. package/dist/commands/dependencyCommand.js.map +1 -0
  54. package/dist/commands/index.d.ts.map +1 -1
  55. package/dist/commands/index.js +13 -485
  56. package/dist/commands/index.js.map +1 -1
  57. package/dist/commands/init.d.ts.map +1 -1
  58. package/dist/commands/init.js +3 -2
  59. package/dist/commands/init.js.map +1 -1
  60. package/dist/commands/plan.d.ts +11 -0
  61. package/dist/commands/plan.d.ts.map +1 -0
  62. package/dist/commands/plan.js +370 -0
  63. package/dist/commands/plan.js.map +1 -0
  64. package/dist/commands/postmortem.d.ts +2 -0
  65. package/dist/commands/postmortem.d.ts.map +1 -0
  66. package/dist/commands/postmortem.js +114 -0
  67. package/dist/commands/postmortem.js.map +1 -0
  68. package/dist/commands/report.d.ts +2 -0
  69. package/dist/commands/report.d.ts.map +1 -0
  70. package/dist/commands/report.js +221 -0
  71. package/dist/commands/report.js.map +1 -0
  72. package/dist/commands/status.d.ts +2 -0
  73. package/dist/commands/status.d.ts.map +1 -0
  74. package/dist/commands/status.js +60 -0
  75. package/dist/commands/status.js.map +1 -0
  76. package/dist/index.js +214 -34
  77. package/dist/index.js.map +1 -1
  78. package/dist/types/index.d.ts +11 -6
  79. package/dist/types/index.d.ts.map +1 -1
  80. package/dist/utils/errors.d.ts.map +1 -1
  81. package/dist/utils/errors.js +60 -6
  82. package/dist/utils/errors.js.map +1 -1
  83. package/dist/utils/formatter.js +11 -1
  84. package/dist/utils/formatter.js.map +1 -1
  85. package/dist/utils/git.d.ts +19 -0
  86. package/dist/utils/git.d.ts.map +1 -0
  87. package/dist/utils/git.js +41 -0
  88. package/dist/utils/git.js.map +1 -0
  89. package/dist/utils/httpHeaders.d.ts +3 -0
  90. package/dist/utils/httpHeaders.d.ts.map +1 -0
  91. package/dist/utils/httpHeaders.js +11 -0
  92. package/dist/utils/httpHeaders.js.map +1 -0
  93. package/dist/utils/initOutput.d.ts +3 -0
  94. package/dist/utils/initOutput.d.ts.map +1 -0
  95. package/dist/utils/initOutput.js +34 -0
  96. package/dist/utils/initOutput.js.map +1 -0
  97. package/dist/utils/legacyCompat.d.ts +3 -0
  98. package/dist/utils/legacyCompat.d.ts.map +1 -0
  99. package/dist/utils/legacyCompat.js +20 -0
  100. package/dist/utils/legacyCompat.js.map +1 -0
  101. package/dist/utils/outputPolicy.d.ts +12 -0
  102. package/dist/utils/outputPolicy.d.ts.map +1 -0
  103. package/dist/utils/outputPolicy.js +132 -0
  104. package/dist/utils/outputPolicy.js.map +1 -0
  105. package/dist/utils/parsers.d.ts +7 -0
  106. package/dist/utils/parsers.d.ts.map +1 -0
  107. package/dist/utils/parsers.js +52 -0
  108. package/dist/utils/parsers.js.map +1 -0
  109. package/dist/utils/planFormat.d.ts +17 -0
  110. package/dist/utils/planFormat.d.ts.map +1 -0
  111. package/dist/utils/planFormat.js +80 -0
  112. package/dist/utils/planFormat.js.map +1 -0
  113. package/dist/utils/spinner.d.ts +6 -0
  114. package/dist/utils/spinner.d.ts.map +1 -0
  115. package/dist/utils/spinner.js +34 -0
  116. package/dist/utils/spinner.js.map +1 -0
  117. package/package.json +8 -3
  118. package/DEVELOPMENT.md +0 -234
@@ -0,0 +1,418 @@
1
+ ---
2
+ trigger:
3
+ description:
4
+ agentInstruction: |
5
+ 본 문서는 한국어로 작성해주세요.
6
+ ---
7
+ # API ↔ CLI 워크플로우
8
+
9
+ 이 문서는 AgentTeams CLI(`agentteams`)가 API 서버와 어떻게 통신하는지, 그리고 그 결과로 로컬 워크스페이스에 어떤 파일이 생성/업데이트되는지를 설명합니다.
10
+
11
+ ## 범위(Scope)
12
+
13
+ - CLI 인증/설정(config) 로딩 규칙
14
+ - 요청/응답 컨벤션(엔벨로프, 페이지네이션)
15
+ - 엔드투엔드 흐름(Plan → Comments/Status → Completion Report → Postmortem)
16
+ - CLI가 생성하는 로컬 파일 위치 및 역할
17
+ - (추가) 공통 출력 UX(`--output-file`, `--verbose`)와 단축 워크플로우(`plan start/finish`)
18
+
19
+ > 최종 소스 오브 트루스는 코드입니다. 이 문서는 운영/사용 가이드입니다.
20
+
21
+ ---
22
+
23
+ ## 구성 요소와 책임
24
+
25
+ - CLI(`/cli`)
26
+ - 커맨드 파싱: `commander`
27
+ - HTTP 호출: `axios`
28
+ - 설정 로딩: `.agentteams/config.json`, `~/.agentteams/config.json`, `AGENTTEAMS_*`
29
+ - 로컬 아티팩트 생성: 플랜 스냅샷(runbook), 컨벤션/가이드 다운로드 파일
30
+ - (추가) 공통 출력 UX: `--output-file`, `--verbose`
31
+ - (추가) 단축 워크플로우: `agentteams plan start|finish`
32
+ - API(`/api`)
33
+ - REST API: Fastify
34
+ - 인증/권한: 주로 `X-API-Key` 기반
35
+ - DB 접근: Prisma
36
+ - Swagger UI: `/docs`
37
+
38
+ ---
39
+
40
+ ## 인증(Authentication)과 설정(Config) 로딩
41
+
42
+ ### `agentteams init` (최초 설정)
43
+
44
+ 개요 흐름:
45
+
46
+ 1. 로컬 OAuth 콜백 서버를 실행합니다.
47
+ 2. 브라우저에서 authorize 페이지를 엽니다(SSH 환경에서는 URL을 출력).
48
+ 3. `apiUrl`, `apiKey`, `teamId`, `projectId`, `agentName`을 수신하고 로컬에 저장합니다.
49
+ 4. 컨벤션 템플릿을 `.agentteams/convention.md`로 저장합니다.
50
+ 5. 컨벤션/플랫폼 가이드를 `.agentteams/*`로 다운로드합니다.
51
+
52
+ ```mermaid
53
+ sequenceDiagram
54
+ participant U as "User"
55
+ participant CLI as "CLI (agentteams)"
56
+ participant WEB as "Web (Authorize)"
57
+ participant API as "API"
58
+ participant FS as "Local FS"
59
+
60
+ U->>CLI: agentteams init
61
+ CLI->>CLI: Start local OAuth callback server
62
+ CLI->>WEB: Open/print authorize URL
63
+ WEB->>CLI: OAuth callback (auth result)
64
+ CLI->>FS: Write .agentteams/config.json
65
+ CLI->>API: Fetch convention template
66
+ API-->>CLI: template(content)
67
+ CLI->>FS: Write .agentteams/convention.md
68
+ CLI->>API: Download conventions
69
+ API-->>CLI: conventions (+ platform guides)
70
+ CLI->>FS: Write .agentteams/<category>/*.md and manifest
71
+ ```
72
+
73
+ ### 설정 우선순위(높음 → 낮음)
74
+
75
+ 1. CLI option overrides (some commands only)
76
+ 2. Env vars `AGENTTEAMS_*`
77
+ 3. Project config: nearest `.agentteams/config.json` found by walking up from `cwd`
78
+ 4. Global config: `~/.agentteams/config.json`
79
+
80
+ 지원 환경변수:
81
+
82
+ - `AGENTTEAMS_API_KEY`
83
+ - `AGENTTEAMS_API_URL`
84
+ - `AGENTTEAMS_TEAM_ID`
85
+ - `AGENTTEAMS_PROJECT_ID`
86
+ - `AGENTTEAMS_AGENT_NAME`
87
+
88
+ ### 기본 요청 헤더
89
+
90
+ - `X-API-Key: key_...`
91
+ - `Content-Type: application/json`
92
+
93
+ 예외:
94
+
95
+ - `DELETE` 요청은 서버의 빈 JSON body 검증 충돌을 피하기 위해 `Content-Type`을 포함하지 않습니다.
96
+
97
+ API는 다음 중 하나를 허용합니다:
98
+
99
+ - `Authorization: Bearer <token>`
100
+ - `X-API-Key: key_...` (API keys must have the `key_` prefix)
101
+
102
+ ---
103
+
104
+ ## 공통 API 컨벤션
105
+
106
+ ### Base URL
107
+
108
+ The CLI calls `{apiUrl}/api/...`.
109
+
110
+ Example: `GET {apiUrl}/api/projects/{projectId}/plans`
111
+
112
+ ### Response envelopes
113
+
114
+ - Single: `{ data: {...} }`
115
+ - List: `{ data: [...], meta: {...} }`
116
+ - Error: `{ statusCode, error, message, errorCode? }`
117
+
118
+ 에러 응답의 `errorCode`는 선택 필드이며, CLI는 `errorCode`가 있을 때 이를 우선 사용해 에러를 분기합니다.
119
+ `errorCode`가 없는 구버전/부분 적용 응답에서는 기존 `statusCode + message` 기반 동작으로 fallback합니다.
120
+
121
+ ### Pagination
122
+
123
+ Many list endpoints accept `page` and `pageSize`.
124
+
125
+ ---
126
+
127
+ ## 공통 출력 UX(추가)
128
+
129
+ ### `--output-file <path>` / `--verbose`
130
+
131
+ 대상(주요 커맨드 전반): `init`, `sync`, `status`, `plan`, `comment`, `report`, `postmortem`, `dependency`, `agent-config`, `config`, `convention`
132
+
133
+ - `--output-file <path>`
134
+ - “원래 stdout에 출력될 전체 결과”를 지정한 파일에 그대로 저장합니다.
135
+ - stdout에는 기본적으로 **요약 1~3줄**만 출력합니다.
136
+ - 상대 경로는 `cwd` 기준이며 내부에서 `path.resolve`로 절대경로로 변환합니다.
137
+ - 부모 디렉토리가 없으면 생성합니다.
138
+ - `--verbose`
139
+ - `--output-file`과 함께 사용하면 stdout에도 전체 결과를 출력합니다(파일 저장은 유지).
140
+
141
+ 요약 출력은 기본 영어 메시지로 출력됩니다(자동화/로그 파싱 관점에서 고정된 문구를 선호).
142
+
143
+ text 출력에서 객체 필드는 핵심 식별 필드(`id/title/status/priority/updatedAt/createdAt`)를 우선 표시한 뒤 나머지를 정렬해 출력합니다.
144
+
145
+ ---
146
+
147
+ ## 커맨드별 워크플로우
148
+
149
+ ### Plan
150
+
151
+ - Create: `POST /api/projects/:projectId/plans`
152
+ - Plans are always created as `DRAFT` (server-enforced). Even if a client sends `status`, it will be ignored on creation.
153
+ - Use `--content` or `--file` for the body.
154
+ - `--template refactor-minimal`로 최소 리팩터링 체크리스트 본문을 자동 채울 수 있습니다(내용이 비어 있을 때).
155
+ - 멀티라인을 `--content`로 전달해야 하는 경우, `--interpret-escapes`를 사용하면 `\\n` 시퀀스를 실제 줄바꿈으로 변환합니다(기본 OFF).
156
+ - Get alias: `plan show --id <id>`는 `plan get --id <id>`와 동일 동작입니다.
157
+ - Include dependencies: `plan get|show --id <id> --include-deps`
158
+ - 내부적으로 `GET /plans/:id` + `GET /plans/:id/dependencies`를 호출해 응답을 합성합니다.
159
+ - `--format json`: `data.dependencies = { blocking: [...], dependents: [...] }`
160
+ - `--format text`: Plan 필드 출력 뒤 `## Dependencies` 섹션을 추가합니다.
161
+ - Download snapshot: `GET /api/projects/:projectId/plans/:id`
162
+ - Saved to `.agentteams/active-plan/{safe-title}.md` with frontmatter.
163
+ - (추가) 단축 커맨드
164
+ - `agentteams plan start --id <planId>`
165
+ - 내부적으로 `GET /plans/:id` → `PUT /plans/:id(status=IN_PROGRESS)` → `POST /agent-statuses(status=IN_PROGRESS)`를 순서대로 호출합니다.
166
+ - 플랜이 `DRAFT`인 경우, UX 개선을 위해 `DRAFT → PENDING → IN_PROGRESS`로 자동 승격합니다.
167
+ - `agentteams plan finish --id <planId>`
168
+ - 내부적으로 `GET /plans/:id` → `PUT /plans/:id(status=DONE)` → `POST /agent-statuses(status=DONE)`를 순서대로 호출합니다.
169
+
170
+ ### Comment (plan-scoped)
171
+
172
+ - List: `GET /api/projects/:projectId/plans/:planId/comments`
173
+ - Create: `POST /api/projects/:projectId/plans/:planId/comments`
174
+ - Get/Update/Delete by ID: `GET/PUT/DELETE /api/projects/:projectId/comments/:id`
175
+
176
+ Types: `RISK`, `MODIFICATION`, `GENERAL`
177
+
178
+ ### Status
179
+
180
+ - Report: `POST /api/projects/:projectId/agent-statuses`
181
+ - List/Get/Update/Delete: `GET/PUT/DELETE /api/projects/:projectId/agent-statuses...`
182
+
183
+ ### Convention
184
+
185
+ Convention commands are tightly coupled to `.agentteams/`.
186
+
187
+ - Sync download: `agentteams sync` (internally runs `convention download`)
188
+ - Writes conventions and platform guides under `.agentteams/`
189
+ - Updates `.agentteams/conventions.manifest.json`
190
+ - Create/Update/Delete: `agentteams convention create|update|delete`
191
+ - Files are expected under `.agentteams/<category>/...`
192
+ - `update/delete` default to a non-destructive preview; use `--apply` to execute.
193
+
194
+ ### Completion report / Postmortem
195
+
196
+ - Completion reports: `.../completion-reports`
197
+ - Postmortems: `.../post-mortems`
198
+
199
+ CLI supports `--api-url`, `--api-key`, `--team-id`, `--project-id`, `--agent-name` overrides for environments without local config.
200
+
201
+ #### (추가) `report create`의 템플릿/Deprecated 옵션
202
+
203
+ - `--template minimal`
204
+ - `--content`가 없을 때 최소 템플릿을 자동으로 채워서 생성할 수 있습니다.
205
+ - Deprecated(호환 유지, 경고 출력)
206
+ - `--summary`: `--title`의 별칭(Deprecated)
207
+ - `--details`: `--content`가 없을 때 Details 섹션으로 삽입(Deprecated)
208
+
209
+ ---
210
+
211
+ ## CLI가 생성/관리하는 로컬 파일
212
+
213
+ - Project config: `.agentteams/config.json`
214
+ - Global config: `~/.agentteams/config.json`
215
+ - Convention template: `.agentteams/convention.md`
216
+ - Download manifest: `.agentteams/conventions.manifest.json`
217
+ - Plan snapshots: `.agentteams/active-plan/*.md`
218
+ - Output capture: `--output-file <path>`로 지정한 임의 경로(사용자 지정)
219
+
220
+ ---
221
+
222
+ ## 엔드투엔드: plan 생성 → 완료 보고서
223
+
224
+ ```mermaid
225
+ sequenceDiagram
226
+ participant U as "User/Agent"
227
+ participant CLI as "CLI (agentteams)"
228
+ participant API as "API"
229
+ participant FS as "Local FS"
230
+
231
+ U->>CLI: plan create (title, content, priority)
232
+ CLI->>API: POST /api/projects/:projectId/plans
233
+ API-->>CLI: { data: plan(status=DRAFT) }
234
+
235
+ U->>CLI: plan update --status IN_PROGRESS
236
+ CLI->>API: PUT /api/projects/:projectId/plans/:id
237
+ API-->>CLI: { data: plan }
238
+
239
+ U->>CLI: plan download --id {planId}
240
+ CLI->>API: GET /api/projects/:projectId/plans/:id
241
+ API-->>CLI: { data: plan(contentMarkdown) }
242
+ CLI->>FS: Write .agentteams/active-plan/{safe-title}.md
243
+
244
+ U->>CLI: comment create --type RISK|MODIFICATION|GENERAL
245
+ CLI->>API: POST /api/projects/:projectId/plans/:planId/comments
246
+ API-->>CLI: { data: comment }
247
+
248
+ U->>CLI: status report --status IN_PROGRESS|DONE|BLOCKED
249
+ CLI->>API: POST /api/projects/:projectId/agent-statuses
250
+ API-->>CLI: { data: status }
251
+
252
+ U->>CLI: plan update --status DONE
253
+ CLI->>API: PUT /api/projects/:projectId/plans/:id
254
+ API-->>CLI: { data: plan }
255
+
256
+ U->>CLI: report create --plan-id {planId}
257
+ CLI->>API: POST /api/projects/:projectId/completion-reports
258
+ API-->>CLI: { data: report }
259
+ ```
260
+
261
+ ## 엔드투엔드(추가): plan start / plan finish
262
+
263
+ ```mermaid
264
+ sequenceDiagram
265
+ participant U as "User/Agent"
266
+ participant CLI as "CLI (agentteams)"
267
+ participant API as "API"
268
+
269
+ U->>CLI: plan start --id {planId}
270
+ CLI->>API: GET /api/projects/:projectId/plans/:id
271
+ API-->>CLI: { data: plan(title, ...) }
272
+ CLI->>API: PUT /api/projects/:projectId/plans/:id (status=PENDING) %% only when current status is DRAFT
273
+ API-->>CLI: { data: plan }
274
+ CLI->>API: PUT /api/projects/:projectId/plans/:id (status=IN_PROGRESS)
275
+ API-->>CLI: { data: plan }
276
+ CLI->>API: POST /api/projects/:projectId/agent-statuses (IN_PROGRESS)
277
+ API-->>CLI: { data: status }
278
+
279
+ U->>CLI: plan finish --id {planId}
280
+ CLI->>API: GET /api/projects/:projectId/plans/:id
281
+ API-->>CLI: { data: plan(title, ...) }
282
+ CLI->>API: PUT /api/projects/:projectId/plans/:id (status=DONE)
283
+ API-->>CLI: { data: plan }
284
+ CLI->>API: POST /api/projects/:projectId/agent-statuses (DONE)
285
+ API-->>CLI: { data: status }
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Plan status model and constraints
291
+
292
+ ### Status values
293
+
294
+ - `DRAFT`
295
+ - `PENDING`
296
+ - `ASSIGNED`
297
+ - `IN_PROGRESS`
298
+ - `BLOCKED`
299
+ - `DONE` (terminal)
300
+ - `CANCELLED` (terminal)
301
+
302
+ ### Allowed status transitions (server-validated)
303
+
304
+ ```mermaid
305
+ stateDiagram-v2
306
+ [*] --> DRAFT
307
+
308
+ DRAFT --> PENDING
309
+
310
+ PENDING --> ASSIGNED
311
+ PENDING --> IN_PROGRESS
312
+ PENDING --> DONE
313
+ PENDING --> CANCELLED
314
+
315
+ ASSIGNED --> PENDING
316
+ ASSIGNED --> IN_PROGRESS
317
+ ASSIGNED --> DONE
318
+ ASSIGNED --> CANCELLED
319
+
320
+ IN_PROGRESS --> DONE
321
+ IN_PROGRESS --> BLOCKED
322
+ IN_PROGRESS --> CANCELLED
323
+
324
+ BLOCKED --> IN_PROGRESS
325
+ BLOCKED --> CANCELLED
326
+
327
+ DONE --> [*]
328
+ CANCELLED --> [*]
329
+ ```
330
+
331
+ If you attempt a disallowed transition, the API returns `400` with `허용되지 않은 상태 전이입니다`.
332
+
333
+ ### `plan assign` behavior
334
+
335
+ `agentteams plan assign` sets the plan to `ASSIGNED` as long as the plan is not terminal.
336
+
337
+ - Not allowed when current status is `DONE` or `CANCELLED`
338
+ - Otherwise allowed and results in `ASSIGNED`
339
+
340
+ ### Content edit/delete constraints (status-based)
341
+
342
+ ```mermaid
343
+ flowchart TD
344
+ A["plan update (title/content/priority change)"] --> B{Current status is<br/>DRAFT or PENDING?}
345
+ B -- "No" --> E["400: Content edits allowed only in DRAFT or PENDING"]
346
+ B -- "Yes" --> F["Allowed"]
347
+
348
+ C["plan delete"] --> D{Current status is<br/>PENDING, DRAFT, or CANCELLED?}
349
+ D -- "No" --> G["400: Delete allowed only in PENDING, DRAFT, or CANCELLED"]
350
+ D -- "Yes" --> H["204 No Content"]
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Completion report writing rules (practical)
356
+
357
+ - Prefer the platform template if available: `.agentteams/platform/guides/completion-report-guide.md`
358
+ - Include reproducible verification evidence (commands + outcomes).
359
+ - Keep outcomes short: write `pass/fail + 1–3 lines of summary`; do not paste long raw logs into the report body.
360
+
361
+ ---
362
+
363
+ ## Troubleshooting
364
+
365
+ - `401 Unauthorized`
366
+ - Check `AGENTTEAMS_API_KEY` / `.agentteams/config.json` `apiKey`.
367
+ - API keys must have the `key_` prefix.
368
+ - `403 Forbidden`
369
+ - You likely lack project/role permissions (especially for convention writes).
370
+ - `400 Bad Request`
371
+ - 플랜 상태 전이처럼 서버가 검증하는 제약을 위반했을 수 있습니다.
372
+ - 예: 허용되지 않은 상태 전이 시 `400` + `허용되지 않은 상태 전이입니다`
373
+ - Connection issues (`ECONNREFUSED`, `ENOTFOUND`)
374
+ - Check `AGENTTEAMS_API_URL` / config `apiUrl`, and ensure the server is reachable.
375
+
376
+ ---
377
+
378
+ ## 최소 사용 예시
379
+
380
+ ```bash
381
+ # First-time setup
382
+ agentteams init
383
+
384
+ # Create plan (always DRAFT)
385
+ agentteams plan create --title "My plan" --content "# TODO\n- ..." --priority MEDIUM
386
+
387
+ # Download local snapshot/runbook
388
+ agentteams plan download --id <planId>
389
+
390
+ # Add a risk comment
391
+ agentteams comment create --plan-id <planId> --type RISK --content "Potential failure mode..."
392
+
393
+ # Report agent status
394
+ agentteams status report --status IN_PROGRESS --task "Working on plan" --issues "" --remaining ""
395
+
396
+ # Move plan forward (manual)
397
+ agentteams plan update --id <planId> --status IN_PROGRESS
398
+ agentteams plan update --id <planId> --status DONE
399
+
400
+ # Start/finish shortcuts (auto status report)
401
+ agentteams plan start --id <planId>
402
+ agentteams plan finish --id <planId>
403
+
404
+ # Create completion report (recommended flags)
405
+ agentteams report create --plan-id <planId> --title "Done" --template minimal
406
+ ```
407
+
408
+ Environment-only mode (no config file):
409
+
410
+ ```bash
411
+ export AGENTTEAMS_API_URL="https://..."
412
+ export AGENTTEAMS_API_KEY="key_..."
413
+ export AGENTTEAMS_TEAM_ID="..."
414
+ export AGENTTEAMS_PROJECT_ID="..."
415
+ export AGENTTEAMS_AGENT_NAME="..."
416
+
417
+ agentteams plan list --page 1 --page-size 20
418
+ ```
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.