Skip to content

Commit cc8b615

Browse files
committed
Mettre a jour la documentation des engines et de la CLI
1 parent 844addc commit cc8b615

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Build Python apps with a predictable workflow, a configurable pre-compile pipeli
1919
- **BuildContext-driven builds**: engines receive a normalized project context, abstracting away the source of configuration (YAML vs. Lock files).
2020
- **Multi-engine support**: switch between PyInstaller, Nuitka, and cx_Freeze seamlessly.
2121
- **Extensible SDKs**: create new engines and BCASL plugins using simplified, consolidated APIs.
22-
- **Zero-Config auto-mapping for 80+ libraries**: automatic import detection via requirements covers major AI, modern web, data science, and automation stacks, with engine-specific arguments applied without manual tuning.
22+
- **Core auto-mapping for 80+ libraries**: automatic import detection from requirements and imports covers major AI, modern web, data science, and automation stacks, with engine-specific arguments applied through the engine mapping layer.
2323
- **Simplified build inclusions**: `build.include` forces package bundling and ARK translates it automatically per engine.
2424
- **Workspace-first UI**: filter files, manage exclusions, and follow progress and logs in one place.
2525
- **Venv-aware execution**: engines can use the project virtual environment automatically.
@@ -54,45 +54,56 @@ The PyCompiler ARK CLI provides a structured set of commands for workspace manag
5454

5555
```bash
5656
# Workspace Initialization
57-
python3 -m pycompiler_ark init --entry src/main.py [--icon icon.ico] [--with-venv]
57+
pycompiler_ark init --entry <path> [--icon <path>] [--with-venv] [--install-requirements] [--generate-requirements] [--apply-internal] [-y|--yes]
5858

5959
# Building
60-
python3 -m pycompiler_ark build # Build using ark.yml engine
61-
python3 -m pycompiler_ark build --engine nuitka # Override engine
62-
python3 -m pycompiler_ark build --lock latest # Rebuild from the latest lock file
60+
pycompiler_ark build [-y|--yes] [-v|--verbose] [--json]
61+
pycompiler_ark build --engine <id> [-y|--yes]
62+
pycompiler_ark build --lock [file] [-y|--yes]
6363

6464
# Execution
65-
python3 -m pycompiler_ark run bcasl # Execute BCASL pipeline
66-
python3 -m pycompiler_ark run bcasl --list-plugins # List active plugins
65+
pycompiler_ark run bcasl [-y|--yes] [--list-plugins]
6766

6867
# GUI
69-
python3 -m pycompiler_ark gui # Launch modern IDE-like GUI
70-
python3 -m pycompiler_ark gui --legacy # Launch classic GUI
68+
pycompiler_ark gui
69+
pycompiler_ark gui --legacy
7170
```
7271

7372
### Developer Commands
7473

7574
```bash
7675
# Discovery
77-
python3 -m pycompiler_ark list engines # List available engines
78-
python3 -m pycompiler_ark list plugins # List available BCASL plugins
76+
pycompiler_ark list engines
77+
pycompiler_ark list plugins
78+
79+
# Configuration
80+
pycompiler_ark set user-engine-dir <path>
81+
pycompiler_ark set user-plugin-dir <path>
82+
pycompiler_ark set dev-engine-dir <path>
83+
pycompiler_ark set dev-plugin-dir <path>
84+
85+
pycompiler_ark get user-engine-dir
86+
pycompiler_ark get user-plugin-dir
87+
pycompiler_ark get dev-engine-dir
88+
pycompiler_ark get dev-plugin-dir
7989

80-
# Configuration (User Paths)
81-
python3 -m pycompiler_ark set user-engine-dir /path # Set custom engine directory
82-
python3 -m pycompiler_ark get user-engine-dir # Retrieve path
90+
pycompiler_ark unset user-engine-dir
91+
pycompiler_ark unset user-plugin-dir
92+
pycompiler_ark unset dev-engine-dir
93+
pycompiler_ark unset dev-plugin-dir
8394

8495
# Scaffolding
85-
python3 -m pycompiler_ark scaffold engine demo # Create a new engine template
86-
python3 -m pycompiler_ark scaffold plugin-bcasl demo # Create a new BCASL plugin template
96+
pycompiler_ark scaffold engine <name> [--path <dir>]
97+
pycompiler_ark scaffold plugin-bcasl <name> [--path <dir>]
8798
```
8899

