You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**When the user asks to create, initialize, or start a new task, always use `lab task init`** rather than writing `task.yaml` / `main.py` by hand. It scaffolds both files with sensible defaults in the current directory so the user has a working starting point.
lab task init --interactive # prompts for name, CPUs, memory, setup, and run command
113
+
```
114
+
115
+
- Default mode is non-interactive. It creates `task.yaml` (with `name`, `resources: {cpus: 2, memory: 4}`, and `run: python main.py`) and a starter `main.py`. Existing files are skipped, not overwritten.
116
+
-`--interactive` writes only `task.yaml` (no `main.py`) and prompts for each field. In this mode `task.yaml` will prompt before overwrite.
117
+
- After init, edit `main.py`, customize `task.yaml`, then run `lab task add .` to upload it.
118
+
105
119
### task.yaml Structure
106
120
107
121
Full docs: https://lab.cloud/for-teams/running-a-task/task-yaml-structure
@@ -291,6 +305,7 @@ This applies to launching jobs, fetching logs, checking cluster status, and ever
291
305
| `lab version` | Show CLI version | No |
292
306
| `lab task list` | List tasks in current experiment | Yes |
293
307
| `lab task info <id>` | Get task details | Yes |
308
+
| `lab task init` | Scaffold `task.yaml` + `main.py` in the current directory (`--interactive` to prompt) | No |
294
309
| `lab task add [dir]` | Add task from directory or `--from-git` URL (`--no-interactive`, `--dry-run`) | Yes |
295
310
| `lab task delete <id>` | Delete a task (`--no-interactive` to skip confirmation) | Yes |
Scaffold a new task in the current directory. **Prefer this over writing `task.yaml` by hand.** Does not require an experiment to be set.
104
+
105
+
| Option | Description |
106
+
|---|---|
107
+
| (default, no flag) | Non-interactive. Creates `task.yaml` with defaults (`name` = folder name, `cpus: 2`, `memory: 4`, `run: python main.py`) and a starter `main.py`. Existing files are skipped, not overwritten. |
108
+
|`--interactive`| Prompts for task name, CPUs, memory, accelerators, setup, and run command. Writes only `task.yaml` (no `main.py`). Prompts before overwriting an existing `task.yaml`. |
0 commit comments