arclith-cli 0.16.0__tar.gz → 0.18.0__tar.gz

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 (52) hide show
  1. arclith_cli-0.18.0/PKG-INFO +600 -0
  2. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/README.md +28 -0
  3. arclith_cli-0.18.0/arclith_cli/__init__.py +1 -0
  4. arclith_cli-0.18.0/arclith_cli/adapter_config.py +272 -0
  5. arclith_cli-0.18.0/arclith_cli/adapter_generator.py +340 -0
  6. arclith_cli-0.18.0/arclith_cli/adapter_parameters.py +332 -0
  7. arclith_cli-0.18.0/arclith_cli/adapter_rendering.py +205 -0
  8. arclith_cli-0.18.0/arclith_cli/adapter_selection.py +240 -0
  9. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/adapter_templates.py +1 -1
  10. arclith_cli-0.18.0/arclith_cli/add_adapter.py +225 -0
  11. arclith_cli-0.18.0/arclith_cli/capabilities.py +117 -0
  12. arclith_cli-0.18.0/arclith_cli/capability_models.py +180 -0
  13. arclith_cli-0.18.0/arclith_cli/catalogs/__init__.py +1 -0
  14. arclith_cli-0.18.0/arclith_cli/catalogs/ai.py +474 -0
  15. arclith_cli-0.18.0/arclith_cli/catalogs/core.py +300 -0
  16. arclith_cli-0.18.0/arclith_cli/catalogs/observability.py +370 -0
  17. arclith_cli-0.18.0/arclith_cli/catalogs/persistence.py +446 -0
  18. arclith_cli-0.18.0/arclith_cli/catalogs/security.py +148 -0
  19. arclith_cli-0.18.0/arclith_cli/catalogs/transports.py +419 -0
  20. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/init_project.py +10 -3
  21. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/main.py +159 -112
  22. arclith_cli-0.18.0/arclith_cli/new_project.py +133 -0
  23. arclith_cli-0.18.0/arclith_cli/recipe.py +575 -0
  24. arclith_cli-0.18.0/arclith_cli/recipe_cli.py +136 -0
  25. arclith_cli-0.18.0/arclith_cli/recipe_models.py +295 -0
  26. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/runtime_templates.py +7 -0
  27. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/scaffold.py +23 -8
  28. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/pyproject.toml +3 -2
  29. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/e2e_manual.sh +1 -1
  30. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_add_adapter.py +7 -7
  31. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_core_scaffold.py +3 -1
  32. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_e2e_scaffold.py +8 -0
  33. arclith_cli-0.18.0/tests/test_embedding_capability.py +161 -0
  34. arclith_cli-0.18.0/tests/test_recipe.py +536 -0
  35. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/uv.lock +9 -3
  36. arclith_cli-0.16.0/PKG-INFO +0 -192
  37. arclith_cli-0.16.0/arclith_cli/__init__.py +0 -1
  38. arclith_cli-0.16.0/arclith_cli/add_adapter.py +0 -1396
  39. arclith_cli-0.16.0/arclith_cli/capabilities.py +0 -2190
  40. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/.gitignore +0 -0
  41. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/LICENSE +0 -0
  42. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/Makefile +0 -0
  43. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/core_scaffold.py +0 -0
  44. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/entity_scanner.py +0 -0
  45. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/export_config.py +0 -0
  46. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/project_paths.py +0 -0
  47. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/rename.py +0 -0
  48. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/arclith_cli/updater.py +0 -0
  49. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/__init__.py +0 -0
  50. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_capabilities.py +0 -0
  51. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_project_paths.py +0 -0
  52. {arclith_cli-0.16.0 → arclith_cli-0.18.0}/tests/test_rename.py +0 -0