89100
### JSON Output
90101

91102
For CI/CD and scripting, key commands support the `--json` flag to return machine-readable results:
92103

93104
```bash
94-
python3 -m pycompiler_ark build --json
95-
python3 -m pycompiler_ark init --entry main.py --json
105+
pycompiler_ark build --json
106+
pycompiler_ark init --entry main.py --json
96107
```
97108

98109
---

docs/how_to_create_an_engine.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A PyCompiler ARK engine is a Python package placed in `pycompiler_ark/engines/<e
1717

1818
- `pycompiler_ark/engines/<engine_id>/__init__.py`: engine code, registration, UI.
1919
- `pycompiler_ark/engines/<engine_id>/languages/<code>.json`: optional translations.
20-
- `pycompiler_ark/engines/<engine_id>/mapping.json`: optional mapping for the auto-builder.
20+
- `pycompiler_ark/engines/<engine_id>/mapping.json`: optional mapping used by the core auto-mapping system.
2121
- Optional internal modules, assets, helpers.
2222

2323
#### **Minimal Example**
@@ -323,26 +323,15 @@ Notes.
323323
- `load_engine_language_file(engine_package, lang)` is still available if you need custom/manual loading.
324324
- If a key is missing, always provide a safe fallback string.
325325

326-
**Auto Command Builder (Integrated)**
327-
The auto-builder is integrated into the core compilation pipeline. It can read
328-
`mapping.json` from the engine package, the workspace `engines/<engine_id>/`
329-
folder, or the `PYCOMPILER_MAPPING` environment variable to generate options
330-
from detected modules.
326+
**Core Auto-Mapping**
327+
PyCompiler ARK handles auto-mapping in the core pipeline. Engine authors do
328+
not need to implement a separate auto-mapping layer in their engine code.
331329

332-
PyCompiler ARK expands this layer into a zero-config auto-mapping system that
333-
applies engine-specific flags automatically when imports are detected, so
334-
engine authors only need to fill the gaps not covered by the core mapping
335-
catalog.
330+
For engines that need import-to-flag mapping, provide a `mapping.json` file in
331+
the engine package. The core reads it and merges the generated flags into the
332+
final command.
336333

337-
You no longer need to call `compute_auto_for_engine` manually in your `build_command`. The core runner will:
338-
339-
1. Prefer `requirements.txt` or `requirements.in` when present.
340-
2. Fall back to `pyproject.toml` dependencies.
341-
3. Fall back to scanning Python imports.
342-
4. Read the engine mapping and generate the appropriate flags.
343-
5. Insert them into your command, usually before the entry point.
344-
345-
#### **Minimal mapping.json example.**
334+
#### **Minimal `mapping.json` example**
346335

347336
```json
348337
{
@@ -360,12 +349,12 @@ You no longer need to call `compute_auto_for_engine` manually in your `build_com
360349
Key points.
361350

362351
- Top-level keys are package names.
363-
- Engine values accept `str`, `list[str]`, or `dict` with `args` or `flags`.
352+
- Engine values can be strings, lists of flags, or structured objects accepted
353+
by the core mapping parser.
364354
- `"{import_name}"` is replaced by the matched import name.
365355
- Use `build.include` when a package must be bundled even if the core mapping
366356
or import scanner does not trigger it automatically.
367-
- For advanced logic, expose `AUTO_BUILDER`, `get_auto_builder()`, or
368-
`register_auto_builder()` in `pycompiler_ark/engines/<engine_id>/auto_plugins.py` or the workspace `engines/<engine_id>/auto_plugins.py`.
357+
- Engine authors only need to maintain `mapping.json` for this layer.
369358

370359
**Deep Examples Catalog (40)**
371360
Each example includes context, intent, and a working pattern. Adjust IDs and labels to match your engine.

0 commit comments

Comments
 (0)