aibox-cli 0.3.1__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 (76) hide show
  1. aibox_cli-0.3.1/.dockerignore +8 -0
  2. aibox_cli-0.3.1/.github/workflows/release.yml +83 -0
  3. aibox_cli-0.3.1/.github/workflows/test.yml +55 -0
  4. aibox_cli-0.3.1/.gitignore +326 -0
  5. aibox_cli-0.3.1/AGENTS.md +31 -0
  6. aibox_cli-0.3.1/CONTRIBUTING.md +360 -0
  7. aibox_cli-0.3.1/LICENSE +21 -0
  8. aibox_cli-0.3.1/PKG-INFO +410 -0
  9. aibox_cli-0.3.1/README.md +370 -0
  10. aibox_cli-0.3.1/aibox/__init__.py +12 -0
  11. aibox_cli-0.3.1/aibox/cli/__init__.py +18 -0
  12. aibox_cli-0.3.1/aibox/cli/autocomplete.py +80 -0
  13. aibox_cli-0.3.1/aibox/cli/commands/__init__.py +25 -0
  14. aibox_cli-0.3.1/aibox/cli/commands/config.py +228 -0
  15. aibox_cli-0.3.1/aibox/cli/commands/images.py +173 -0
  16. aibox_cli-0.3.1/aibox/cli/commands/init.py +199 -0
  17. aibox_cli-0.3.1/aibox/cli/commands/profile.py +105 -0
  18. aibox_cli-0.3.1/aibox/cli/commands/slot.py +531 -0
  19. aibox_cli-0.3.1/aibox/cli/commands/start.py +405 -0
  20. aibox_cli-0.3.1/aibox/cli/commands/status.py +99 -0
  21. aibox_cli-0.3.1/aibox/cli/main.py +356 -0
  22. aibox_cli-0.3.1/aibox/config/__init__.py +0 -0
  23. aibox_cli-0.3.1/aibox/config/loader.py +358 -0
  24. aibox_cli-0.3.1/aibox/config/models.py +121 -0
  25. aibox_cli-0.3.1/aibox/containers/__init__.py +0 -0
  26. aibox_cli-0.3.1/aibox/containers/manager.py +536 -0
  27. aibox_cli-0.3.1/aibox/containers/orchestrator.py +566 -0
  28. aibox_cli-0.3.1/aibox/containers/slot.py +468 -0
  29. aibox_cli-0.3.1/aibox/containers/volumes.py +168 -0
  30. aibox_cli-0.3.1/aibox/profiles/__init__.py +0 -0
  31. aibox_cli-0.3.1/aibox/profiles/definitions/git.yml +15 -0
  32. aibox_cli-0.3.1/aibox/profiles/definitions/go.yml +32 -0
  33. aibox_cli-0.3.1/aibox/profiles/definitions/nodejs.yml +28 -0
  34. aibox_cli-0.3.1/aibox/profiles/definitions/python.yml +30 -0
  35. aibox_cli-0.3.1/aibox/profiles/definitions/rust.yml +36 -0
  36. aibox_cli-0.3.1/aibox/profiles/definitions/sudo.yml +16 -0
  37. aibox_cli-0.3.1/aibox/profiles/generator.py +396 -0
  38. aibox_cli-0.3.1/aibox/profiles/loader.py +200 -0
  39. aibox_cli-0.3.1/aibox/profiles/models.py +157 -0
  40. aibox_cli-0.3.1/aibox/providers/__init__.py +34 -0
  41. aibox_cli-0.3.1/aibox/providers/base.py +208 -0
  42. aibox_cli-0.3.1/aibox/providers/claude.py +164 -0
  43. aibox_cli-0.3.1/aibox/providers/gemini.py +124 -0
  44. aibox_cli-0.3.1/aibox/providers/openai.py +191 -0
  45. aibox_cli-0.3.1/aibox/providers/registry.py +190 -0
  46. aibox_cli-0.3.1/aibox/utils/__init__.py +0 -0
  47. aibox_cli-0.3.1/aibox/utils/errors.py +118 -0
  48. aibox_cli-0.3.1/aibox/utils/hash.py +73 -0
  49. aibox_cli-0.3.1/docs/ARCHITECTURE.md +287 -0
  50. aibox_cli-0.3.1/docs/configuration.md +474 -0
  51. aibox_cli-0.3.1/docs/getting-started.md +93 -0
  52. aibox_cli-0.3.1/pyproject.toml +163 -0
  53. aibox_cli-0.3.1/tests/conftest.py +40 -0
  54. aibox_cli-0.3.1/tests/unit/test_claude_provider.py +108 -0
  55. aibox_cli-0.3.1/tests/unit/test_cli.py +22 -0
  56. aibox_cli-0.3.1/tests/unit/test_commands_config.py +438 -0
  57. aibox_cli-0.3.1/tests/unit/test_commands_profile.py +177 -0
  58. aibox_cli-0.3.1/tests/unit/test_commands_slot.py +605 -0
  59. aibox_cli-0.3.1/tests/unit/test_commands_start.py +580 -0
  60. aibox_cli-0.3.1/tests/unit/test_commands_status.py +106 -0
  61. aibox_cli-0.3.1/tests/unit/test_config.py +548 -0
  62. aibox_cli-0.3.1/tests/unit/test_container_manager.py +713 -0
  63. aibox_cli-0.3.1/tests/unit/test_dockerfile_generator.py +487 -0
  64. aibox_cli-0.3.1/tests/unit/test_errors.py +238 -0
  65. aibox_cli-0.3.1/tests/unit/test_gemini_provider.py +140 -0
  66. aibox_cli-0.3.1/tests/unit/test_hash.py +77 -0
  67. aibox_cli-0.3.1/tests/unit/test_init.py +401 -0
  68. aibox_cli-0.3.1/tests/unit/test_openai_provider.py +151 -0
  69. aibox_cli-0.3.1/tests/unit/test_orchestrator.py +797 -0
  70. aibox_cli-0.3.1/tests/unit/test_placeholder_providers.py +16 -0
  71. aibox_cli-0.3.1/tests/unit/test_profile_loader.py +253 -0
  72. aibox_cli-0.3.1/tests/unit/test_profiles.py +166 -0
  73. aibox_cli-0.3.1/tests/unit/test_providers_base.py +168 -0
  74. aibox_cli-0.3.1/tests/unit/test_registry.py +202 -0
  75. aibox_cli-0.3.1/tests/unit/test_slots.py +720 -0
  76. aibox_cli-0.3.1/tests/unit/test_volumes.py +575 -0
