@miketromba/ploof 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +278 -0
- package/SPEC.md +426 -0
- package/dist/ploof.js +313 -0
- package/package.json +74 -0
- package/skills/asset-generation/SKILL.md +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michael Tromba
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<strong>Ploof</strong>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
AI asset generation from the command line.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@miketromba/ploof"><img src="https://img.shields.io/npm/v/@miketromba/ploof" alt="npm version" /></a>
|
|
11
|
+
<a href="https://github.com/miketromba/ploof/actions/workflows/ci.yml"><img src="https://github.com/miketromba/ploof/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
12
|
+
<a href="https://github.com/miketromba/ploof/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@miketromba/ploof" alt="license" /></a>
|
|
13
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="node version" />
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
Ploof is a CLI for generating and editing creative assets with AI providers. It supports OpenAI image generation and editing today, with a provider registry designed for audio, video, and broader model marketplaces over time.
|
|
17
|
+
|
|
18
|
+
It is built for both developers and AI agents: predictable commands, parseable output, local auth profiles, YAML manifests, parallel execution, and a companion skill.
|
|
19
|
+
|
|
20
|
+
## Supported Today
|
|
21
|
+
|
|
22
|
+
| Area | Status |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| OpenAI auth profiles | Supported |
|
|
25
|
+
| OpenAI image generation | Supported |
|
|
26
|
+
| OpenAI image editing | Supported |
|
|
27
|
+
| Context images and masks | Supported |
|
|
28
|
+
| YAML/JSON batch manifests | Supported |
|
|
29
|
+
| Dependency-aware parallel runs | Supported |
|
|
30
|
+
| Agent instructions via `ploof learn` | Supported |
|
|
31
|
+
| Additional providers | Planned |
|
|
32
|
+
| Audio/video generation | Planned |
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun i -g @miketromba/ploof
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Other package managers:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @miketromba/ploof
|
|
44
|
+
pnpm add -g @miketromba/ploof
|
|
45
|
+
yarn global add @miketromba/ploof
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run without installing:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bunx @miketromba/ploof --help
|
|
52
|
+
npx @miketromba/ploof --help
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Authenticate
|
|
59
|
+
ploof login openai --api-key <your-api-key>
|
|
60
|
+
|
|
61
|
+
# Generate an image
|
|
62
|
+
ploof image generate \
|
|
63
|
+
--prompt "Studio product photo of a matte black water bottle" \
|
|
64
|
+
--out assets/hero.png \
|
|
65
|
+
--model gpt-image-1 \
|
|
66
|
+
--size 1024x1024
|
|
67
|
+
|
|
68
|
+
# Edit an image with context
|
|
69
|
+
ploof image edit \
|
|
70
|
+
--image assets/input.png \
|
|
71
|
+
--mask assets/mask.png \
|
|
72
|
+
--prompt "Replace the background with a clean marble countertop" \
|
|
73
|
+
--out assets/edited.png
|
|
74
|
+
|
|
75
|
+
# Run a manifest
|
|
76
|
+
ploof run assets.yaml --parallel 4
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Authentication
|
|
80
|
+
|
|
81
|
+
Credentials are stored locally in `~/.ploof/credentials.json`.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
ploof login openai --api-key <your-api-key>
|
|
85
|
+
ploof login openai --api-key <your-api-key> --profile work
|
|
86
|
+
ploof whoami openai
|
|
87
|
+
ploof profiles openai
|
|
88
|
+
ploof logout openai --profile work
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If `--api-key` is omitted, `ploof login openai` reads
|
|
92
|
+
`PLOOF_OPENAI_API_KEY` or `OPENAI_API_KEY`; in an interactive terminal it will
|
|
93
|
+
prompt for a key without echoing it.
|
|
94
|
+
|
|
95
|
+
Environment variables override stored credentials:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
export PLOOF_OPENAI_API_KEY=sk-...
|
|
99
|
+
# or
|
|
100
|
+
export OPENAI_API_KEY=sk-...
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
OpenAI profile metadata:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
ploof login openai \
|
|
107
|
+
--api-key <key> \
|
|
108
|
+
--organization <org-id> \
|
|
109
|
+
--project <project-id> \
|
|
110
|
+
--base-url <url>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Image Generation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
ploof image generate \
|
|
117
|
+
--provider openai \
|
|
118
|
+
--profile default \
|
|
119
|
+
--prompt "Editorial portrait, dramatic side light" \
|
|
120
|
+
--out assets/portrait.png \
|
|
121
|
+
--model gpt-image-1 \
|
|
122
|
+
--size 1024x1024 \
|
|
123
|
+
--quality high \
|
|
124
|
+
--format png
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Useful flags:
|
|
128
|
+
|
|
129
|
+
| Flag | Description |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `--model <model>` | Provider model |
|
|
132
|
+
| `--size <size>` | Image size |
|
|
133
|
+
| `--quality <quality>` | Image quality |
|
|
134
|
+
| `--format <format>` | Output image format |
|
|
135
|
+
| `--n <count>` | Number of images |
|
|
136
|
+
| `--background <value>` | Background setting |
|
|
137
|
+
| `--moderation <value>` | Moderation setting |
|
|
138
|
+
| `--response-format <format>` | Provider response format |
|
|
139
|
+
| `--stream` | Request streaming image events |
|
|
140
|
+
| `--param key=value` | Provider-specific pass-through parameter |
|
|
141
|
+
| `--json '{...}'` | Provider-specific JSON object |
|
|
142
|
+
|
|
143
|
+
## Image Editing
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
ploof image edit \
|
|
147
|
+
--provider openai \
|
|
148
|
+
--image input.png \
|
|
149
|
+
--image reference.png \
|
|
150
|
+
--mask mask.png \
|
|
151
|
+
--prompt "Keep the product, replace the background" \
|
|
152
|
+
--out edited.png
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Use repeated `--image` flags for context/reference images. Use `--mask` when the selected provider/model supports masked edits.
|
|
156
|
+
|
|
157
|
+
## Batch Manifests
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
version: 1
|
|
161
|
+
parallel: 4
|
|
162
|
+
tasks:
|
|
163
|
+
- id: base
|
|
164
|
+
kind: image.generate
|
|
165
|
+
provider: openai
|
|
166
|
+
prompt: "Studio product photo"
|
|
167
|
+
params:
|
|
168
|
+
model: gpt-image-1
|
|
169
|
+
size: 1024x1024
|
|
170
|
+
quality: high
|
|
171
|
+
output: assets/base.png
|
|
172
|
+
|
|
173
|
+
- id: edit
|
|
174
|
+
kind: image.edit
|
|
175
|
+
provider: openai
|
|
176
|
+
needs: [base]
|
|
177
|
+
inputs:
|
|
178
|
+
images:
|
|
179
|
+
- task: base
|
|
180
|
+
mask: ./mask.png
|
|
181
|
+
prompt: "Add a premium background"
|
|
182
|
+
output: assets/final.png
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Run it:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
ploof run assets.yaml --parallel 4
|
|
189
|
+
ploof run assets.yaml --dry-run --output json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Output Formats
|
|
193
|
+
|
|
194
|
+
Ploof defaults to table output in TTYs and compact output when piped.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
ploof image generate --prompt "..." --output json
|
|
198
|
+
ploof run assets.yaml --output jsonl
|
|
199
|
+
ploof run assets.yaml --fields id,kind,outputs
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Formats:
|
|
203
|
+
|
|
204
|
+
| Format | Use case |
|
|
205
|
+
| --- | --- |
|
|
206
|
+
| `table` | Human-readable terminal output |
|
|
207
|
+
| `compact` | Agent-friendly compact text |
|
|
208
|
+
| `json` | Programmatic consumption |
|
|
209
|
+
| `jsonl` | Streaming/pipeline consumption |
|
|
210
|
+
|
|
211
|
+
## AI Agent Usage
|
|
212
|
+
|
|
213
|
+
`ploof learn` is the canonical AI-agent reference for the installed CLI version:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
ploof learn
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Install the bootstrap skill:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
ploof skill install
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The skill is intentionally small and points agents to `ploof learn`, so operational instructions stay aligned with the installed npm package.
|
|
226
|
+
|
|
227
|
+
## Configuration
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
ploof config list
|
|
231
|
+
ploof config get output
|
|
232
|
+
ploof config set output compact
|
|
233
|
+
ploof config reset
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Config is stored at `~/.ploof/config.json`.
|
|
237
|
+
|
|
238
|
+
## Development
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
bun install
|
|
242
|
+
bun run dev -- --help
|
|
243
|
+
bun test
|
|
244
|
+
bun run typecheck
|
|
245
|
+
bun run lint
|
|
246
|
+
bun run build
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Testing
|
|
250
|
+
|
|
251
|
+
Run the full offline gate:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
bun run lint
|
|
255
|
+
bun run typecheck
|
|
256
|
+
bun run test
|
|
257
|
+
bun run build
|
|
258
|
+
npm pack --dry-run
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
The default test suite includes mocked OpenAI end-to-end tests. Those tests run real `ploof` CLI commands against a local mock OpenAI server and verify generated files, edit uploads, sidecar metadata, and dependency-aware manifests without spending API credits.
|
|
262
|
+
|
|
263
|
+
Live OpenAI tests are opt-in only:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
PLOOF_OPENAI_API_KEY=sk-... bun test tests/e2e
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Optional live-test overrides:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
PLOOF_OPENAI_LIVE_MODEL=gpt-image-1
|
|
273
|
+
PLOOF_OPENAI_LIVE_SIZE=1024x1024
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT
|
package/SPEC.md
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# Ploof CLI Specification
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Ploof is an npm-published CLI for generating and editing assets through AI generation providers. It starts with OpenAI image generation and editing, but the architecture must support multiple authenticated providers, multiple asset modalities, provider-specific settings, and parallel execution across mixed jobs.
|
|
6
|
+
|
|
7
|
+
The product should feel like a small, sharp developer tool: easy to run manually, predictable in scripts, and optimized for AI agents.
|
|
8
|
+
|
|
9
|
+
## Naming
|
|
10
|
+
|
|
11
|
+
- NPM package: `@miketromba/ploof`
|
|
12
|
+
- CLI binary: `ploof`
|
|
13
|
+
- Brand/site target: `ploof.sh`
|
|
14
|
+
- Config directory: `~/.ploof`
|
|
15
|
+
- Environment prefix: `PLOOF_`
|
|
16
|
+
- Canonical agent reference command: `ploof learn`
|
|
17
|
+
- Bootstrap skill: `skills/asset-generation/SKILL.md`
|
|
18
|
+
|
|
19
|
+
Example:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun i -g @miketromba/ploof
|
|
23
|
+
ploof login openai --api-key "$OPENAI_API_KEY"
|
|
24
|
+
ploof image generate --prompt "Studio product photo" --out assets/hero.png
|
|
25
|
+
ploof learn
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The unscoped npm name `ploof` was rejected by npm's similarity policy during
|
|
29
|
+
publish because it is too close to `plop`. The canonical install package is
|
|
30
|
+
therefore scoped, while the command remains the short `ploof` binary.
|
|
31
|
+
|
|
32
|
+
## Prior Art And Conventions
|
|
33
|
+
|
|
34
|
+
Ploof should follow the style and publishing conventions from existing CLI projects:
|
|
35
|
+
|
|
36
|
+
- `loops-cli`
|
|
37
|
+
- `polar-cli`
|
|
38
|
+
- `lemonsqueezy-cli`
|
|
39
|
+
- `issy`
|
|
40
|
+
|
|
41
|
+
Conventions to preserve:
|
|
42
|
+
|
|
43
|
+
- Bun-first TypeScript development.
|
|
44
|
+
- `type: "module"`.
|
|
45
|
+
- `commander` for CLI parsing.
|
|
46
|
+
- `chalk` for terminal output where useful.
|
|
47
|
+
- Biome for lint/format.
|
|
48
|
+
- `bun test`, `bunx tsc --noEmit`, `bun run build`.
|
|
49
|
+
- `bin/ploof.ts` development entrypoint.
|
|
50
|
+
- `scripts/build.ts` bundles to `dist/ploof.js`.
|
|
51
|
+
- Published package runs on Node 18+ and does not require Bun.
|
|
52
|
+
- Published files are constrained to runtime artifacts, README, LICENSE, spec, and skill files.
|
|
53
|
+
- GitHub Actions CI runs typecheck, tests, and build.
|
|
54
|
+
- GitHub Actions publish runs on `v*` tags and supports npm trusted publishing/OIDC.
|
|
55
|
+
- Human-readable output in TTY, compact output when piped, JSON/JSONL for agents and scripts.
|
|
56
|
+
|
|
57
|
+
## Core Goals
|
|
58
|
+
|
|
59
|
+
1. Authenticate with multiple asset generation providers.
|
|
60
|
+
2. Allow multiple profiles per provider.
|
|
61
|
+
3. Generate and edit assets with provider-specific settings.
|
|
62
|
+
4. Accept input assets as context for provider APIs that support them.
|
|
63
|
+
5. Run multiple generation jobs in parallel.
|
|
64
|
+
6. Support dependency-aware batch manifests.
|
|
65
|
+
7. Preserve provider-specific settings without requiring constant CLI redesign.
|
|
66
|
+
8. Provide first-class AI agent support through `ploof learn` and an installable skill.
|
|
67
|
+
9. Publish cleanly to npm with the short `ploof` binary.
|
|
68
|
+
|
|
69
|
+
## Initial Provider Scope
|
|
70
|
+
|
|
71
|
+
Version 1 starts with OpenAI only.
|
|
72
|
+
|
|
73
|
+
Initial capabilities:
|
|
74
|
+
|
|
75
|
+
- `image.generate`
|
|
76
|
+
- `image.edit`
|
|
77
|
+
|
|
78
|
+
Future providers should be added through the provider registry without changing the manifest model.
|
|
79
|
+
|
|
80
|
+
Future high-leverage provider candidates:
|
|
81
|
+
|
|
82
|
+
- fal.ai: strong multi-model generative media coverage.
|
|
83
|
+
- Replicate: broad community model marketplace.
|
|
84
|
+
- Hugging Face Inference Providers: centralized access to many hosted models/providers.
|
|
85
|
+
|
|
86
|
+
## Auth And Profiles
|
|
87
|
+
|
|
88
|
+
Credentials are stored in a local CLI-specific directory, matching prior CLI conventions:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
~/.ploof/config.json
|
|
92
|
+
~/.ploof/credentials.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Credential file shape:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"providers": {
|
|
100
|
+
"openai": {
|
|
101
|
+
"profiles": {
|
|
102
|
+
"default": {
|
|
103
|
+
"apiKey": "sk-..."
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"defaultProfile": "default"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Environment overrides:
|
|
113
|
+
|
|
114
|
+
- `PLOOF_OPENAI_API_KEY`
|
|
115
|
+
- `OPENAI_API_KEY`
|
|
116
|
+
|
|
117
|
+
The Ploof-specific env var wins over the provider-native env var. Stored credentials are used only when no env override is present.
|
|
118
|
+
|
|
119
|
+
OpenAI profile metadata may also include:
|
|
120
|
+
|
|
121
|
+
- `organization`
|
|
122
|
+
- `project`
|
|
123
|
+
- `baseURL`
|
|
124
|
+
|
|
125
|
+
## CLI Commands
|
|
126
|
+
|
|
127
|
+
### Global Flags
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
-o, --output <format> table|compact|json|jsonl
|
|
131
|
+
-f, --fields <list> Comma-separated field selection
|
|
132
|
+
-d, --detail Include full details
|
|
133
|
+
--no-color Disable color
|
|
134
|
+
--verbose Debug output to stderr
|
|
135
|
+
-q, --quiet Data only, minimal extra text
|
|
136
|
+
-y, --yes Skip confirmation prompts
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Auth
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
ploof login openai --api-key <key> [--profile default] [--organization org] [--project proj] [--base-url url]
|
|
143
|
+
ploof whoami [provider] [--profile default]
|
|
144
|
+
ploof profiles [provider]
|
|
145
|
+
ploof logout openai [--profile default]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`login`, `whoami`, `profiles`, and `logout` are the only authentication
|
|
149
|
+
commands. Ploof should not expose a second equivalent auth namespace.
|
|
150
|
+
|
|
151
|
+
`ploof login openai` accepts `--api-key`, reads `PLOOF_OPENAI_API_KEY` or
|
|
152
|
+
`OPENAI_API_KEY` when the flag is omitted, and prompts without echoing input
|
|
153
|
+
when run in an interactive terminal. Non-interactive login fails if no key is
|
|
154
|
+
provided.
|
|
155
|
+
|
|
156
|
+
### Config
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
ploof config list
|
|
160
|
+
ploof config get output
|
|
161
|
+
ploof config set output compact
|
|
162
|
+
ploof config reset
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Image Generation
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
ploof image generate \
|
|
169
|
+
--provider openai \
|
|
170
|
+
--profile default \
|
|
171
|
+
--prompt "Studio product photo" \
|
|
172
|
+
--out assets/hero.png \
|
|
173
|
+
--model gpt-image-1 \
|
|
174
|
+
--size 1024x1024 \
|
|
175
|
+
--quality high \
|
|
176
|
+
--format png
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The command should expose common OpenAI image parameters as first-class flags and allow pass-through parameters:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
--param key=value
|
|
183
|
+
--json '{"providerSpecific": true}'
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Image Editing
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
ploof image edit \
|
|
190
|
+
--provider openai \
|
|
191
|
+
--image input.png \
|
|
192
|
+
--image reference.png \
|
|
193
|
+
--mask mask.png \
|
|
194
|
+
--prompt "Replace the background" \
|
|
195
|
+
--out assets/edited.png
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The CLI must support multiple context images where the provider supports them.
|
|
199
|
+
|
|
200
|
+
### Batch Run
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
ploof run assets.yaml --parallel 4
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Manifest example:
|
|
207
|
+
|
|
208
|
+
```yaml
|
|
209
|
+
version: 1
|
|
210
|
+
parallel: 4
|
|
211
|
+
tasks:
|
|
212
|
+
- id: base
|
|
213
|
+
kind: image.generate
|
|
214
|
+
provider: openai
|
|
215
|
+
prompt: "Studio product photo"
|
|
216
|
+
params:
|
|
217
|
+
model: gpt-image-1
|
|
218
|
+
size: 1024x1024
|
|
219
|
+
quality: high
|
|
220
|
+
output: assets/base.png
|
|
221
|
+
|
|
222
|
+
- id: edit
|
|
223
|
+
kind: image.edit
|
|
224
|
+
provider: openai
|
|
225
|
+
needs: [base]
|
|
226
|
+
inputs:
|
|
227
|
+
images:
|
|
228
|
+
- task: base
|
|
229
|
+
mask: ./mask.png
|
|
230
|
+
prompt: "Add a premium background"
|
|
231
|
+
output: assets/final.png
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Asset Input Model
|
|
235
|
+
|
|
236
|
+
All input/context assets are normalized before provider execution:
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
type AssetInput = {
|
|
240
|
+
role: 'image' | 'mask' | 'reference' | 'style' | 'audio' | 'video'
|
|
241
|
+
source: string
|
|
242
|
+
mime?: string
|
|
243
|
+
name?: string
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Supported sources:
|
|
248
|
+
|
|
249
|
+
- Local paths.
|
|
250
|
+
- HTTP(S) URLs where the provider accepts URLs or where Ploof can download/read them.
|
|
251
|
+
- `-` for stdin where applicable.
|
|
252
|
+
- Previous task outputs in manifests.
|
|
253
|
+
|
|
254
|
+
OpenAI image editing maps:
|
|
255
|
+
|
|
256
|
+
- `role=image` to image input files.
|
|
257
|
+
- `role=mask` to mask file.
|
|
258
|
+
|
|
259
|
+
Future providers can map roles such as `reference`, `style`, `init-image`, `audio`, or `video` differently.
|
|
260
|
+
|
|
261
|
+
## Provider Architecture
|
|
262
|
+
|
|
263
|
+
Provider modules implement a common interface:
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
type Provider = {
|
|
267
|
+
id: string
|
|
268
|
+
capabilities: ProviderCapability[]
|
|
269
|
+
runImageGenerate(job, context): Promise<ProviderResult>
|
|
270
|
+
runImageEdit(job, context): Promise<ProviderResult>
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The provider registry owns:
|
|
275
|
+
|
|
276
|
+
- Provider lookup.
|
|
277
|
+
- Capability checks.
|
|
278
|
+
- Credential resolution.
|
|
279
|
+
- Provider-specific validation.
|
|
280
|
+
|
|
281
|
+
The CLI should avoid hardcoding all provider behavior into command handlers.
|
|
282
|
+
|
|
283
|
+
## Settings Strategy
|
|
284
|
+
|
|
285
|
+
Ploof should support provider settings in three layers:
|
|
286
|
+
|
|
287
|
+
1. Stable first-class flags for common options.
|
|
288
|
+
2. Repeatable `--param key=value` flags.
|
|
289
|
+
3. Full JSON override/merge through `--json`.
|
|
290
|
+
|
|
291
|
+
This avoids a dead-end where every provider schema update requires a CLI redesign.
|
|
292
|
+
|
|
293
|
+
## Output Strategy
|
|
294
|
+
|
|
295
|
+
Default behavior:
|
|
296
|
+
|
|
297
|
+
- TTY: `table`
|
|
298
|
+
- Piped/non-TTY: `compact`
|
|
299
|
+
|
|
300
|
+
Supported formats:
|
|
301
|
+
|
|
302
|
+
- `table`
|
|
303
|
+
- `compact`
|
|
304
|
+
- `json`
|
|
305
|
+
- `jsonl`
|
|
306
|
+
|
|
307
|
+
Asset-producing commands should write the asset to disk and print structured metadata:
|
|
308
|
+
|
|
309
|
+
```json
|
|
310
|
+
{
|
|
311
|
+
"id": "hero",
|
|
312
|
+
"kind": "image.generate",
|
|
313
|
+
"provider": "openai",
|
|
314
|
+
"outputs": ["assets/hero.png"],
|
|
315
|
+
"metadata": {
|
|
316
|
+
"model": "gpt-image-1"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Each generated file should have an optional sidecar metadata file:
|
|
322
|
+
|
|
323
|
+
```text
|
|
324
|
+
assets/hero.png
|
|
325
|
+
assets/hero.png.json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
The sidecar should include:
|
|
329
|
+
|
|
330
|
+
- Provider.
|
|
331
|
+
- Operation kind.
|
|
332
|
+
- Prompt.
|
|
333
|
+
- Params.
|
|
334
|
+
- Output path.
|
|
335
|
+
- Request metadata where available.
|
|
336
|
+
- Timestamp.
|
|
337
|
+
|
|
338
|
+
## Parallel Execution
|
|
339
|
+
|
|
340
|
+
The batch runner should:
|
|
341
|
+
|
|
342
|
+
- Respect `parallel` from the manifest or CLI override.
|
|
343
|
+
- Run independent tasks concurrently.
|
|
344
|
+
- Respect `needs` dependencies.
|
|
345
|
+
- Fail fast by default.
|
|
346
|
+
- Optionally continue on errors later.
|
|
347
|
+
- Resolve previous task outputs into dependent task inputs.
|
|
348
|
+
|
|
349
|
+
## Agent Support
|
|
350
|
+
|
|
351
|
+
Ploof must have first-class agent support.
|
|
352
|
+
|
|
353
|
+
The canonical agent reference lives in the installed CLI:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
ploof learn
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The bootstrap skill should be intentionally small:
|
|
360
|
+
|
|
361
|
+
```text
|
|
362
|
+
skills/asset-generation/SKILL.md
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The skill should:
|
|
366
|
+
|
|
367
|
+
- Trigger when agents need to generate, edit, or batch-create assets.
|
|
368
|
+
- Tell the agent to run `ploof learn`.
|
|
369
|
+
- Treat `ploof learn` as the source of truth for the installed version.
|
|
370
|
+
- Avoid duplicating operational docs.
|
|
371
|
+
|
|
372
|
+
The CLI should also include:
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
ploof skill install
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
This command should either install the local bootstrap skill where feasible or print the exact install instruction for supported skill managers.
|
|
379
|
+
|
|
380
|
+
## Test Strategy
|
|
381
|
+
|
|
382
|
+
Unit tests:
|
|
383
|
+
|
|
384
|
+
- Config read/write/reset.
|
|
385
|
+
- Auth profile storage and env precedence.
|
|
386
|
+
- Output format resolution.
|
|
387
|
+
- Param parsing.
|
|
388
|
+
- Manifest parsing and dependency validation.
|
|
389
|
+
- Provider registry lookup.
|
|
390
|
+
- `ploof learn` stability.
|
|
391
|
+
|
|
392
|
+
Integration-style tests:
|
|
393
|
+
|
|
394
|
+
- CLI help exits successfully.
|
|
395
|
+
- Auth login/status/logout lifecycle with temp home.
|
|
396
|
+
- Manifest dry-run/planning behavior.
|
|
397
|
+
|
|
398
|
+
Live OpenAI tests should be opt-in only:
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
PLOOF_OPENAI_API_KEY=... bun test tests/e2e
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Non-Goals For Initial Implementation
|
|
405
|
+
|
|
406
|
+
- No browser UI.
|
|
407
|
+
- No cloud service.
|
|
408
|
+
- No keychain dependency.
|
|
409
|
+
- No non-OpenAI provider implementation yet.
|
|
410
|
+
- No hard promise that every future provider setting is a first-class flag.
|
|
411
|
+
- No live API tests in default CI.
|
|
412
|
+
|
|
413
|
+
## Initial Milestone Definition
|
|
414
|
+
|
|
415
|
+
The initial complete implementation should include:
|
|
416
|
+
|
|
417
|
+
- npm package scaffolding for `@miketromba/ploof`.
|
|
418
|
+
- Build, test, typecheck, lint setup.
|
|
419
|
+
- OpenAI auth profiles.
|
|
420
|
+
- OpenAI image generate/edit.
|
|
421
|
+
- Asset input normalization.
|
|
422
|
+
- Manifest run with dependency-aware parallelism.
|
|
423
|
+
- Output formats and sidecar metadata.
|
|
424
|
+
- `ploof learn`.
|
|
425
|
+
- Bootstrap skill.
|
|
426
|
+
- README, LICENSE, GitHub Actions.
|