Skip to content

Commit 4d9624c

Browse files
authored
chore(documentation): correct exec advice (#738)
1 parent 2b15fa6 commit 4d9624c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎llms.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
- Prefer SDK methods (`sdk.devbox`, `sdk.blueprint`, etc.) for object-oriented patterns and convenience
2424
- For resources without SDK coverage (e.g., secrets, benchmarks), use `sdk.api.*` as a fallback
2525
- Use `sdk.devbox.create()` to create devboxes; they auto-await readiness
26-
- Execute commands with `devbox.cmd.exec('command')`, not raw API calls
27-
- Always call `devbox.shutdown()` to clean up resources
26+
- Use `devbox.cmd.exec('command')` for most commands—blocks until completion, returns `ExecutionResult` with stdout/stderr
27+
- Use `devbox.cmd.execAsync('command')` for long-running or background processes (servers, watchers)—returns immediately with `Execution` handle to check status, get result, or kill
28+
- Both `exec` and `execAsync` support streaming callbacks (`stdout`, `stderr`, `output`) for real-time output
29+
- Call `devbox.shutdown()` to clean up resources that are no longer in use.
2830
- In example files, focus on the `recipe` function body for SDK usage patterns; ignore test harness files in the examples folder (`_harness.ts`, `registry.ts`, `types.ts`)
2931

3032
## Optional

0 commit comments

Comments
 (0)