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
{{ message }}
Repository navigation
Commit 0454291
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .kiro/steering/openclaw_runware.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,38 +2,38 @@
2
2
inclusion: always
3
3
---
4
4
5
-
# OpenClaw Runware Skill
5
+
# OpenClaw Runware skill
6
6
7
-
Multi-modal Runware.ai skill for OpenClaw: image, video, audio, text, and 3D generation through the official `runware-sdk`, plus MCP-style tooling. Python 3.11+.
7
+
Multi-modal Runware.ai skill for OpenClaw: image, video, audio, text, and 3D generation through the official `runware-sdk` library and MCP tooling. Requires Python 3.11+.
8
8
9
9
## Architecture
10
10
11
-
-`scripts/generate.py` — main CLI generator. Builds a task payload from `--mode` (`image`/`video`/`audio`/`text`/`3d`), sends it via the async`Runware` client, saves each result to disk.
-`skill-config.json` — non-secret defaults (`default_size`, `default_format`, `default_output_dir`); `last_output_dir` is auto-updated by `generate.py` after a save.
14
-
-`RUNWARE_API_KEY` comes from `.env` (see `.env_sample`) or the environment — never from`skill-config.json`.
15
-
- Both scripts open the SDK client per call as an async context manager: `async with Runware(api_key=..., transport="rest") as client:`. Don't hold a client open across multiple requests.
16
-
-This is v2: generation always goes through `runware-sdk`'s `Runware` client. Don't reintroduce raw `requests.post` calls to the old REST API or resurrect `generate_image.py`.
11
+
-`scripts/generate.py`: Main CLI generator. Builds task payloads from `--mode` (`image`, `video`, `audio`, `text`, `3d`), submits requests via an asynchronous`Runware` client session, and saves outputs to disk.
12
+
-`scripts/runware_mcp.py`: MCP CLI exposing discrete tools (`run`, `list-models`, `model-pricing`, `model-details`, `account`) matching the hosted Runware MCP server tool catalog.
13
+
-`skill-config.json`: Non-sensitive configuration defaults (`default_size`, `default_format`, `default_output_dir`). The `last_output_dir`property is updated automatically by `generate.py` after writing an output file.
14
+
-`RUNWARE_API_KEY`: Sourced from `.env` (see `.env_sample`) or system environment variables. Never stored in`skill-config.json`.
15
+
-SDK sessions: Both scripts initialize `Runware`as an asynchronous context manager (`async with Runware(api_key=..., transport="rest") as client:`). Do not share or persist client connections across separate runs.
16
+
-Generation engine: Generation routes through `runware-sdk`. Avoid raw REST requests or legacy standalone image scripts.
17
17
18
18
## Conventions
19
19
20
-
-Target Python 3.11+; use PEP 604 unions (`str | None`), not`Optional[str]`.
21
-
- Import the SDK lazily/defensively (`_import_runware()`), printing a `pip install runware-sdk` hint and `sys.exit(1)` on `ImportError` instead of letting it raise.
22
-
-Module-private helpers are prefixed with `_` (`_parse_size`, `_slugify`, `_resolve_outpath`, etc.) and are the pytest-covered unit surface — keep new helpers named and tested the same way.
23
-
- CLI parsing uses`argparse`. When a change applies to both entry points, update `generate.py` and `runware_mcp.py` together.
24
-
-Modes are driven by lookup tables (`SUPPORTED_MODES`, `MODES_TO_TASKTYPE`, `MODES_TO_EXT`, `_default_model()`). Adding a modality means extending all of them, per `CONTRIBUTING.md`.
25
-
- Catch `RunwareError`(has `.code`) before a generic `Exception`fallback; report failures to `stderr` and exit non-zero rather than letting a traceback surface to the CLI user.
26
-
-Settings precedence is CLI flag > `skill-config.json`value > hardcoded default — preserve this order when adding new configurable options.
20
+
-Python runtime: Python 3.11+. Use PEP 604 union syntax (`str | None`) rather than`Optional[str]`.
21
+
-Dependency checks: Import the SDK with `_import_runware()`, logging a `pip install runware-sdk` hint and exiting with code 1 when the package is missing.
22
+
-Private helpers: Prefix internal utilities with `_` (`_parse_size`, `_slugify`, `_resolve_outpath`, etc.) and maintain unit test coverage in `tests/`.
23
+
- CLI arguments: Use`argparse`. Keep flags and options consistent across `generate.py` and `runware_mcp.py`.
24
+
-Modality mapping: Modalities are defined in `SUPPORTED_MODES`, `MODES_TO_TASKTYPE`, `MODES_TO_EXT`, and `_default_model()`. Adding a modality requires updating all mappings and test cases.
25
+
-Error handling: Catch `RunwareError` before general `Exception`handlers. Write error details to `sys.stderr` and exit with a non-zero code.
26
+
-Configuration precedence: Command-line arguments override `skill-config.json`values, which override module defaults.
27
27
28
-
## Safety & secrets
28
+
## Safety and secrets
29
29
30
-
-Never log, print, or persist `RUNWARE_API_KEY` or any credential.
31
-
-`skill-config.json`is committed — keep it secret-free.
32
-
-Keep `_validate_prompt()`'s minor-safety check intact when touching prompt handling; it must hard-block (exit non-zero), not just warn, despite the "WARNING" text in its message.
33
-
-Don't remove `.env`from `.gitignore`; use placeholders (e.g. `your_key_here`) in examples and docs, never real keys.
30
+
-Do not log, print, or persist API credentials.
31
+
-Keep `skill-config.json`free of credentials.
32
+
-Retain prompt validation in `_validate_prompt()` to block requests referencing minors.
33
+
-Ensure `.env`is ignored by git. Use placeholder strings in example commands.
34
34
35
-
## Testing & docs
35
+
## Testing and documentation
36
36
37
-
- Unit tests live in `tests/test_generate.py`, one `Test*` class per function under test. Run with `pytest -q`.
38
-
-The integration test skips automatically without `RUNWARE_API_KEY`(`skipif`); CI (`.github/workflows/ci.yml`) runs Python 3.11–3.13 with `pytest -q -m "not integration"`.
39
-
-`README.md` and `SKILL.md` both carry CLI flag tables and quick-start snippets — update both when CLI behavior changes, and add matching usage examples to `examples/README.md`.
37
+
- Unit tests reside in `tests/test_generate.py` and `tests/test_runware_mcp.py`. Run tests using `pytest -q -m "not integration"`.
38
+
-Live integration tests require `RUNWARE_API_KEY`and are marked with `integration`.
39
+
-Maintain CLI reference tables and quickstart examples in both `README.md`and `SKILL.md` when command options change.
Thank you for your interest in improving this skill!
3
+
Thank you for helping improve this project.
4
4
5
-
## Getting Started
5
+
## Getting started
6
6
7
-
1. Fork the repository and submit a pull request against `main`.
8
-
2. Install development dependencies: `pip install -r requirements.txt`
9
-
3. Run tests: `pytest -q`
10
-
4.For integration tests, set `RUNWARE_API_KEY` in your environment.
7
+
1. Fork the repository and open a pull request against `main`.
8
+
2. Install development packages: `pip install -r requirements.txt`
9
+
3. Run the test suite: `pytest -q -m "not integration"`
10
+
4.To run live integration tests, set `RUNWARE_API_KEY` in your environment.
11
11
12
12
## Guidelines
13
13
14
-
-**Keep changes focused** — open separate PRs for separate features
15
-
-**Include tests** — add unit tests for new behaviors, update existing tests when behavior changes
16
-
-**Update docs** — if you add a feature, update `SKILL.md`, `README.md`, and examples as appropriate
17
-
-**Use clear commit messages** — reference issue numbers where applicable
18
-
-**Minimal dependencies** — avoid adding new packages unless necessary
14
+
- Keep pull requests focused on a single change or feature.
15
+
- Include unit tests for bug fixes or new functionality.
16
+
- Update `SKILL.md`, `README.md`, and `examples/README.md` when changing CLI arguments or default settings.
17
+
-Write clear commit messages.
18
+
-Keep external dependencies minimal.
19
19
20
-
## Adding a New Mode
20
+
## Adding a new mode
21
21
22
-
To add a new generation mode (e.g., a new modality):
22
+
When adding a new generation modality:
23
23
24
-
1.Add the mode to `SUPPORTED_MODES`, `MODES_TO_TASKTYPE`, `MODES_TO_EXT`, and `_default_model()` in `scripts/generate.py`
25
-
2.Add the corresponding `--mode`choice in `scripts/runware_mcp.py`
26
-
3.Update tests accordingly
27
-
4. Add example commands to`examples/README.md`
24
+
1.Update `SUPPORTED_MODES`, `MODES_TO_TASKTYPE`, `MODES_TO_EXT`, and `_default_model()` in `scripts/generate.py`.
25
+
2.Update the `--mode`choices in `scripts/runware_mcp.py`.
26
+
3.Add corresponding tests in `tests/test_generate.py` and `tests/test_runware_mcp.py`.
27
+
4. Add example commands in`examples/README.md`.
28
28
29
-
## Reporting Issues
29
+
## Reporting issues
30
30
31
-
Open issues for bugs, feature requests, or documentation corrections. Include steps to reproduce and minimal examples when possible.
31
+
Open an issue for bugs, documentation errors, or feature suggestions. Please include steps to reproduce unexpected behavior and sample inputs when possible.
**Multi-modal Runware.ai skill** — image, video, audio, text, and 3D generation via the official `runware-sdk` Python library, plus MCP-style tooling.
7
+
OpenClaw skill for media generation with the official Runware Python SDK (`runware-sdk`) and Model Context Protocol (MCP) tooling. Supports image, video, audio, text, and 3D generation.
8
8
9
-
This repository contains an OpenClaw-compatible skill that connects to [Runware.ai's MCP server](https://runware.ai/mcp) and exposes a clean Python CLI for generating media, browsing models, checking pricing, and managing your account.
9
+
This repository connects to the [Runware MCP server](https://runware.ai/mcp) and provides a Python CLI to generate media, browse models, check pricing, and check account balances.
10
10
11
-
## Features
11
+
## Capabilities
12
12
13
-
-**Multi-modal** — Generate images, videos, audio, text, and 3D models
0 commit comments