@@ -0,0 +1,8 @@
1
+ .git
2
+ .gitignore
3
+ .venv
4
+ __pycache__
5
+ *.pyc
6
+ .pytest_cache
7
+ htmlcov
8
+ .aibox/projects
@@ -0,0 +1,83 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v4
18
+
19
+ - name: Set up Python
20
+ run: uv python install 3.12
21
+
22
+ - name: Create virtual environment
23
+ run: uv venv
24
+
25
+ - name: Install build dependencies
26
+ run: |
27
+ uv pip install build twine
28
+
29
+ - name: Build package
30
+ run: |
31
+ uv build
32
+
33
+ - name: Check package
34
+ run: |
35
+ uv run twine check dist/*
36
+
37
+ - name: Upload artifacts
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/
42
+
43
+ publish-pypi:
44
+ name: Publish to PyPI
45
+ needs: build
46
+ runs-on: ubuntu-latest
47
+ environment:
48
+ name: pypi
49
+ url: https://pypi.org/p/aibox-cli
50
+ permissions:
51
+ id-token: write # For trusted publishing
52
+
53
+ steps:
54
+ - uses: actions/download-artifact@v4
55
+ with:
56
+ name: dist
57
+ path: dist/
58
+
59
+ - name: Publish to PyPI
60
+ uses: pypa/gh-action-pypi-publish@release/v1
61
+
62
+ github-release:
63
+ name: Create GitHub Release
64
+ needs: build
65
+ runs-on: ubuntu-latest
66
+ permissions:
67
+ contents: write
68
+
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+
72
+ - uses: actions/download-artifact@v4
73
+ with:
74
+ name: dist
75
+ path: dist/
76
+
77
+ - name: Create Release
78
+ uses: softprops/action-gh-release@v2
79
+ with:
80
+ files: dist/*
81
+ generate_release_notes: true
82
+ draft: false
83
+ prerelease: false
@@ -0,0 +1,55 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test Python 3.12 on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ os: [ubuntu-latest, macos-latest]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v4
24
+
25
+ - name: Set up Python 3.12
26
+ run: uv python install 3.12
27
+
28
+ - name: Create virtual environment
29
+ run: uv venv
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ uv pip install -e ".[dev]"
34
+
35
+ - name: Run linter (ruff)
36
+ run: |
37
+ uv run ruff check aibox/
38
+
39
+ - name: Run formatter check (ruff)
40
+ run: |
41
+ uv run ruff format --check aibox/
42
+
43
+ - name: Run type checker (mypy)
44
+ run: |
45
+ uv run mypy aibox/
46
+
47
+ - name: Run unit tests
48
+ run: |
49
+ uv run pytest tests/unit -v --cov=aibox --cov-report=xml
50
+
51
+ - name: Upload coverage to Codecov
52
+ uses: codecov/codecov-action@v4
53
+ with:
54
+ file: ./coverage.xml
55
+ fail_ci_if_error: false
@@ -0,0 +1,326 @@
1
+ # =============================================================================
2
+ # Python
3
+ # =============================================================================
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ pip-wheel-metadata/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+ test-results/
56
+ .test_results/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+ docs/_static/
78
+ docs/_templates/
79
+
80
+ # PyBuilder
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ .python-version
92
+
93
+ # pipenv
94
+ Pipfile.lock
95
+
96
+ # PEP 582
97
+ __pypackages__/
98
+
99
+ # Celery stuff
100
+ celerybeat-schedule
101
+ celerybeat.pid
102
+
103
+ # SageMath parsed files
104
+ *.sage.py
105
+
106
+ # Environments
107
+ .env
108
+ .env.*
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+ *.env
116
+
117
+ # =============================================================================
118
+ # Development Tools
119
+ # =============================================================================
120
+
121
+ # mypy
122
+ .mypy_cache/
123
+ .dmypy.json
124
+ dmypy.json
125
+
126
+ # Pyre type checker
127
+ .pyre/
128
+
129
+ # pytype static type analyzer
130
+ .pytype/
131
+
132
+ # Ruff
133
+ .ruff_cache/
134
+
135
+ # uv
136
+ .uv/
137
+ .uv-cache/
138
+ uv.lock
139
+
140
+ # Pylint
141
+ .pylintrc.local
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # Spyder project settings
147
+ .spyderproject
148
+ .spyproject
149
+
150
+ # =============================================================================
151
+ # IDEs and Editors
152
+ # =============================================================================
153
+
154
+ # VSCode
155
+ .vscode/
156
+ *.code-workspace
157
+
158
+ # PyCharm / IntelliJ
159
+ .idea/
160
+ *.iml
161
+ *.iws
162
+ .idea_modules/
163
+
164
+ # Vim
165
+ *.swp
166
+ *.swo
167
+ *~
168
+ .vim/
169
+ *.un~
170
+
171
+ # Emacs
172
+ *~
173
+ \#*\#
174
+ .\#*
175
+ .emacs.desktop
176
+ .emacs.desktop.lock
177
+
178
+ # Sublime Text
179
+ *.sublime-project
180
+ *.sublime-workspace
181
+
182
+ # Eclipse
183
+ .project
184
+ .pydevproject
185
+ .settings/
186
+
187
+ # =============================================================================
188
+ # Operating System
189
+ # =============================================================================
190
+
191
+ # macOS
192
+ .DS_Store
193
+ .AppleDouble
194
+ .LSOverride
195
+ ._*
196
+ .DocumentRevisions-V100
197
+ .fseventsd
198
+ .Spotlight-V100
199
+ .TemporaryItems
200
+ .Trashes
201
+ .VolumeIcon.icns
202
+ .com.apple.timemachine.donotpresent
203
+
204
+ # Windows
205
+ Thumbs.db
206
+ ehthumbs.db
207
+ Desktop.ini
208
+ $RECYCLE.BIN/
209
+
210
+ # Linux
211
+ .directory
212
+ .Trash-*
213
+
214
+ # =============================================================================
215
+ # aibox Specific
216
+ # =============================================================================
217
+
218
+ # aibox runtime data (testing/development)
219
+ # This includes .aibox-ref files (machine-specific project references)
220
+ .aibox/
221
+ *.aibox/
222
+
223
+ # aibox temp directories
224
+ aibox-temp/
225
+ .aibox-temp/
226
+
227
+ # Test data directories
228
+ test_aibox_data/
229
+
230
+ # =============================================================================
231
+ # Personal / Private Data
232
+ # =============================================================================
233
+
234
+ # Claude CLI personal configuration (DO NOT COMMIT)
235
+ .claude/
236
+
237
+ # Personal notes and scratch files
238
+ NOTES.md
239
+ SCRATCH.md
240
+ TODO.personal.md
241
+ scratch/
242
+ notes/
243
+
244
+ # API keys and secrets (CRITICAL - DO NOT COMMIT)
245
+ *.key
246
+ *.pem
247
+ *.pfx
248
+ *.p12
249
+ secrets.*
250
+ credentials.*
251
+ .secrets
252
+ api_keys.*
253
+ *_secret.*
254
+ *-secret.*
255
+
256
+ # Local development overrides
257
+ *.local
258
+ *.local.*
259
+ config.local.*
260
+ settings.local.*
261
+
262
+ # Database files (development)
263
+ *.db
264
+ *.sqlite
265
+ *.sqlite3
266
+
267
+ # =============================================================================
268
+ # Docker
269
+ # =============================================================================
270
+
271
+ # Docker build context
272
+ .dockerignore.local
273
+ docker-compose.override.yml
274
+
275
+ # =============================================================================
276
+ # Temporary and Backup Files
277
+ # =============================================================================
278
+
279
+ # Temporary files
280
+ *.tmp
281
+ *.temp
282
+ *.bak
283
+ *.backup
284
+ *.old
285
+ *.orig
286
+ *-copy.*
287
+
288
+ # Backup directories
289
+ backup/
290
+ backups/
291
+ .backup/
292
+
293
+ # Temp Todos
294
+ TODO.md
295
+
296
+ # =============================================================================
297
+ # Logs and Debugging
298
+ # =============================================================================
299
+
300
+ # Log files
301
+ *.log
302
+ logs/
303
+ *.log.*
304
+
305
+ # Debug files
306
+ debug/
307
+ *.debug
308
+ .debug/
309
+
310
+ # Profiling
311
+ *.prof
312
+ *.pstats
313
+ .profiling/
314
+
315
+ # =============================================================================
316
+ # Project Specific Exclusions
317
+ # =============================================================================
318
+
319
+ # Keep migration reference materials (already tracked)
320
+ # aibox-migration/ is intentionally tracked
321
+
322
+ # Keep documentation (already tracked)
323
+ # README.md, CLAUDE.md, CONTRIBUTING.md are intentionally tracked
324
+
325
+ # Keep tests (already tracked)
326
+ # tests/ directory is intentionally tracked
@@ -0,0 +1,31 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Modules
4
+ `aibox/` houses the CLI, config models, container orchestration, profile definitions, and AI providers—keep domain logic in these subpackages so commands stay thin. `tests/` mirrors those modules (`tests/unit`, `tests/fixtures`), while `docs/` collects architecture, multi-agent, and configuration references; helpers live in `scripts/`. Treat `htmlcov/` as disposable coverage output.
5
+
6
+ ## Build, Test, and Development Commands
7
+ ```bash
8
+ uv pip install -e ".[dev]" # install runtime + dev extras
9
+ ruff check aibox tests # lint/import order
10
+ ruff format aibox tests # auto-format
11
+ mypy aibox # strict typing
12
+ pytest # full suite (markers/opts in pyproject)
13
+ pytest --cov=aibox --cov-report=html # coverage (≥80% floor)
14
+ pre-commit run --all-files
15
+ aibox --help # quick CLI smoke test
16
+ ```
17
+
18
+ ## Coding Style & Simple Design
19
+ Use Python 3.11+, 4-space indentation, and explicit type hints everywhere to satisfy strict `mypy`. Ruff enforces 100-character lines and naming; only `__init__.py` may ignore unused imports. Refactor using Kent Beck’s rules in priority order: all tests pass → intent is obvious → no duplication → fewest necessary elements. Document mass deltas when refactors stall.
20
+
21
+ ## TDD Workflow
22
+ Start every problem by listing base `pytest` cases (`it.todo()` conceptually) before activating exactly one test. Follow Red (compilation/runtime failure), Green (minimal implementation), and Refactor (mandatory improvement) phases with explicit “guessing game” predictions before each run. Stick to baby steps, resist lookahead, and never implement beyond the current failing test; update docs/tests together to keep coverage stable.
23
+
24
+ ## Human-in-the-Loop Checkpoints
25
+ After each phase summarize what happened (test chosen, prediction accuracy, implementation, refactors/mass changes) and pause for approval before moving on. If a prediction is wrong, stop and explain why before continuing or investigating per human guidance. No batch execution—every Red/Green/Refactor loop or phase transition requires confirmation.
26
+
27
+ ## Commit & Pull Request Guidance
28
+ History favors short, imperative subjects (`Add configuration system with Pydantic models`, `Fix GitHub Actions CI workflow`, `chore: remove all ClaudeBox references`). Keep scopes tight, pair code/tests/docs/`CHANGELOG.md` updates, and avoid WIP commits. Pull requests should link issues, describe user-visible CLI effects, include `pytest`/`ruff` snippets, and add Rich output screenshots when formatting changes.
29
+
30
+ ## Security & Configuration
31
+ Never commit provider credentials; rely on `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` in your shell. Keep `.aibox/config.yml` examples minimal, document new schema fields in `docs/configuration.md`, and ensure `aibox init` plus `slot add` stay backward compatible without secrets to protect CI runs.