@@ -0,0 +1,600 @@
1
+ Metadata-Version: 2.5
2
+ Name: arclith-cli
3
+ Version: 0.18.0
4
+ Summary: CLI scaffolding tool for arclith — hexagonal architecture framework
5
+ Author-email: Killian KOPP <killiankopp@gmail.com>
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship made available under
41
+ the License, as indicated by a copyright notice that is included in
42
+ or attached to the work (an example is provided in the Appendix below).
43
+
44
+ "Derivative Works" shall mean any work, whether in Source or Object
45
+ form, that is based on (or derived from) the Work and for which the
46
+ editorial revisions, annotations, elaborations, or other modifications
47
+ represent, as a whole, an original work of authorship. For the purposes
48
+ of this License, Derivative Works shall not include works that remain
49
+ separable from, or merely link (or bind by name) to the interfaces of,
50
+ the Work and its Derivative Works thereof.
51
+
52
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
53
+ in the Work by the copyright owner or by an individual or Legal Entity
54
+ authorized to submit on behalf of the copyright owner. For the purposes
55
+ of this definition, "submitted" means any form of electronic, verbal,
56
+ or written communication sent to the Licensor or its representatives,
57
+ including but not limited to communication on electronic mailing lists,
58
+ source code control systems, and issue tracking systems that are managed
59
+ by, or on behalf of, the Licensor for the purpose of developing and
60
+ refining the Work, but excluding communication that is conspicuously
61
+ marked or designated in writing by the copyright owner as "Not a
62
+ Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
65
+ whom a Contribution has been received by the Licensor and included
66
+ within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent contributions
81
+ Licensable by such Contributor that are necessarily infringed by
82
+ their Contribution(s) alone or by the combination of their
83
+ Contribution(s) with the Work to which such Contribution(s) was
84
+ submitted. If You institute patent litigation against any entity
85
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
86
+ the Work or any Contribution embodied within the Work constitutes
87
+ direct or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate as
89
+ of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or Derivative
97
+ Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, You must include a readable copy of the
110
+ attribution notices contained within such NOTICE file, in
111
+ at least one of the following places: within a NOTICE text
112
+ file distributed as part of the Derivative Works; within
113
+ the Source form or documentation, if provided along with the
114
+ Derivative Works; or, within a display generated by the
115
+ Derivative Works, if and wherever such third-party notices
116
+ normally appear. The contents of the NOTICE file are for
117
+ informational purposes only and do not modify the License.
118
+ You may add Your own attribution notices within Derivative
119
+ Works that You distribute, alongside or in addition to the
120
+ NOTICE text from the Work, provided that such additional
121
+ attribution notices cannot be construed as modifying the License.
122
+
123
+ You may add Your own license statement for Your modifications and
124
+ may provide additional grant of rights to use, copy, modify, merge,
125
+ publish, distribute, sublicense, and/or sell copies of the Work.
126
+
127
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
128
+ any Contribution intentionally submitted for inclusion in the Work
129
+ by You to the Licensor shall be under the terms and conditions of
130
+ this License, without any additional terms or conditions.
131
+ Notwithstanding the above, nothing herein shall supersede or modify
132
+ the terms of any separate license agreement you may have executed
133
+ with Licensor regarding such Contributions.
134
+
135
+ 6. Trademarks. This License does not grant permission to use the trade
136
+ names, trademarks, service marks, or product names of the Licensor,
137
+ except as required for reasonable and customary use in describing the
138
+ origin of the Work and reproducing the content of the NOTICE file.
139
+
140
+ 7. Disclaimer of Warranty. Unless required by applicable law or
141
+ agreed to in writing, Licensor provides the Work (and each
142
+ Contributor provides its Contributions) on an "AS IS" BASIS,
143
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
144
+ implied, including, without limitation, any warranties or conditions
145
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
146
+ PARTICULAR PURPOSE. You are solely responsible for determining the
147
+ appropriateness of using or reproducing the Work and assume any
148
+ risks associated with Your exercise of permissions under this License.
149
+
150
+ 8. Limitation of Liability. In no event and under no legal theory,
151
+ whether in tort (including negligence), contract, or otherwise,
152
+ unless required by applicable law (such as deliberate and grossly
153
+ negligent acts) or agreed to in writing, shall any Contributor be
154
+ liable to You for damages, including any direct, indirect, special,
155
+ incidental, or exemplary damages of any character arising as a
156
+ result of this License or out of the use or inability to use the
157
+ Work (including but not limited to damages for loss of goodwill,
158
+ work stoppage, computer failure or malfunction, or all other
159
+ commercial damages or losses), even if such Contributor has been
160
+ advised of the possibility of such damages.
161
+
162
+ 9. Accepting Warranty or Liability. While redistributing the Work or
163
+ Derivative Works thereof, You may choose to offer, and charge a fee
164
+ for, acceptance of support, warranty, indemnity, or other liability
165
+ obligations and/or rights consistent with this License. However, in
166
+ accepting such obligations, You may offer only conditions that
167
+ You alone are responsible for, and not on behalf of any other
168
+ Contributor.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ Copyright 2026 Killian KOPP
173
+
174
+ Licensed under the Apache License, Version 2.0 (the "License");
175
+ you may not use this file except in compliance with the License.
176
+ You may obtain a copy of the License at
177
+
178
+ http://www.apache.org/licenses/LICENSE-2.0
179
+
180
+ Unless required by applicable law or agreed to in writing, software
181
+ distributed under the License is distributed on an "AS IS" BASIS,
182
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
+ See the License for the specific language governing permissions and
184
+ limitations under the License.
185
+
186
+ License-File: LICENSE
187
+ Keywords: arclith,cli,ddd,hexagonal-architecture,scaffold
188
+ Requires-Python: >=3.13
189
+ Requires-Dist: arclith>=0.21.0
190
+ Requires-Dist: httpx>=0.27.0
191
+ Requires-Dist: rich>=13.0.0
192
+ Requires-Dist: typer>=0.15.0
193
+ Description-Content-Type: text/markdown
194
+
195
+ # arclith-cli
196
+
197
+ `arclith-cli` génère instantanément un projet Python en architecture hexagonale prêt à démarrer, en téléchargeant le template officiel `_sample` depuis GitHub et en remplaçant l'entité de démo `Ingredient` par le nom de votre choix. Tout type de projet peut être scaffoldé — service REST, agent IA, API MCP — avec les ports, le nom de projet et le backend de persistance configurés d'emblée.
198
+
199
+ ## Installation
200
+
201
+ ```bash
202
+ uv tool install "git+https://github.com/karned-rekipe/arclith.git#subdirectory=cli"
203
+ ```
204
+
205
+ ## Commandes
206
+
207
+ ### `init` — Initialiser un projet minimal
208
+
209
+ Crée un projet Arclith vide de métier, avec le layout canonique `src/<package>/...`, une
210
+ configuration minimale, un `main.py` prêt à recevoir les adapters et le runtime Docker standard
211
+ (`Dockerfile`, `.dockerignore`, `arclith-run`).
212
+
213
+ ```bash
214
+ # Mode interactif
215
+ arclith-cli init
216
+
217
+ # Mode direct
218
+ arclith-cli init todo-list-service
219
+ arclith-cli init todo-list-service --dir ~/projects
220
+ ```
221
+
222
+ Cette commande ne crée aucune entité, aucun CRUD et aucun endpoint métier. Elle sert quand on veut
223
+ construire le projet étape par étape avec `add-entity`, `add-usecase`, puis `add-adapter`.
224
+
225
+ ---
226
+
227
+ ### `new` — Créer un projet
228
+
229
+ Scaffold un nouveau projet arclith depuis le template officiel `_sample`.
230
+
231
+ ```bash
232
+ # Mode interactif — l'outil pose les questions
233
+ arclith-cli new
234
+
235
+ # Mode direct
236
+ arclith-cli new Recipe my-recipe-service
237
+ arclith-cli new RecipeStep meal-planner --port 8400
238
+ arclith-cli new MealPlan meal-plan-service --dir ~/projects --port 8500
239
+ ```
240
+
241
+ | Option | Défaut | Description |
242
+ |--------|--------|-------------|
243
+ | `--port` / `-p` | `8000` | Port REST (MCP = port+1) |
244
+ | `--dir` / `-d` | `.` | Répertoire parent |
245
+ | `--ref` | `main` | Branche/tag du template |
246
+
247
+ Le projet généré utilise un layout `src/<package>/...` pour le code applicatif et un dossier
248
+ `config/` structuré par adapter (voir section [Configuration](#configuration)). Le Dockerfile du
249
+ template est régénéré côté CLI pour appliquer le contrat `runtime/docker-image` courant.
250
+
251
+ ---
252
+
253
+ ### `add-entity` — Ajouter une entité métier
254
+
255
+ Crée uniquement le fichier minimal d'une entité dans `src/<package>/domain/models/`.
256
+
257
+ ```bash
258
+ cd my-recipe-service
259
+ arclith-cli add-entity ShoppingItem
260
+ ```
261
+
262
+ Fichier généré :
263
+
264
+ ```text
265
+ src/<package>/domain/models/shopping_item.py
266
+ ```
267
+
268
+ La commande ne génère aucun CRUD, aucun port repository, aucun adapter et aucun endpoint. Elle pose seulement le point d'ancrage du modèle métier ; le développeur complète ensuite les champs et invariants de l'entité.
269
+
270
+ ---
271
+
272
+ ### `add-usecase` — Ajouter un cas d'usage
273
+
274
+ Crée le port inbound minimal dans `src/<package>/domain/ports/inbound/`, puis le fichier minimal du
275
+ cas d'usage dans `src/<package>/application/use_cases/`.
276
+
277
+ ```bash
278
+ cd my-recipe-service
279
+ arclith-cli add-usecase PlanShoppingList
280
+ arclith-cli add-usecase find-by-name
281
+ ```
282
+
283
+ Fichier généré :
284
+
285
+ ```text
286
+ src/<package>/domain/ports/inbound/plan_shopping_list.py
287
+ src/<package>/application/use_cases/plan_shopping_list.py
288
+ ```
289
+
290
+ Le nom peut être fourni en PascalCase, snake_case ou kebab-case. Le suffixe `UseCase` est normalisé : `PlanShoppingListUseCase` et `plan-shopping-list-use-case` génèrent tous les deux `PlanShoppingListUseCase`.
291
+
292
+ Comme `add-entity`, cette commande ne câble pas FastAPI, FastMCP, LangGraph, un repository ou un service. Les adapters se branchent ensuite explicitement avec `add-adapter` et devraient dépendre du port inbound généré.
293
+
294
+ ---
295
+
296
+ ### `add-intent-interpreter` — Ajouter un interpréteur d'intention
297
+
298
+ Crée uniquement le fichier minimal d'un interpréteur d'intention dans
299
+ `src/<package>/application/intent_interpreters/`.
300
+
301
+ ```bash
302
+ cd my-recipe-service
303
+ arclith-cli add-intent-interpreter IngredientIntent
304
+ arclith-cli add-intent-interpreter command-router
305
+ ```
306
+
307
+ Fichier généré :
308
+
309
+ ```text
310
+ src/<package>/application/intent_interpreters/ingredient_intent.py
311
+ ```
312
+
313
+ L'interpréteur d'intention est le composant applicatif qui transforme une demande naturelle en
314
+ commande ou DTO structuré. Il ne remplace pas LangGraph : LangGraph orchestre les nœuds, tandis que
315
+ l'interpréteur porte la traduction d'intention. Le fichier généré reste volontairement vide de
316
+ logique métier.
317
+
318
+ ---
319
+
320
+ ### `add-adapter` — Ajouter un adapter
321
+
322
+ Wizard interactif à lancer **depuis la racine du projet cible**. Scaffold le code Python et/ou les fichiers de configuration pour un nouvel adapter. Par défaut, la capacité cible est `repository`.
323
+
324
+ ```bash
325
+ cd my-recipe-service
326
+ arclith-cli add-adapter
327
+ ```
328
+
329
+ Mode direct, utile pour CI, scripts de migration ou commandes reproductibles :
330
+
331
+ ```bash
332
+ arclith-cli add-adapter --adapter mongodb --entity Recipe --db-name my_recipe_service --param collection_name=recipes --yes
333
+ arclith-cli add-adapter --adapter duckdb --all-entities --path data/ --no-activate --yes
334
+ arclith-cli add-adapter --adapter mariadb --entity Recipe --param database=my_recipe_service --param user=app --yes
335
+ arclith-cli add-adapter --capability api --adapter fastapi --param port=8080 --yes
336
+ arclith-cli add-adapter --capability mcp --adapter fastmcp --param port=8081 --yes
337
+ arclith-cli add-adapter --capability llm --adapter lmstudio --param model_name=qwen/qwen3.5-9b --yes
338
+ arclith-cli add-adapter --capability agent --adapter langgraph --param graph_name=recipe_agent --param stream_mode=updates,custom --yes
339
+ arclith-cli add-adapter --capability observability --adapter langsmith
340
+ arclith-cli add-adapter --capability observability --adapter opentelemetry --param service_name=my_recipe_service --yes
341
+ arclith-cli add-adapter --capability runtime --adapter docker-image --yes
342
+ arclith-cli add-adapter --capability cache --adapter memory --yes
343
+ arclith-cli add-adapter --capability cache --adapter redis --param redis_url=redis://redis:6379 --yes
344
+ arclith-cli add-adapter --capability repository --adapter memory --entity Recipe --yes
345
+ ```
346
+
347
+ **Étapes du wizard :**
348
+
349
+ 1. **Type d'adapter** — selon la capacité : `memory` · `mongodb` · `duckdb` · `mariadb` · `fastapi` · `fastmcp` · `rabbitmq` · `docker-image` · `lmstudio` · `openai` · `anthropic` · `langgraph` · `langsmith` · `opentelemetry`
350
+ 2. **Entité(s) cible(s)** — détectées automatiquement pour les adapters entity-scoped ; ignorées pour les transports globaux, `cache/*`, `llm/*`, `agent/langgraph`, `runtime/docker-image` et les adapters d'observability
351
+ 3. **Paramètres** — questions spécifiques à l'adapter :
352
+ - `mongodb` → `db_name`, `collection_name`, `multitenant`
353
+ - `duckdb` → `path`
354
+ - `mariadb` → `host`, `port`, `database`, `user`, `driver`, `table_prefix`
355
+ (`url` et `password` sont mappés via `config/secrets.yaml`)
356
+ - `cache/memory` → `jwks_ttl`, `tenant_uri_ttl`
357
+ - `cache/redis` → `redis_url`, `jwks_ttl`, `tenant_uri_ttl`
358
+ - `fastapi` → `host`, `port`, `reload`
359
+ - `fastmcp` → `host`, `port`
360
+ - `lmstudio` → `model_name`, `base_url`, `api_key`
361
+ - `openai` → `model_name`, `base_url`, `OPENAI_API_KEY`
362
+ - `anthropic` → `model_name`, `ANTHROPIC_API_KEY`
363
+ - `langgraph` → `graph_name`, `stream_mode`
364
+ - `langsmith` → `tracing`, `project`, `endpoint`, `LANGSMITH_API_KEY`
365
+ - `opentelemetry` → `service_name`, `endpoint`, `traces_endpoint`, `metrics_endpoint`, `protocol`, `traces`, `metrics`, `instrument_fastapi`
366
+ - `command-bus/rabbitmq` → `url`, `exchange`, `exchange_type`, `queue`, `routing_key`, `prefetch`, `consumer_name`, `concurrency`, `publisher_confirms`, `durable`, `retry_enabled`, `retry_requeue`, `dead_letter_exchange`, `dead_letter_routing_key`
367
+ - `runtime/docker-image` → `uv_version`, `api_port`, `mcp_port`, `probe_port`, `agent_port`
368
+ - `repository/memory` → aucun paramètre
369
+ 4. **Activation** — met à jour `config/adapters/adapters.yaml` pour les capacités activables (`repository: <adapter>` ou `observability.enabled: [<adapter>, ...]`) ; `api/fastapi`, `mcp/fastmcp`, `cache/*`, `llm/*`, `agent/langgraph`, `command-bus/rabbitmq` et `runtime/docker-image` sont exposés par leurs fichiers dédiés
370
+ 5. **Récapitulatif** — liste des fichiers créés ou remplacés avant confirmation
371
+
372
+ | Option | Défaut | Description |
373
+ |--------|--------|-------------|
374
+ | `--capability` | `repository` | Capacité cible du catalogue standardisé (`repository`, `cache`, `api`, `mcp`, `http`, `command-bus`, `runtime`, `llm`, `agent`, `observability`) |
375
+ | `--adapter` / `-a` | interactif | Adapter du catalogue : `memory`, `mongodb`, `duckdb`, `mariadb`, `fastapi`, `fastmcp`, `idempotency`, `etag`, `cache-control`, `rabbitmq`, `docker-image`, `lmstudio`, `openai`, `anthropic`, `langgraph`, `langsmith`, `opentelemetry` |
376
+ | `--entity` / `-e` | auto si une seule entité | Entité cible, liste séparée par virgule acceptée |
377
+ | `--all-entities` | `false` | Génère l'adapter pour toutes les entités détectées |
378
+ | `--activate/--no-activate` | `--activate` | Met à jour `config/adapters/adapters.yaml` quand la capacité expose une clé d'activation |
379
+ | `--db-name` | nom du projet | Nom de base pour MongoDB |
380
+ | `--multitenant/--single-tenant` | `--single-tenant` | Mode MongoDB multitenant |
381
+ | `--path` | `data/` | Chemin DuckDB |
382
+ | `--param` | - | Paramètre adapter `key=value`, répétable pour les adapters du catalogue |
383
+ | `--yes` / `-y` | `false` | Skip la confirmation et utilise les valeurs fournies ou par défaut |
384
+
385
+ **Fichiers générés par entité :**
386
+
387
+ ```
388
+ config/adapters/outbound/<adapter>.yaml # config scopée si l'adapter en a besoin
389
+ src/<package>/adapters/outbound/<adapter>/__init__.py
390
+ src/<package>/adapters/outbound/<adapter>/repository.py # re-export
391
+ src/<package>/adapters/outbound/<adapter>/repositories/<entity>_repository.py # sous-classe à compléter
392
+ src/<package>/infrastructure/containers/<entity>_container.py # RepositoryRegistry régénéré
393
+ ```
394
+
395
+ > ⚠️ `src/<package>/infrastructure/containers/<entity>_container.py` est **régénéré intégralement** si le fichier existe déjà — un avertissement est affiché dans le récapitulatif.
396
+
397
+ **Runtime Docker :**
398
+
399
+ ```bash
400
+ arclith-cli add-adapter --capability runtime --adapter docker-image --yes
401
+ uv lock
402
+ docker build -t my-recipe-service:local .
403
+ docker run --rm -p 8000:8000 -p 9000:9000 my-recipe-service:local api
404
+ ```
405
+
406
+ L'adapter `runtime/docker-image` génère `Dockerfile`, `.dockerignore` et `arclith-run`. Une seule
407
+ image peut démarrer `api`, `mcp_http`, `mcp_sse`, `bus`, `agent` ou `all` par argument ou via
408
+ `ARCLITH_RUNTIME_MODE`. Les secrets restent hors build; `.env`, `secrets.yaml` et les clés privées
409
+ sont exclus du contexte Docker.
410
+
411
+ **LangGraph / LangSmith :**
412
+
413
+ ```bash
414
+ uv add "arclith[langgraph]"
415
+ arclith-cli add-adapter --capability llm --adapter lmstudio --param model_name=qwen/qwen3.5-9b --yes
416
+ arclith-cli add-adapter --capability agent --adapter langgraph
417
+ arclith-cli add-adapter --capability observability --adapter langsmith
418
+ uv run langgraph dev --no-browser --allow-blocking --port 2024
419
+ ```
420
+
421
+ L'adapter `llm/lmstudio` génère `config/adapters/outbound/lm.yaml`, chargé dans
422
+ `AppConfig.adapters.lm`. Adapter `model_name` au modèle chargé dans LM Studio et utiliser
423
+ `host.docker.internal` comme `base_url` si le projet tourne dans Docker alors que LM Studio tourne
424
+ sur l'hôte. Les adapters `llm/openai` et `llm/anthropic` génèrent aussi un mapping
425
+ `config/secrets.yaml` vers `OPENAI_API_KEY` ou `ANTHROPIC_API_KEY`; la clé réelle reste dans `.env`
426
+ local gitignoré, l'environnement runtime ou Vault.
427
+ Utiliser `llm/anthropic` pour Claude via le provider Anthropic; utiliser `llm/openai` pour OpenAI,
428
+ LM Studio ou tout endpoint OpenAI-compatible avec `base_url`.
429
+
430
+ L'adapter `repository/mongodb` génère `config/adapters/outbound/mongodb.yaml` avec `uri: null`, puis
431
+ mappe `adapters.mongodb.uri` vers `MONGODB_URI` dans `config/secrets.yaml`. L'URI réelle reste dans
432
+ l'environnement, un fichier local de secrets ou Vault selon le resolver choisi.
433
+
434
+ L'adapter `agent/langgraph` génère `langgraph.json`, `config/adapters/inbound/langgraph.yaml` et
435
+ `src/<package>/adapters/inbound/langgraph/agent.py`. Le projet ne modifie ensuite que ce fichier pour
436
+ son agent. Comme `fastapi` et `fastmcp`, LangGraph est configuré par son nom produit dans
437
+ `AppConfig.langgraph`, sans `adapters.agent`. `stream_mode` vaut `updates` par défaut et accepte une
438
+ liste CSV comme `updates,custom` pour exposer les sorties de nodes et les événements
439
+ `get_stream_writer()`. L'adapter `observability/langsmith` génère
440
+ `config/adapters/outbound/langsmith.yaml`, l'ajoute à `observability.enabled`, met
441
+ à jour `.env` et ajoute `.env` au `.gitignore` si besoin. LangSmith Studio devient l'endroit standard
442
+ pour tester les agents. Une `LANGSMITH_API_KEY` déjà présente est conservée si aucune nouvelle valeur
443
+ n'est fournie.
444
+
445
+ **OpenTelemetry :**
446
+
447
+ ```bash
448
+ uv add "arclith[opentelemetry]"
449
+ arclith-cli add-adapter --capability observability --adapter opentelemetry --param service_name=my-recipe-service --yes
450
+ ```
451
+
452
+ L'adapter `observability/opentelemetry` génère `config/adapters/outbound/opentelemetry.yaml`, met à
453
+ jour `.env`, l'ajoute à `observability.enabled` et branche l'instrumentation FastAPI quand
454
+ `Arclith.fastapi()` construit l'application. Il peut être activé en même temps que LangSmith.
455
+ Le fichier `opentelemetry.yaml` ne porte pas de flag `enabled`: l'activation se fait uniquement dans
456
+ `observability.enabled`.
457
+ L'endpoint global est utilisé par défaut; `traces_endpoint` et `metrics_endpoint` peuvent cibler des
458
+ routes OTLP distinctes. Pour taguer l'environnement, définir
459
+ `OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=local` dans l'environnement runtime.
460
+
461
+ Parcours complet avec entité, API, LangGraph, LangSmith et LM Studio:
462
+ [`docs/agent-quickstart.md`](../docs/agent-quickstart.md).
463
+
464
+ ---
465
+
466
+ ### `capabilities` — Lister le catalogue standardisé
467
+
468
+ Affiche les capacités et adapters connus par la CLI.
469
+
470
+ ```bash
471
+ arclith-cli capabilities
472
+ arclith-cli capabilities --json
473
+ ```
474
+
475
+ Le catalogue est la source de vérité pour les adapters supportés, leurs paramètres, leur chemin de configuration et la clé d'activation.
476
+
477
+ ---
478
+
479
+ ### `export-config` — Générer `config.yaml` pour K8s
480
+
481
+ Fusionne le dossier `config/` en un fichier YAML unique, à lancer **depuis la racine du projet**.
482
+
483
+ ```bash
484
+ arclith-cli export-config # → ./config.yaml
485
+ arclith-cli export-config --output dist/app.yaml # chemin personnalisé
486
+ ```
487
+
488
+ Le fichier généré peut être monté directement comme **ConfigMap** Kubernetes.
489
+ Arclith le lit au même titre que le dossier `config/` :
490
+
491
+ ```python
492
+ # dev
493
+ arclith = Arclith("config/")
494
+
495
+ # K8s (ConfigMap monté sur /app/config.yaml)
496
+ arclith = Arclith("config.yaml")
497
+ ```
498
+
499
+ > ⚠️ `config.yaml` est un **artefact généré** — l'ajouter à `.gitignore`.
500
+ > La source de vérité reste `config/`.
501
+
502
+ ---
503
+
504
+ ### `history` et `replay` — Relire et rejouer les décisions CLI
505
+
506
+ `init`, `new`, `add-entity`, `add-usecase`, `add-intent-interpreter` et
507
+ `add-adapter` ajoutent une étape à `arclith.recipe.yaml` uniquement après leur
508
+ succès complet. La recette est un historique fonctionnel rejouable ; Git reste
509
+ l'historique du code et `export-config` reste la configuration consolidée de
510
+ déploiement.
511
+
512
+ ```bash
513
+ arclith-cli history
514
+ arclith-cli replay arclith.recipe.yaml --dir ../rebuilt-service --dry-run
515
+ arclith-cli replay arclith.recipe.yaml --dir ../rebuilt-service
516
+ ```
517
+
518
+ Sélectionner une plage avec `--from-step 0003` et `--to-step 0008`. Utiliser
519
+ `--strict` pour refuser une commande non supportée.
520
+
521
+ Les paramètres secrets sont remplacés par `<redacted>` et référencent une
522
+ variable d'environnement. Le dry-run liste les variables requises sans lire
523
+ leur valeur ; le replay réel exige qu'elles soient définies. Les chemins de
524
+ fichiers générés restent relatifs à la racine du projet et les étapes rejouées
525
+ ne sont pas enregistrées une seconde fois.
526
+
527
+ Voir la documentation complète :
528
+ [Recettes Arclith CLI](https://karned-rekipe.github.io/arclith/cli-recipe/).
529
+
530
+ ---
531
+
532
+ ### `update` — Mettre à jour le CLI
533
+
534
+ ```bash
535
+ arclith-cli update
536
+ ```
537
+
538
+ ### `version` — Afficher la version
539
+
540
+ ```bash
541
+ arclith-cli version
542
+ ```
543
+
544
+ ---
545
+
546
+ ## Configuration
547
+
548
+ Les projets arclith utilisent un dossier `config/` à la place d'un `config.yaml` monolithique. Chaque fichier est **scopé** : son chemin détermine la section `AppConfig` dans laquelle son contenu est injecté.
549
+
550
+ ```
551
+ config/
552
+ app.yaml # app: { name, version, description }
553
+ soft_delete.yaml # soft_delete: { retention_days }
554
+ secrets.yaml # secrets: { resolver, mappings, vault, yaml }
555
+ adapters/
556
+ adapters.yaml # adapters: { logger, repository, observability.enabled }
557
+ outbound/
558
+ mongodb.yaml # adapters.mongodb: { db_name, multitenant }
559
+ duckdb.yaml # adapters.duckdb: { path, multitenant }
560
+ mariadb.yaml # adapters.mariadb: { host, port, database, user, ... }
561
+ lm.yaml # adapters.lm: { provider, model_name, api_key, base_url }
562
+ langsmith.yaml # adapters.langsmith: { tracing, project, endpoint, ... }
563
+ opentelemetry.yaml # adapters.opentelemetry: { endpoint, protocol, traces, metrics, ... }
564
+ inbound/
565
+ fastapi.yaml # api: { host, port, reload }
566
+ fastmcp.yaml # mcp: { host, port }
567
+ probe.yaml # probe: { host, port, enabled }
568
+ keycloak.yaml # keycloak: { url, realm }
569
+ tenant.yaml # tenant: { vault_addr, … }
570
+ license.yaml # license: { role }
571
+ cache.yaml # cache: { backend, redis_url, … }
572
+ ```
573
+
574
+ `cache/memory` génère `config/adapters/inbound/cache.yaml` avec `backend: memory` et les TTL JWKS /
575
+ tenant. Ce cache est strictement local au processus Python: il suffit pour le développement, les
576
+ tests et un worker unique. Passer à Redis dès qu'il faut partager le cache entre plusieurs workers,
577
+ réplicas, ou processus séparés API/MCP/agent.
578
+
579
+ `cache/redis` génère le même fichier avec `backend: redis`, mappe `cache.redis_url` vers
580
+ `REDIS_URL` dans `config/secrets.yaml` et écrit la valeur fournie dans `.env` local gitignoré.
581
+ Installer l'extra avant de lancer le service:
582
+
583
+ ```bash
584
+ uv add "arclith[cache]"
585
+ ```
586
+
587
+ Pour changer l'adapter actif sans passer par le wizard :
588
+
589
+ ```yaml
590
+ # config/adapters/adapters.yaml
591
+ repository: duckdb # memory | mongodb | duckdb | mariadb
592
+ observability:
593
+ enabled:
594
+ - langsmith
595
+ - opentelemetry
596
+ ```
597
+
598
+ Pour MariaDB, ne committez pas le mot de passe ni l'URL complète si elle contient des identifiants.
599
+ La CLI mappe `adapters.mariadb.password` vers `MARIADB_PASSWORD` et `adapters.mariadb.url` vers
600
+ `MARIADB_URL` dans `config/secrets.yaml`; remplacer le resolver `env` par Vault selon l'environnement.
@@ -307,6 +307,34 @@ arclith = Arclith("config.yaml")
307
307
 
308
308
  ---
309
309
 
310
+ ### `history` et `replay` — Relire et rejouer les décisions CLI
311
+
312
+ `init`, `new`, `add-entity`, `add-usecase`, `add-intent-interpreter` et
313
+ `add-adapter` ajoutent une étape à `arclith.recipe.yaml` uniquement après leur
314
+ succès complet. La recette est un historique fonctionnel rejouable ; Git reste
315
+ l'historique du code et `export-config` reste la configuration consolidée de
316
+ déploiement.
317
+
318
+ ```bash
319
+ arclith-cli history
320
+ arclith-cli replay arclith.recipe.yaml --dir ../rebuilt-service --dry-run
321
+ arclith-cli replay arclith.recipe.yaml --dir ../rebuilt-service
322
+ ```
323
+
324
+ Sélectionner une plage avec `--from-step 0003` et `--to-step 0008`. Utiliser
325
+ `--strict` pour refuser une commande non supportée.
326
+
327
+ Les paramètres secrets sont remplacés par `<redacted>` et référencent une
328
+ variable d'environnement. Le dry-run liste les variables requises sans lire
329
+ leur valeur ; le replay réel exige qu'elles soient définies. Les chemins de
330
+ fichiers générés restent relatifs à la racine du projet et les étapes rejouées
331
+ ne sont pas enregistrées une seconde fois.
332
+
333
+ Voir la documentation complète :
334
+ [Recettes Arclith CLI](https://karned-rekipe.github.io/arclith/cli-recipe/).
335
+
336
+ ---
337
+
310
338
  ### `update` — Mettre à jour le CLI
311
339
 
312
340
  ```bash
@@ -0,0 +1 @@
1
+ __version__ = "0.18.0"