Metadata-Version: 2.4
Name: lifecycle-runner
Version: 0.1.1
Summary: Run a command to completion with a time limit: capture it, stream it, or log it (implements commandport).
Author: Brian Powers
License-Expression: MIT
Project-URL: Homepage, https://github.com/112345brian/launch-runner
Project-URL: Repository, https://github.com/112345brian/launch-runner
Project-URL: Issues, https://github.com/112345brian/launch-runner/issues
Keywords: subprocess,process,timeout,windows,console,capture,stream
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: commandport==0.1.1
Requires-Dist: proclaunch==0.1.1
Dynamic: license-file

# lifecycle-runner

Run a local command to completion. Three operations over one contract (`commandport`):

```python
from commandport.domain import CaptureSpec, RunSpec, StreamSpec
from lifecycle_runner.api import capture, run, stream

done = capture(CaptureSpec(("git", "rev-parse", "HEAD"), timeout_seconds=15))
if done.ok:
    print(done.stdout.strip())

for line in stream(StreamSpec(("pytest", "-q"), timeout_seconds=600)):   # a LineStream
    print(line, end="")

run(RunSpec(("make", "build"), inherit_stdio=True))   # attached to this console, or windowless without one
```

Also a scheduler-task entry point: `python -m lifecycle_runner --log run.log --timeout 1800 -- cmd args...`.

Tests: `lifecycle_runner.api.use_commands(commandport.testing.FakeCommandRunner())`.

It depends on `proclaunch` only for the one definition of "no console window" and the process-tree kill.
