forgex-cli 0.1.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 (197) hide show
  1. forgex_cli-0.1.0/.github/workflows/ci.yml +36 -0
  2. forgex_cli-0.1.0/.github/workflows/release.yml +55 -0
  3. forgex_cli-0.1.0/.gitignore +13 -0
  4. forgex_cli-0.1.0/CHANGELOG.md +16 -0
  5. forgex_cli-0.1.0/LICENSE +21 -0
  6. forgex_cli-0.1.0/PKG-INFO +189 -0
  7. forgex_cli-0.1.0/README.md +149 -0
  8. forgex_cli-0.1.0/SECURITY.md +7 -0
  9. forgex_cli-0.1.0/docs/agents.md +19 -0
  10. forgex_cli-0.1.0/docs/architecture.md +33 -0
  11. forgex_cli-0.1.0/docs/configuration.md +56 -0
  12. forgex_cli-0.1.0/docs/decisions.md +26 -0
  13. forgex_cli-0.1.0/docs/providers.md +47 -0
  14. forgex_cli-0.1.0/docs/quickstart.md +138 -0
  15. forgex_cli-0.1.0/docs/sandbox.md +29 -0
  16. forgex_cli-0.1.0/docs/security.md +20 -0
  17. forgex_cli-0.1.0/examples/demo-project/README.md +213 -0
  18. forgex_cli-0.1.0/examples/demo-project/pyproject.toml +6 -0
  19. forgex_cli-0.1.0/examples/demo-project/src/demo/__init__.py +1 -0
  20. forgex_cli-0.1.0/examples/demo-project/src/demo/calc.py +9 -0
  21. forgex_cli-0.1.0/examples/demo-project/tests/test_calc.py +11 -0
  22. forgex_cli-0.1.0/pyproject.toml +110 -0
  23. forgex_cli-0.1.0/src/forgex/__init__.py +3 -0
  24. forgex_cli-0.1.0/src/forgex/__main__.py +6 -0
  25. forgex_cli-0.1.0/src/forgex/agents/__init__.py +36 -0
  26. forgex_cli-0.1.0/src/forgex/agents/architect.py +233 -0
  27. forgex_cli-0.1.0/src/forgex/agents/base.py +385 -0
  28. forgex_cli-0.1.0/src/forgex/agents/builder.py +269 -0
  29. forgex_cli-0.1.0/src/forgex/agents/ensemble.py +334 -0
  30. forgex_cli-0.1.0/src/forgex/agents/expert_coder.py +283 -0
  31. forgex_cli-0.1.0/src/forgex/agents/supervisor.py +303 -0
  32. forgex_cli-0.1.0/src/forgex/cli/__init__.py +1 -0
  33. forgex_cli-0.1.0/src/forgex/cli/app.py +232 -0
  34. forgex_cli-0.1.0/src/forgex/cli/build_views.py +94 -0
  35. forgex_cli-0.1.0/src/forgex/cli/commands/__init__.py +1 -0
  36. forgex_cli-0.1.0/src/forgex/cli/commands/build.py +63 -0
  37. forgex_cli-0.1.0/src/forgex/cli/commands/checkpoint.py +41 -0
  38. forgex_cli-0.1.0/src/forgex/cli/commands/config.py +225 -0
  39. forgex_cli-0.1.0/src/forgex/cli/commands/context.py +94 -0
  40. forgex_cli-0.1.0/src/forgex/cli/commands/diff.py +32 -0
  41. forgex_cli-0.1.0/src/forgex/cli/commands/do_cmd.py +50 -0
  42. forgex_cli-0.1.0/src/forgex/cli/commands/doctor.py +175 -0
  43. forgex_cli-0.1.0/src/forgex/cli/commands/fix.py +46 -0
  44. forgex_cli-0.1.0/src/forgex/cli/commands/init.py +41 -0
  45. forgex_cli-0.1.0/src/forgex/cli/commands/logs.py +102 -0
  46. forgex_cli-0.1.0/src/forgex/cli/commands/models.py +144 -0
  47. forgex_cli-0.1.0/src/forgex/cli/commands/plan.py +103 -0
  48. forgex_cli-0.1.0/src/forgex/cli/commands/review.py +76 -0
  49. forgex_cli-0.1.0/src/forgex/cli/commands/rollback.py +65 -0
  50. forgex_cli-0.1.0/src/forgex/cli/commands/run.py +75 -0
  51. forgex_cli-0.1.0/src/forgex/cli/commands/status.py +141 -0
  52. forgex_cli-0.1.0/src/forgex/cli/commands/supervise.py +61 -0
  53. forgex_cli-0.1.0/src/forgex/cli/commands/task.py +136 -0
  54. forgex_cli-0.1.0/src/forgex/cli/commands/tools.py +116 -0
  55. forgex_cli-0.1.0/src/forgex/cli/commands/verify.py +65 -0
  56. forgex_cli-0.1.0/src/forgex/cli/context_memory.py +62 -0
  57. forgex_cli-0.1.0/src/forgex/cli/intent.py +209 -0
  58. forgex_cli-0.1.0/src/forgex/cli/progress.py +101 -0
  59. forgex_cli-0.1.0/src/forgex/cli/repl.py +377 -0
  60. forgex_cli-0.1.0/src/forgex/cli/runtime.py +233 -0
  61. forgex_cli-0.1.0/src/forgex/cli/session.py +95 -0
  62. forgex_cli-0.1.0/src/forgex/cli/ui.py +113 -0
  63. forgex_cli-0.1.0/src/forgex/config/__init__.py +53 -0
  64. forgex_cli-0.1.0/src/forgex/config/loader.py +189 -0
  65. forgex_cli-0.1.0/src/forgex/config/schema.py +145 -0
  66. forgex_cli-0.1.0/src/forgex/context/__init__.py +6 -0
  67. forgex_cli-0.1.0/src/forgex/context/chunker.py +102 -0
  68. forgex_cli-0.1.0/src/forgex/context/dependency_graph.py +110 -0
  69. forgex_cli-0.1.0/src/forgex/context/indexer.py +161 -0
  70. forgex_cli-0.1.0/src/forgex/context/manager.py +174 -0
  71. forgex_cli-0.1.0/src/forgex/context/retriever.py +99 -0
  72. forgex_cli-0.1.0/src/forgex/models/__init__.py +25 -0
  73. forgex_cli-0.1.0/src/forgex/models/base.py +112 -0
  74. forgex_cli-0.1.0/src/forgex/models/capabilities.py +21 -0
  75. forgex_cli-0.1.0/src/forgex/models/factory.py +66 -0
  76. forgex_cli-0.1.0/src/forgex/models/groq.py +13 -0
  77. forgex_cli-0.1.0/src/forgex/models/local.py +10 -0
  78. forgex_cli-0.1.0/src/forgex/models/openai_compatible.py +233 -0
  79. forgex_cli-0.1.0/src/forgex/models/registry.py +81 -0
  80. forgex_cli-0.1.0/src/forgex/models/router.py +332 -0
  81. forgex_cli-0.1.0/src/forgex/orchestration/__init__.py +36 -0
  82. forgex_cli-0.1.0/src/forgex/orchestration/checkpoints.py +117 -0
  83. forgex_cli-0.1.0/src/forgex/orchestration/engine.py +573 -0
  84. forgex_cli-0.1.0/src/forgex/orchestration/events.py +101 -0
  85. forgex_cli-0.1.0/src/forgex/orchestration/lockfile.py +82 -0
  86. forgex_cli-0.1.0/src/forgex/orchestration/retry.py +65 -0
  87. forgex_cli-0.1.0/src/forgex/orchestration/state.py +89 -0
  88. forgex_cli-0.1.0/src/forgex/orchestration/stores.py +90 -0
  89. forgex_cli-0.1.0/src/forgex/orchestration/workflow.py +103 -0
  90. forgex_cli-0.1.0/src/forgex/project.py +209 -0
  91. forgex_cli-0.1.0/src/forgex/prompts/__init__.py +27 -0
  92. forgex_cli-0.1.0/src/forgex/prompts/architect.md +18 -0
  93. forgex_cli-0.1.0/src/forgex/prompts/builder.md +20 -0
  94. forgex_cli-0.1.0/src/forgex/prompts/expert_coder.md +25 -0
  95. forgex_cli-0.1.0/src/forgex/prompts/reviewer.md +11 -0
  96. forgex_cli-0.1.0/src/forgex/prompts/supervisor.md +26 -0
  97. forgex_cli-0.1.0/src/forgex/research/__init__.py +15 -0
  98. forgex_cli-0.1.0/src/forgex/research/citations.py +16 -0
  99. forgex_cli-0.1.0/src/forgex/research/engine.py +83 -0
  100. forgex_cli-0.1.0/src/forgex/research/sources.py +154 -0
  101. forgex_cli-0.1.0/src/forgex/sandbox/__init__.py +37 -0
  102. forgex_cli-0.1.0/src/forgex/sandbox/executor.py +418 -0
  103. forgex_cli-0.1.0/src/forgex/sandbox/permissions.py +67 -0
  104. forgex_cli-0.1.0/src/forgex/sandbox/policies.py +172 -0
  105. forgex_cli-0.1.0/src/forgex/schemas/__init__.py +101 -0
  106. forgex_cli-0.1.0/src/forgex/schemas/agent.py +109 -0
  107. forgex_cli-0.1.0/src/forgex/schemas/checkpoint.py +19 -0
  108. forgex_cli-0.1.0/src/forgex/schemas/error.py +125 -0
  109. forgex_cli-0.1.0/src/forgex/schemas/event.py +76 -0
  110. forgex_cli-0.1.0/src/forgex/schemas/plan.py +84 -0
  111. forgex_cli-0.1.0/src/forgex/schemas/project.py +92 -0
  112. forgex_cli-0.1.0/src/forgex/schemas/research.py +25 -0
  113. forgex_cli-0.1.0/src/forgex/schemas/result.py +68 -0
  114. forgex_cli-0.1.0/src/forgex/schemas/task.py +118 -0
  115. forgex_cli-0.1.0/src/forgex/storage/__init__.py +25 -0
  116. forgex_cli-0.1.0/src/forgex/storage/database.py +40 -0
  117. forgex_cli-0.1.0/src/forgex/storage/migrations.py +130 -0
  118. forgex_cli-0.1.0/src/forgex/storage/repositories.py +492 -0
  119. forgex_cli-0.1.0/src/forgex/tools/__init__.py +73 -0
  120. forgex_cli-0.1.0/src/forgex/tools/base.py +212 -0
  121. forgex_cli-0.1.0/src/forgex/tools/dependencies.py +137 -0
  122. forgex_cli-0.1.0/src/forgex/tools/filesystem.py +322 -0
  123. forgex_cli-0.1.0/src/forgex/tools/git.py +239 -0
  124. forgex_cli-0.1.0/src/forgex/tools/project.py +39 -0
  125. forgex_cli-0.1.0/src/forgex/tools/search.py +205 -0
  126. forgex_cli-0.1.0/src/forgex/tools/terminal.py +81 -0
  127. forgex_cli-0.1.0/src/forgex/tools/testing.py +100 -0
  128. forgex_cli-0.1.0/src/forgex/tools/verification.py +174 -0
  129. forgex_cli-0.1.0/src/forgex/utils/__init__.py +15 -0
  130. forgex_cli-0.1.0/src/forgex/utils/logging.py +28 -0
  131. forgex_cli-0.1.0/src/forgex/utils/paths.py +48 -0
  132. forgex_cli-0.1.0/src/forgex/utils/redact.py +44 -0
  133. forgex_cli-0.1.0/tests/__init__.py +0 -0
  134. forgex_cli-0.1.0/tests/conftest.py +17 -0
  135. forgex_cli-0.1.0/tests/unit/__init__.py +0 -0
  136. forgex_cli-0.1.0/tests/unit/test_agents_architect.py +13 -0
  137. forgex_cli-0.1.0/tests/unit/test_builder_agent.py +66 -0
  138. forgex_cli-0.1.0/tests/unit/test_checkpoints.py +89 -0
  139. forgex_cli-0.1.0/tests/unit/test_cli.py +93 -0
  140. forgex_cli-0.1.0/tests/unit/test_cli_build.py +62 -0
  141. forgex_cli-0.1.0/tests/unit/test_cli_checkpoint.py +65 -0
  142. forgex_cli-0.1.0/tests/unit/test_cli_do.py +65 -0
  143. forgex_cli-0.1.0/tests/unit/test_cli_models.py +50 -0
  144. forgex_cli-0.1.0/tests/unit/test_cli_plan.py +102 -0
  145. forgex_cli-0.1.0/tests/unit/test_cli_review.py +73 -0
  146. forgex_cli-0.1.0/tests/unit/test_cli_surface.py +25 -0
  147. forgex_cli-0.1.0/tests/unit/test_cli_task.py +49 -0
  148. forgex_cli-0.1.0/tests/unit/test_cli_tools.py +52 -0
  149. forgex_cli-0.1.0/tests/unit/test_cli_verify.py +66 -0
  150. forgex_cli-0.1.0/tests/unit/test_config.py +66 -0
  151. forgex_cli-0.1.0/tests/unit/test_config_env.py +48 -0
  152. forgex_cli-0.1.0/tests/unit/test_config_setup.py +50 -0
  153. forgex_cli-0.1.0/tests/unit/test_context_agents.py +68 -0
  154. forgex_cli-0.1.0/tests/unit/test_context_manager.py +63 -0
  155. forgex_cli-0.1.0/tests/unit/test_context_memory.py +38 -0
  156. forgex_cli-0.1.0/tests/unit/test_engine.py +167 -0
  157. forgex_cli-0.1.0/tests/unit/test_ensemble.py +62 -0
  158. forgex_cli-0.1.0/tests/unit/test_events.py +63 -0
  159. forgex_cli-0.1.0/tests/unit/test_executor.py +75 -0
  160. forgex_cli-0.1.0/tests/unit/test_expert_coder.py +104 -0
  161. forgex_cli-0.1.0/tests/unit/test_fix.py +69 -0
  162. forgex_cli-0.1.0/tests/unit/test_indexer.py +94 -0
  163. forgex_cli-0.1.0/tests/unit/test_init.py +53 -0
  164. forgex_cli-0.1.0/tests/unit/test_intent.py +65 -0
  165. forgex_cli-0.1.0/tests/unit/test_large_repo.py +50 -0
  166. forgex_cli-0.1.0/tests/unit/test_offline.py +46 -0
  167. forgex_cli-0.1.0/tests/unit/test_packaging.py +30 -0
  168. forgex_cli-0.1.0/tests/unit/test_paths.py +46 -0
  169. forgex_cli-0.1.0/tests/unit/test_permissions.py +29 -0
  170. forgex_cli-0.1.0/tests/unit/test_plan_schemas.py +54 -0
  171. forgex_cli-0.1.0/tests/unit/test_policies.py +40 -0
  172. forgex_cli-0.1.0/tests/unit/test_project.py +46 -0
  173. forgex_cli-0.1.0/tests/unit/test_providers.py +130 -0
  174. forgex_cli-0.1.0/tests/unit/test_recovery.py +45 -0
  175. forgex_cli-0.1.0/tests/unit/test_redact.py +9 -0
  176. forgex_cli-0.1.0/tests/unit/test_registry.py +24 -0
  177. forgex_cli-0.1.0/tests/unit/test_repl.py +73 -0
  178. forgex_cli-0.1.0/tests/unit/test_research.py +89 -0
  179. forgex_cli-0.1.0/tests/unit/test_retriever.py +63 -0
  180. forgex_cli-0.1.0/tests/unit/test_retry.py +80 -0
  181. forgex_cli-0.1.0/tests/unit/test_router.py +99 -0
  182. forgex_cli-0.1.0/tests/unit/test_run_cli.py +50 -0
  183. forgex_cli-0.1.0/tests/unit/test_runtime.py +120 -0
  184. forgex_cli-0.1.0/tests/unit/test_security.py +40 -0
  185. forgex_cli-0.1.0/tests/unit/test_session.py +50 -0
  186. forgex_cli-0.1.0/tests/unit/test_state.py +70 -0
  187. forgex_cli-0.1.0/tests/unit/test_storage.py +78 -0
  188. forgex_cli-0.1.0/tests/unit/test_stores.py +43 -0
  189. forgex_cli-0.1.0/tests/unit/test_supervisor.py +34 -0
  190. forgex_cli-0.1.0/tests/unit/test_tasks.py +71 -0
  191. forgex_cli-0.1.0/tests/unit/test_tools_dependencies.py +52 -0
  192. forgex_cli-0.1.0/tests/unit/test_tools_filesystem.py +31 -0
  193. forgex_cli-0.1.0/tests/unit/test_tools_git.py +64 -0
  194. forgex_cli-0.1.0/tests/unit/test_tools_search.py +45 -0
  195. forgex_cli-0.1.0/tests/unit/test_tools_terminal.py +76 -0
  196. forgex_cli-0.1.0/tests/unit/test_verification.py +75 -0
  197. forgex_cli-0.1.0/tests/unit/test_workflow.py +59 -0
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, macos-latest, windows-latest]
14
+ python: ["3.12", "3.13"]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python }}
21
+ - run: python -m pip install --upgrade pip
22
+ - run: pip install -e ".[dev]"
23
+ - run: pytest -q
24
+ env:
25
+ CI: "1" # docker/API-key tests self-skip; git tests use identity fallbacks
26
+
27
+ lint:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+ - run: pip install -e ".[dev]"
35
+ - run: ruff check .
36
+ - run: mypy src
@@ -0,0 +1,55 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: "3.12"
15
+ - run: python -m pip install --upgrade pip build
16
+ - run: python -m build
17
+ - uses: actions/upload-artifact@v4
18
+ with:
19
+ name: dist
20
+ path: dist/
21
+
22
+ github-release:
23
+ needs: build
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: write
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/download-artifact@v4
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+ - name: Create GitHub Release with assets
34
+ uses: softprops/action-gh-release@v2
35
+ with:
36
+ files: dist/*
37
+ generate_release_notes: true
38
+
39
+ publish-pypi:
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment: pypi
43
+ permissions:
44
+ id-token: write # PyPI trusted publishing (OIDC)
45
+ continue-on-error: true
46
+ steps:
47
+ - uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+ - name: Publish package distributions to PyPI
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+ with:
54
+ password: ${{ secrets.PYPI_API_TOKEN }}
55
+ continue-on-error: true
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .pytest_cache/
11
+ .env
12
+ .forgex/
13
+ .DS_Store
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.1.0] - 2026-10-06
6
+
7
+ ### Added
8
+ - Multi-agent AI software engineering system (Architect, Builder, Expert Coder, Supervisor).
9
+ - Permission-gated tool execution layer.
10
+ - SQLite durable state and JSONL event store.
11
+ - Git checkpointing with reversible rollback.
12
+ - Self-healing repair loop with deterministic quality gates.
13
+ - Context intelligence (AST indexing, import dependency graph, chunking, retrieval).
14
+ - Multi-model ensemble review.
15
+ - Docker sandbox execution isolation.
16
+ - Typer CLI with full suite of commands.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 FORGEX Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.5
2
+ Name: forgex-cli
3
+ Version: 0.1.0
4
+ Summary: FORGEX — multi-agent AI software engineering. Plan. Build. Refine. Verify.
5
+ Project-URL: Homepage, https://github.com/B-max12/Forgex
6
+ Project-URL: Repository, https://github.com/B-max12/Forgex
7
+ Project-URL: Issues, https://github.com/B-max12/Forgex/issues
8
+ Project-URL: Changelog, https://github.com/B-max12/Forgex/blob/main/CHANGELOG.md
9
+ Project-URL: Documentation, https://github.com/B-max12/Forgex/tree/main/docs
10
+ Author: FORGEX Contributors
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: agents,ai,automation,cli,groq,llm,openai,software-engineering
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: Software Development :: Code Generators
25
+ Requires-Python: >=3.12
26
+ Requires-Dist: click>=8.0
27
+ Requires-Dist: httpx>=0.27
28
+ Requires-Dist: prompt-toolkit>=3.0
29
+ Requires-Dist: pydantic>=2.7
30
+ Requires-Dist: rich>=13.7
31
+ Requires-Dist: tomli-w>=1.0
32
+ Requires-Dist: typer>=0.12
33
+ Provides-Extra: dev
34
+ Requires-Dist: build>=1.2; extra == 'dev'
35
+ Requires-Dist: mypy>=1.10; extra == 'dev'
36
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
37
+ Requires-Dist: pytest>=8.2; extra == 'dev'
38
+ Requires-Dist: ruff>=0.4; extra == 'dev'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # FORGEX
42
+
43
+ **Plan. Build. Refine. Verify.**
44
+
45
+ FORGEX is a CLI-first autonomous AI software engineering system. Specialized
46
+ agents — **Architect**, **Builder**, **Expert Coder**, **Supervisor** —
47
+ collaborate on a real repository through permission-gated tools, Git
48
+ checkpoints, a deterministic verification harness, and a bounded self-healing
49
+ repair loop.
50
+
51
+ > FORGEX is not a chatbot and not a code generator: it is an AI software
52
+ > engineering *runtime* — with the safety rails that implies.
53
+
54
+ ```
55
+ request → Architect → research → plan → [ Builder → Expert Coder →
56
+ tests → Supervisor → PASS? done : repair ↺ ] (bounded by max_iterations)
57
+ ```
58
+
59
+ **Status: v0.1.0 alpha** — the full pipeline works end-to-end with any
60
+ OpenAI-compatible provider (Groq, OpenAI, local servers). Multi-model
61
+ ensemble review, Docker sandboxing, and a context-intelligence layer are
62
+ built in.
63
+
64
+ ## Installation
65
+
66
+ ### One-Line Install (Zero Environment Activation)
67
+
68
+ ```bash
69
+ curl -sSL https://raw.githubusercontent.com/B-max12/Forgex/main/install.sh | bash
70
+ ```
71
+ *(Or clone and run `./install.sh`)*
72
+
73
+ ### Via `pipx` or `uv tool`
74
+
75
+ ```bash
76
+ pipx install forgex-cli # once published to PyPI
77
+ # or directly from GitHub:
78
+ pipx install "git+https://github.com/B-max12/Forgex.git"
79
+ ```
80
+
81
+ ### From source (Developers):
82
+
83
+ ```bash
84
+ git clone https://github.com/B-max12/Forgex.git && cd Forgex
85
+ pip install -e ".[dev]"
86
+ ```
87
+
88
+ Python 3.12+. Optional: Git (checkpoints — strongly recommended),
89
+ Docker (sandboxing), ripgrep (faster search).
90
+
91
+ ## Quickstart
92
+
93
+ ### The Universal Way (Zero Learning Curve)
94
+
95
+ Simply run `forgex` and describe what you want in plain English:
96
+
97
+ ```bash
98
+ forgex
99
+ ```
100
+
101
+ ```text
102
+ forgex ❯ Build me a FastAPI Todo API with SQLite and pytest
103
+ ```
104
+
105
+ FORGEX handles the complete lifecycle automatically:
106
+ 1. **Auto-initializes** the project workspace and git repository if needed
107
+ 2. **Plans** architecture and task breakdown (Architect agent)
108
+ 3. **Implements** code and tests across tasks (Builder + Expert Coder)
109
+ 4. **Verifies** deterministically (tests, lint, typecheck)
110
+ 5. **Self-heals** and auto-repairs if any verification gates fail
111
+ 6. **Snapshots** a clean, reversible Git checkpoint on success!
112
+
113
+ Follow up naturally with conversational context:
114
+ ```text
115
+ forgex ❯ now add rate limiting to those endpoints
116
+ forgex ❯ fix the failing tests in users.py
117
+ ```
118
+
119
+ ### One-Shot CLI / CI/CD Mode
120
+
121
+ Run tasks directly from your shell without opening the REPL:
122
+
123
+ ```bash
124
+ forgex "Create a FastAPI Todo API with SQLite and pytest"
125
+ # Or:
126
+ forgex do "Add JWT authentication with refresh tokens"
127
+ ```
128
+
129
+ ### Granular Power User Commands
130
+
131
+ For granular manual control, individual pipeline stages remain available:
132
+
133
+ ```bash
134
+ forgex plan "Add caching layer" # run architect planning only
135
+ forgex build # execute existing plan tasks
136
+ forgex verify # run tests and lint deterministically
137
+ forgex fix # verify + repair loop without replanning
138
+ forgex checkpoint "Stable release" # snapshot Git state
139
+ forgex rollback # undo to previous checkpoint
140
+ ```
141
+
142
+ ## Commands
143
+
144
+ | Command | Purpose |
145
+ |---|---|
146
+ | `forgex init [DIR]` | initialize a project (state, events, SQLite index) |
147
+ | `forgex plan [REQUEST] [--dry-run]` | Architect: analysis → registry research → implementation plan |
148
+ | `forgex build [REQUEST] [--file F] [--resume] [--dry-run]` | full pipeline with the repair loop |
149
+ | `forgex fix` | verify + supervise + repair until green — no rebuild |
150
+ | `forgex run [-- CMD]` | run the project's start command (policy-gated) |
151
+ | `forgex task list / run ID` | inspect / execute single tasks (Builder + review) |
152
+ | `forgex review [TASK] [--base C]` | Expert Coder review — single model or ensemble |
153
+ | `forgex verify` | deterministic tests/build/lint — no LLM |
154
+ | `forgex supervise` | verification + LLM audit + quality gates → verdict |
155
+ | `forgex status / logs / diff` | project state, event stream, git diff |
156
+ | `forgex checkpoint / rollback` | Git checkpoints; reversible rollback |
157
+ | `forgex models [catalog\|health]` | bindings, capability catalog, live provider ping |
158
+ | `forgex context stats\|search` | context index and relevance retrieval |
159
+ | `forgex tools list\|run` | inspect / manually run agent tools |
160
+ | `forgex config show\|get\|set\|setup` | layered configuration |
161
+ | `forgex doctor [--ping]` | environment and provider health |
162
+
163
+ Every command supports `--json` and `--plain` (CI/SSH friendly).
164
+
165
+ ## Providers
166
+
167
+ | Type | Target | Notes |
168
+ |---|---|---|
169
+ | `groq` | Groq API | default binding: llama-3.3-70b-versatile |
170
+ | `openai_compatible` | OpenAI & any compatible endpoint | set base_url |
171
+ | `local` | Ollama, llama.cpp, vLLM, LM Studio | base_url required, keyless |
172
+
173
+ Provider-independent by design: per-agent model bindings, capability-aware
174
+ routing, retry with backoff, fallback chains, and multi-model ensemble
175
+ review (`[ensemble] enabled = true` — e.g. Groq + OpenAI reviewing the same
176
+ diff in parallel, findings corroborated before fixes are applied).
177
+
178
+ ## Security
179
+
180
+ - Agents act only through permission-gated tools; every path is workspace-confined; `.forgex/`, `.git/` and secret files are untouchable.
181
+ - Commands are argv-only (no shells), policy-filtered (deny list, optional allowlist, network approval), and — with `[sandbox] enabled = true` — run in hardened Docker containers (no network by default, host FS invisible).
182
+ - Secrets never enter prompts: env-only storage, sanitized child environments, pattern-based content scrubbing.
183
+ - Deterministic quality gates: no model verdict can pass a red test suite or an incomplete build.
184
+
185
+ Full model + residual risks: `docs/security.md`.
186
+
187
+ ## License
188
+
189
+ MIT
@@ -0,0 +1,149 @@
1
+ # FORGEX
2
+
3
+ **Plan. Build. Refine. Verify.**
4
+
5
+ FORGEX is a CLI-first autonomous AI software engineering system. Specialized
6
+ agents — **Architect**, **Builder**, **Expert Coder**, **Supervisor** —
7
+ collaborate on a real repository through permission-gated tools, Git
8
+ checkpoints, a deterministic verification harness, and a bounded self-healing
9
+ repair loop.
10
+
11
+ > FORGEX is not a chatbot and not a code generator: it is an AI software
12
+ > engineering *runtime* — with the safety rails that implies.
13
+
14
+ ```
15
+ request → Architect → research → plan → [ Builder → Expert Coder →
16
+ tests → Supervisor → PASS? done : repair ↺ ] (bounded by max_iterations)
17
+ ```
18
+
19
+ **Status: v0.1.0 alpha** — the full pipeline works end-to-end with any
20
+ OpenAI-compatible provider (Groq, OpenAI, local servers). Multi-model
21
+ ensemble review, Docker sandboxing, and a context-intelligence layer are
22
+ built in.
23
+
24
+ ## Installation
25
+
26
+ ### One-Line Install (Zero Environment Activation)
27
+
28
+ ```bash
29
+ curl -sSL https://raw.githubusercontent.com/B-max12/Forgex/main/install.sh | bash
30
+ ```
31
+ *(Or clone and run `./install.sh`)*
32
+
33
+ ### Via `pipx` or `uv tool`
34
+
35
+ ```bash
36
+ pipx install forgex-cli # once published to PyPI
37
+ # or directly from GitHub:
38
+ pipx install "git+https://github.com/B-max12/Forgex.git"
39
+ ```
40
+
41
+ ### From source (Developers):
42
+
43
+ ```bash
44
+ git clone https://github.com/B-max12/Forgex.git && cd Forgex
45
+ pip install -e ".[dev]"
46
+ ```
47
+
48
+ Python 3.12+. Optional: Git (checkpoints — strongly recommended),
49
+ Docker (sandboxing), ripgrep (faster search).
50
+
51
+ ## Quickstart
52
+
53
+ ### The Universal Way (Zero Learning Curve)
54
+
55
+ Simply run `forgex` and describe what you want in plain English:
56
+
57
+ ```bash
58
+ forgex
59
+ ```
60
+
61
+ ```text
62
+ forgex ❯ Build me a FastAPI Todo API with SQLite and pytest
63
+ ```
64
+
65
+ FORGEX handles the complete lifecycle automatically:
66
+ 1. **Auto-initializes** the project workspace and git repository if needed
67
+ 2. **Plans** architecture and task breakdown (Architect agent)
68
+ 3. **Implements** code and tests across tasks (Builder + Expert Coder)
69
+ 4. **Verifies** deterministically (tests, lint, typecheck)
70
+ 5. **Self-heals** and auto-repairs if any verification gates fail
71
+ 6. **Snapshots** a clean, reversible Git checkpoint on success!
72
+
73
+ Follow up naturally with conversational context:
74
+ ```text
75
+ forgex ❯ now add rate limiting to those endpoints
76
+ forgex ❯ fix the failing tests in users.py
77
+ ```
78
+
79
+ ### One-Shot CLI / CI/CD Mode
80
+
81
+ Run tasks directly from your shell without opening the REPL:
82
+
83
+ ```bash
84
+ forgex "Create a FastAPI Todo API with SQLite and pytest"
85
+ # Or:
86
+ forgex do "Add JWT authentication with refresh tokens"
87
+ ```
88
+
89
+ ### Granular Power User Commands
90
+
91
+ For granular manual control, individual pipeline stages remain available:
92
+
93
+ ```bash
94
+ forgex plan "Add caching layer" # run architect planning only
95
+ forgex build # execute existing plan tasks
96
+ forgex verify # run tests and lint deterministically
97
+ forgex fix # verify + repair loop without replanning
98
+ forgex checkpoint "Stable release" # snapshot Git state
99
+ forgex rollback # undo to previous checkpoint
100
+ ```
101
+
102
+ ## Commands
103
+
104
+ | Command | Purpose |
105
+ |---|---|
106
+ | `forgex init [DIR]` | initialize a project (state, events, SQLite index) |
107
+ | `forgex plan [REQUEST] [--dry-run]` | Architect: analysis → registry research → implementation plan |
108
+ | `forgex build [REQUEST] [--file F] [--resume] [--dry-run]` | full pipeline with the repair loop |
109
+ | `forgex fix` | verify + supervise + repair until green — no rebuild |
110
+ | `forgex run [-- CMD]` | run the project's start command (policy-gated) |
111
+ | `forgex task list / run ID` | inspect / execute single tasks (Builder + review) |
112
+ | `forgex review [TASK] [--base C]` | Expert Coder review — single model or ensemble |
113
+ | `forgex verify` | deterministic tests/build/lint — no LLM |
114
+ | `forgex supervise` | verification + LLM audit + quality gates → verdict |
115
+ | `forgex status / logs / diff` | project state, event stream, git diff |
116
+ | `forgex checkpoint / rollback` | Git checkpoints; reversible rollback |
117
+ | `forgex models [catalog\|health]` | bindings, capability catalog, live provider ping |
118
+ | `forgex context stats\|search` | context index and relevance retrieval |
119
+ | `forgex tools list\|run` | inspect / manually run agent tools |
120
+ | `forgex config show\|get\|set\|setup` | layered configuration |
121
+ | `forgex doctor [--ping]` | environment and provider health |
122
+
123
+ Every command supports `--json` and `--plain` (CI/SSH friendly).
124
+
125
+ ## Providers
126
+
127
+ | Type | Target | Notes |
128
+ |---|---|---|
129
+ | `groq` | Groq API | default binding: llama-3.3-70b-versatile |
130
+ | `openai_compatible` | OpenAI & any compatible endpoint | set base_url |
131
+ | `local` | Ollama, llama.cpp, vLLM, LM Studio | base_url required, keyless |
132
+
133
+ Provider-independent by design: per-agent model bindings, capability-aware
134
+ routing, retry with backoff, fallback chains, and multi-model ensemble
135
+ review (`[ensemble] enabled = true` — e.g. Groq + OpenAI reviewing the same
136
+ diff in parallel, findings corroborated before fixes are applied).
137
+
138
+ ## Security
139
+
140
+ - Agents act only through permission-gated tools; every path is workspace-confined; `.forgex/`, `.git/` and secret files are untouchable.
141
+ - Commands are argv-only (no shells), policy-filtered (deny list, optional allowlist, network approval), and — with `[sandbox] enabled = true` — run in hardened Docker containers (no network by default, host FS invisible).
142
+ - Secrets never enter prompts: env-only storage, sanitized child environments, pattern-based content scrubbing.
143
+ - Deterministic quality gates: no model verdict can pass a red test suite or an incomplete build.
144
+
145
+ Full model + residual risks: `docs/security.md`.
146
+
147
+ ## License
148
+
149
+ MIT
@@ -0,0 +1,7 @@
1
+ # Security Policy
2
+
3
+ ## Reporting Security Issues
4
+
5
+ If you discover a security vulnerability in FORGEX, please email security@forgex.dev or open a private security advisory on GitHub.
6
+
7
+ See [docs/security.md](docs/security.md) for the complete security architecture, mitigations, and known residual limitations.
@@ -0,0 +1,19 @@
1
+ # Agents
2
+
3
+ All agents share one machinery: versioned prompts (`prompts/*.md`, `name:vN`), the structured-output loop (schema-in-prompt → parse → bounded repair), and — for acting agents — the **tool loop**: multi-turn native tool calling, or a strict JSON protocol for models without tool support. The loop itself has zero privileges; every call goes through the per-agent permission set at the `ToolExecutor`.
4
+
5
+ | Agent | Prompt | Permissions | Output |
6
+ |---|---|---|---|
7
+ | Architect | `architect:v1` | read, research | `AnalysisResult` → `ArchitecturePlan` |
8
+ | Builder | `builder:v1` | read, write, delete, terminal, git, test, build | `BuilderResult` |
9
+ | Expert Coder | `expert_coder:v1` | read, write, delete, terminal, git, test, build | `ExpertCoderResult` |
10
+ | Reviewer | `reviewer:v1` | read, git, test | `ReviewFindings` |
11
+ | Supervisor | `supervisor:v1` | read, test, build, git | `SupervisorJudgment` → `SupervisorReport` |
12
+
13
+ ## Collaboration Protocol
14
+
15
+ 1. **Architect** analyzes repository and decomposes goals into dependency-ordered tasks (`TASK-001`, `TASK-002`, ...).
16
+ 2. **Builder** implements tasks one at a time within pre-task checkpoints.
17
+ 3. **Expert Coder** inspects diffs and refines changes (or ensemble reviewers corroborated by judge).
18
+ 4. **Supervisor** audits deterministic test/build results against acceptance criteria and issues verdicts.
19
+ 5. In case of failure, a `REPAIR-NNN` task is generated for targeted self-healing.
@@ -0,0 +1,33 @@
1
+ # Architecture
2
+
3
+ ## Layers
4
+
5
+ ```
6
+ CLI (Typer/Rich) thin commands — services hold the logic (future server reuses them)
7
+ Orchestration workflow engine · state · events · checkpoints · run lock
8
+ Agents architect · builder · expert coder · reviewer · supervisor
9
+ Model layer provider adapters · router (bindings, fallback, ensemble) · registry
10
+ Tools (permission- filesystem · search · terminal · git · tests · dependencies
11
+ gated, the ONLY context: index · dependency graph · retrieval · chunking
12
+ I/O path for agents)
13
+ Storage SQLite (queryable metadata) + JSON state in .forgex/ (truth)
14
+ + git (checkpoints) — filesystem stays the source of truth
15
+ ```
16
+
17
+ ## State Machine
18
+
19
+ `INITIALIZING → ANALYZING → RESEARCHING → PLANNING → BUILDING ⇄ REVIEWING → TESTING → SUPERVISING → (COMPLETED | REPAIRING → TESTING …)` with `FAILED` and `CANCELLED` reachable from any active state. Transitions are explicit (`forgex/orchestration/workflow.py`); the engine walks them, saves state at each step, and `--resume` re-enters idempotently.
20
+
21
+ ## Invariants
22
+
23
+ 1. Agents have zero direct I/O — only tools, only within their permission set.
24
+ 2. Every mutation is checkpointed first; every rollback is reversible.
25
+ 3. Verification is deterministic; LLM judgment can only worsen a verdict.
26
+ 4. JSON files in `.forgex/` are the durable truth; SQLite is a rebuildable index.
27
+ 5. Every significant action emits an event (`forgex logs`).
28
+ 6. One active run per project (run lock); interrupts never corrupt state.
29
+ 7. Bounded loops everywhere: repair iterations, tool rounds, transcript chars.
30
+
31
+ ## Data Flow
32
+
33
+ `events.jsonl` (append-only, fsync) ↔ SQLite mirrors (events, runs, tasks, model_usage, checkpoints, errors) · `state.json`/`tasks.json` (atomic writes) · git commits as checkpoints · `cache/context-index.json` (mtime-invalidated).
@@ -0,0 +1,56 @@
1
+ # Configuration
2
+
3
+ FORGEX features layered configuration (highest wins):
4
+ CLI args → environment → project `.forgex/config.toml` → global `~/.forgex/config.toml` → schema defaults.
5
+
6
+ Secrets are NEVER saved in configuration files. Only the name of the environment variable (e.g. `api_key_env = "FORGEX_GROQ_API_KEY"`) is stored. Real secrets live in the environment or `~/.forgex/.env` (permissions `0600`).
7
+
8
+ ## Sections
9
+
10
+ ### `[workflow]`
11
+ - `max_iterations = 5`: Maximum repair loops before stopping.
12
+
13
+ ### `[permissions]`
14
+ - `mode = "ask"`: Policy mode (`"auto"`, `"ask"`, or `"safe"`).
15
+
16
+ ### `[terminal]`
17
+ - `allowed = []`: Allowlist of commands (if non-empty, only these may run).
18
+ - `denied = []`: Additional denied commands.
19
+ - `timeout_seconds = 120`: Default timeout for command execution.
20
+ - `max_output_bytes = 1000000`: Output size cap before truncation.
21
+
22
+ ### `[sandbox]`
23
+ - `enabled = false`: Whether to run commands in Docker containers.
24
+ - `network = false`: Whether sandboxed containers have network access.
25
+ - `image = "python:3.12-slim"`: Docker image to execute in.
26
+ - `cpu_limit = "2.0"`: CPU limit.
27
+ - `memory_limit = "1g"`: Memory limit.
28
+ - `read_only = true`: Read-only container rootfs with tmpfs `/tmp`.
29
+
30
+ ### `[models]`
31
+ Configure model bindings per agent role:
32
+ ```toml
33
+ [models.architect]
34
+ provider = "groq"
35
+ model = "llama-3.3-70b-versatile"
36
+
37
+ [models.builder]
38
+ provider = "groq"
39
+ model = "llama-3.3-70b-versatile"
40
+
41
+ [models.expert_coder]
42
+ provider = "groq"
43
+ model = "llama-3.3-70b-versatile"
44
+
45
+ [models.supervisor]
46
+ provider = "groq"
47
+ model = "llama-3.3-70b-versatile"
48
+ ```
49
+
50
+ ### `[fallback]`
51
+ - `enabled = true`: Whether to attempt fallback providers if primary fails.
52
+ - `providers = ["openai_compatible"]`: Ordered fallback providers.
53
+
54
+ ### `[ensemble]`
55
+ - `enabled = false`: Multi-model ensemble review.
56
+ - `reviewers = 2`: Number of parallel reviewer models.
@@ -0,0 +1,26 @@
1
+ # Architecture Decision Records
2
+
3
+ The consolidated decision log (§44).
4
+
5
+ | ADR | Decision | Reason | Consequence |
6
+ |---|---|---|---|
7
+ | 001 | MIT, src-layout, hatchling | Simple packaging, clean namespace | Dynamic version from `__init__.py` |
8
+ | 002 | JSON files = durable truth; SQLite = rebuildable index | Git-friendly, human-inspectable state | Dual writes centralized in `ProjectStores` |
9
+ | 003 | Atomic writes + fsync'd events | Interrupts never corrupt state (§36) | Durability priority |
10
+ | 004 | Forward-only SQLite migrations | Phase-safe schema upgrades | New tables require new numbered migration |
11
+ | 005 | Secrets: env-only, `api_key_env` indirection, `.env` loading | Secrets never in config, git, or prompts (§46) | Setup writes `~/.forgex/.env` `0600` |
12
+ | 006 | Argv-only execution; all shells denied | Shell injection structurally impossible (§45) | No pipes or `&&` in command tool |
13
+ | 007 | Sanitized child env allowlist | Child processes cannot leak parent env vars | Explicit env passing when needed |
14
+ | 008 | Per-agent permission matrix, fail-closed | Least privilege (§32) | Unknown roles get empty permissions |
15
+ | 009 | Deterministic verification; quality gates | Models cannot talk past red tests (§56/58) | Supervisor read-only by permission |
16
+ | 010 | Ensemble reviewers read-only; explicit bindings | Parallel writers clobber; diversity must be real | Single senior applier resolves findings |
17
+ | 011 | Corroboration judge is deterministic code | Auditable, cheap, testable | Jaccard lexical clustering of findings |
18
+ | 012 | Tool loop: native tools or JSON protocol fallback | Works with any OpenAI-compatible model (§31) | Fallback enables local/small model support |
19
+ | 013 | Structured output: schema in prompt + bounded repair | Robust structured extraction without forced schema API | Max 2 attempts then controlled error |
20
+ | 014 | Pre-mutation checkpoints; reversible rollback | All repository modifications reversible (§21) | Safety checkpoint before hard reset |
21
+ | 015 | Context: AST index + import graph + lexical scoring | Low token footprint without heavy vector DB | Fast, deterministic file ranking |
22
+ | 016 | Pattern redaction at every content on-ramp | Prevents credentials entering model context | Over-redaction preferred to leakage |
23
+ | 017 | Transcript budgets (soft warning + hard stop) | Prevents infinite loops blowing context limits | Checkpoint-recoverable stop |
24
+ | 018 | Run lock (`run.lock`) with PID liveness check | Prevents concurrent runs corrupting state | Advisory lock per project |
25
+ | 019 | Research = official registries only, fixed endpoints | Zero SSRF / prompt injection surface (§8) | No arbitrary web crawling |
26
+ | 020 | Degradation is logged, never silent | Observability and operator trust | Warnings emitted when falling back |
@@ -0,0 +1,47 @@
1
+ # Providers
2
+
3
+ FORGEX is provider-independent (spec section 2.2). Agents talk to the `ModelRouter`; the router resolves your configuration into provider adapters. No agent code contains provider-specific logic.
4
+
5
+ ## Built-in Adapters
6
+
7
+ | Type | Target | Notes |
8
+ |---|---|---|
9
+ | `groq` | Groq API | OpenAI-compatible; default `base_url` + `FORGEX_GROQ_API_KEY` |
10
+ | `openai_compatible` | OpenAI & any compatible endpoint | requires `base_url` |
11
+ | `local` | Ollama, llama.cpp, vLLM, LM Studio | requires `base_url`; no auth by default |
12
+
13
+ ## Configuration Example
14
+
15
+ ```toml
16
+ [providers.groq]
17
+ type = "groq"
18
+ default_model = "llama-3.3-70b-versatile"
19
+ api_key_env = "FORGEX_GROQ_API_KEY"
20
+
21
+ [providers.ollama]
22
+ type = "local"
23
+ base_url = "http://localhost:11434/v1"
24
+ default_model = "llama3.1:8b"
25
+
26
+ [models.architect]
27
+ provider = "groq"
28
+ model = "llama-3.3-70b-versatile"
29
+ ```
30
+
31
+ Resolution per agent: `models.<agent>.model` → provider's `default_model` → configuration error. Nothing is guessed.
32
+
33
+ ## Secrets
34
+
35
+ - Config files store only the name of the environment variable.
36
+ - Keys are read from the environment or `~/.forgex/.env`.
37
+ - `forgex config setup` writes keys to `~/.forgex/.env` (`chmod 0600`).
38
+ - Provider error text is scrubbed through a redactor before surfacing.
39
+
40
+ ## Fallback
41
+
42
+ ```toml
43
+ [fallback]
44
+ enabled = true
45
+ providers = ["openai_compatible"]
46
+ ```
47
+ After a provider exhausts retries (rate limits, 5xx, timeouts), the router tries the next fallback provider using its `default_model`.