|
| 1 | +# **PyCompiler ARK CLI Specification v1.2** |
| 2 | + |
| 3 | +This document defines the final, streamlined specification for the PyCompiler ARK Command Line Interface. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +### **1. Philosophy** |
| 8 | + |
| 9 | +The CLI is designed to be simple, predictable, and headless-friendly. |
| 10 | + |
| 11 | +- **Unified Binary**: Use `pycompiler-ark` (or `python pycompiler_ark.py`). |
| 12 | +- **Explicit Commands**: No hidden magic; every action requires an explicit command. |
| 13 | +- **CLI-First**: All features accessible via GUI are also available via CLI. |
| 14 | +- **Reproducibility**: Guaranteed via functional locking comparison. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +### **2. Final Commands** |
| 19 | + |
| 20 | +```bash |
| 21 | +# Workspace (User) |
| 22 | +pycompiler-ark init --entry <path> [--icon <path>] [--with-venv] [--install-requirements] [--generate-requirements] |
| 23 | +pycompiler-ark build |
| 24 | +pycompiler-ark build --engine <id> |
| 25 | +pycompiler-ark build --lock [file] |
| 26 | + |
| 27 | +# Execution |
| 28 | +pycompiler-ark run bcasl |
| 29 | + |
| 30 | +# GUI |
| 31 | +pycompiler-ark gui |
| 32 | +pycompiler-ark gui --legacy |
| 33 | + |
| 34 | +# Configuration (Developer) |
| 35 | +pycompiler-ark set user-engine-dir <path> |
| 36 | +pycompiler-ark set user-plugin-dir <path> |
| 37 | +pycompiler-ark set dev-engine-dir <path> |
| 38 | +pycompiler-ark set dev-plugin-dir <path> |
| 39 | + |
| 40 | +pycompiler-ark get user-engine-dir |
| 41 | +pycompiler-ark get user-plugin-dir |
| 42 | +pycompiler-ark get dev-engine-dir |
| 43 | +pycompiler-ark get dev-plugin-dir |
| 44 | + |
| 45 | +pycompiler-ark unset user-engine-dir |
| 46 | +pycompiler-ark unset user-plugin-dir |
| 47 | +pycompiler-ark unset dev-engine-dir |
| 48 | +pycompiler-ark unset dev-plugin-dir |
| 49 | + |
| 50 | +# Discovery |
| 51 | +pycompiler-ark list engines |
| 52 | +pycompiler-ark list plugins |
| 53 | + |
| 54 | +# Scaffolding |
| 55 | +pycompiler-ark scaffold engine <name> [--path <dir>] |
| 56 | +pycompiler-ark scaffold plugin-bcasl <name> [--path <dir>] |
| 57 | +``` |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +### **3. GUI Status** |
| 62 | + |
| 63 | +| GUI Mode | Command | Status | |
| 64 | +| :--- | :--- | :--- | |
| 65 | +| **IDE-like GUI** | `pycompiler-ark gui` | **Active** (Modern, full feature set) | |
| 66 | +| **Classic GUI** | `pycompiler-ark gui --legacy` | **Frozen** (Legacy maintenance only) | |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +### **4. Engine and Plugin Discovery** |
| 71 | + |
| 72 | +PyCompiler ARK loads components from multiple locations in order of priority: |
| 73 | + |
| 74 | +| Tier | Role | Default Location | |
| 75 | +| :--- | :--- | :--- | |
| 76 | +| **Dev** | Development | Optional (set via `pycompiler-ark set dev-*`) | |
| 77 | +| **User** | User-installed | `~/ark_user/` (created automatically) | |
| 78 | +| **Core** | Built-in engines | `ENGINES/` folder in installation root | |
| 79 | + |
| 80 | +**Priority**: `Dev > User > Core` |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +### **5. Configuration (~/.arkconf/)** |
| 85 | + |
| 86 | +Global user settings are stored in text files under `~/.arkconf/`: |
| 87 | + |
| 88 | +- `pref.json`: Global GUI and runtime preferences. |
| 89 | +- `user_engine_dir`: Path to user-installed engines. |
| 90 | +- `user_plugin_dir`: Path to user-installed BCASL plugins. |
| 91 | +- `dev_engine_dir`: Path to active engine development. |
| 92 | +- `dev_plugin_dir`: Path to active plugin development. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +### **6. Workspace Structure (.ark/)** |
| 97 | + |
| 98 | +A initialized workspace contains a hidden `.ark/` directory: |
| 99 | + |
| 100 | +- `lock/`: Immutable build snapshots and `latest.lock.yml`. |
| 101 | +- `cache/`: Internal build cache and rebuild comparison data. |
| 102 | +- `build/`: Temporary engine build artifacts. |
| 103 | +- `logs/`: Compilation and pipeline execution logs. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +### **7. Configuration (ark.yml)** |
| 108 | + |
| 109 | +The project configuration file: |
| 110 | + |
| 111 | +```yaml |
| 112 | +project: |
| 113 | + name: my_app |
| 114 | + version: 1.0.0 |
| 115 | + entry: src/main.py |
| 116 | + |
| 117 | +workspace: |
| 118 | + exclude: |
| 119 | + - "**/__pycache__/**" |
| 120 | + |
| 121 | +build: |
| 122 | + engine: nuitka |
| 123 | + output: dist/ |
| 124 | + exclude: |
| 125 | + - "tests/**/*" |
| 126 | + data: |
| 127 | + - source: plugins/ |
| 128 | + destination: plugins/ |
| 129 | + icon: assets/icon.ico |
| 130 | + |
| 131 | +plugins: |
| 132 | + bcasl_enabled: true |
| 133 | +``` |
| 134 | +
|
| 135 | +--- |
| 136 | +
|
| 137 | +### **8. Detailed Command Behavior** |
| 138 | +
|
| 139 | +#### **`pycompiler-ark init --entry <path>`** |
| 140 | + |
| 141 | +Initializes the current directory as a PyCompiler ARK workspace. |
| 142 | + |
| 143 | +- **Requirement**: The directory must already exist. |
| 144 | +- **Validation**: `--entry` must point to a file, not a directory. |
| 145 | + |
| 146 | +#### **`pycompiler-ark build`** |
| 147 | + |
| 148 | +- **Default**: Validates `ark.yml` and builds using the configured engine. |
| 149 | +- **Engine Override**: `--engine <id>` uses a temporary engine without modifying `ark.yml`. |
| 150 | +- **Reproducible Rebuild**: `--lock [file]` rebuilds strictly from a lock file (default: `.ark/lock/latest.lock.yml`). |
| 151 | + - **Git State**: Automatically verifies if the current branch and commit match the lock. Offers automatic checkout on Linux. |
| 152 | + - **Integrity Check**: PyCompiler ARK generates a shadow lock from the rebuild environment and performs a **Functional Equivalence** comparison. Detailed diffs are displayed in case of mismatch. |
| 153 | +- **Constraint**: `--engine` and `--lock` cannot be used together. |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +### **9. Summary Rules** |
| 158 | + |
| 159 | +- **CLI1**: No interactive questions; behavior is strictly deterministic. |
| 160 | +- **CLI2**: `pycompiler-ark init` only operates on the current working directory. |
| 161 | +- **CLI3**: All build artifacts and metadata stay inside the workspace `.ark/` folder. |
| 162 | +- **CLI4**: Engines and plugins follow a clear `dev > user > core` priority. |
| 163 | + |
| 164 | +--- |
| 165 | +*End of Specification v1.2* |
0 commit comments