makaron-cli 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -16,16 +16,16 @@ Verify: `npx makaron-cli list` should show projects.
16
16
  ## Core Workflow
17
17
 
18
18
  ```bash
19
- # 1. Create project with image(s)
20
- PROJECT_ID=$(npx makaron-cli create --image photo.jpg 2>/dev/null | grep "ID:" | awk '{print $2}')
19
+ # One-shot: create project + upload image + submit prompt — all in one command
20
+ RUN_ID=$(npx makaron-cli chat --project auto --image photo.jpg -b "make it cinematic and create a 5s video")
21
21
 
22
- # Multi-image project:
23
- PROJECT_ID=$(npx makaron-cli create --image img1.jpg --image img2.jpg 2>/dev/null | grep "ID:" | awk '{print $2}')
24
-
25
- # 2. Submit creative request (non-blocking)
26
- RUN_ID=$(npx makaron-cli chat --project $PROJECT_ID -b "make it cinematic and create a 5s video")
22
+ # Watch until all artifacts are ready
23
+ npx makaron-cli responses watch $RUN_ID --jsonl
24
+ ```
27
25
 
28
- # 3. Watch until all artifacts are ready
26
+ Or with an existing project:
27
+ ```bash
28
+ RUN_ID=$(npx makaron-cli chat --project $PROJECT_ID -b "make a 5s video")
29
29
  npx makaron-cli responses watch $RUN_ID --jsonl
30
30
  ```
31
31
 
@@ -36,7 +36,12 @@ Use `chat` for all creative tasks. Makaron Agent decides how to execute — it c
36
36
  ### Submit a request
37
37
 
38
38
  ```bash
39
+ # With existing project
39
40
  npx makaron-cli chat --project <id> --json -b "<prompt>"
41
+
42
+ # Auto-create project (with or without images)
43
+ npx makaron-cli chat --project auto --image photo.jpg --json -b "make it cinematic"
44
+ npx makaron-cli chat --project auto --image img1.jpg --image img2.jpg --json -b "combine these"
40
45
  ```
41
46
 
42
47
  Returns immediately:
@@ -44,10 +49,9 @@ Returns immediately:
44
49
  {"runId": "xxx", "projectId": "...", "projectUrl": "https://www.makaron.app/projects/...", "status": "running"}
45
50
  ```
46
51
 
47
- ### With additional images
52
+ ### With additional images (existing project)
48
53
 
49
54
  ```bash
50
- # Add reference images to project before chatting
51
55
  npx makaron-cli chat --project <id> --image ref1.jpg --image ref2.jpg -b "use these as style reference"
52
56
  ```
53
57
 
package/SKILL.md CHANGED
@@ -18,16 +18,16 @@ Verify: `npx makaron-cli list` should show projects.
18
18
  ## Core Workflow
19
19
 
20
20
  ```bash
21
- # 1. Create project with image(s)
22
- PROJECT_ID=$(npx makaron-cli create --image photo.jpg 2>/dev/null | grep "ID:" | awk '{print $2}')
21
+ # One-shot: create project + upload image + submit prompt — all in one command
22
+ RUN_ID=$(npx makaron-cli chat --project auto --image photo.jpg -b "make it cinematic and create a 5s video")
23
23
 
24
- # Multi-image project:
25
- PROJECT_ID=$(npx makaron-cli create --image img1.jpg --image img2.jpg 2>/dev/null | grep "ID:" | awk '{print $2}')
26
-
27
- # 2. Submit creative request (non-blocking)
28
- RUN_ID=$(npx makaron-cli chat --project $PROJECT_ID -b "make it cinematic and create a 5s video")
24
+ # Watch until all artifacts are ready
25
+ npx makaron-cli responses watch $RUN_ID --jsonl
26
+ ```
29
27
 
30
- # 3. Watch until all artifacts are ready
28
+ Or with an existing project:
29
+ ```bash
30
+ RUN_ID=$(npx makaron-cli chat --project $PROJECT_ID -b "make a 5s video")
31
31
  npx makaron-cli responses watch $RUN_ID --jsonl
32
32
  ```
33
33
 
@@ -38,7 +38,12 @@ Use `chat` for all creative tasks. Makaron Agent decides how to execute — it c
38
38
  ### Submit a request
39
39
 
40
40
  ```bash
41
+ # With existing project
41
42
  npx makaron-cli chat --project <id> --json -b "<prompt>"
43
+
44
+ # Auto-create project (with or without images)
45
+ npx makaron-cli chat --project auto --image photo.jpg --json -b "make it cinematic"
46
+ npx makaron-cli chat --project auto --image img1.jpg --image img2.jpg --json -b "combine these"
42
47
  ```
43
48
 
44
49
  Returns immediately:
@@ -46,10 +51,9 @@ Returns immediately:
46
51
  {"runId": "xxx", "projectId": "...", "projectUrl": "https://www.makaron.app/projects/...", "status": "running"}
47
52
  ```
48
53
 
49
- ### With additional images
54
+ ### With additional images (existing project)
50
55
 
51
56
  ```bash
52
- # Add reference images to project before chatting
53
57
  npx makaron-cli chat --project <id> --image ref1.jpg --image ref2.jpg -b "use these as style reference"
54
58
  ```
55
59
 
package/bin/makaron.mjs CHANGED
@@ -624,11 +624,44 @@ if (command === 'login') {
624
624
  else promptParts.push(args[i]);
625
625
  }
626
626
  const prompt = promptParts.join(' ');
627
- if (!projectId || !prompt) {
628
- console.error('Usage: makaron chat --project <id> [--image <file>] [--stream] [--background|-b] [--json] "your message"');
627
+ if (!prompt) {
628
+ console.error('Usage: makaron chat --project <id|auto> [--image <file>] [--stream] [--background|-b] [--json] "your message"');
629
629
  process.exit(1);
630
630
  }
631
- // Upload images if provided
631
+ // --project auto: create a new project (with images if provided)
632
+ if (!projectId || projectId === 'auto') {
633
+ if (chatImages.length === 0) {
634
+ // Create empty project
635
+ process.stderr.write(`📦 Creating new project...\n`);
636
+ const res = await fetch(`${baseUrl}/api/projects/create`, {
637
+ method: 'POST',
638
+ headers: { 'Content-Type': 'application/json', ...headers },
639
+ body: JSON.stringify({ title: prompt.slice(0, 50) }),
640
+ });
641
+ if (!res.ok) { process.stderr.write(`❌ Failed to create project: ${await res.text()}\n`); process.exit(1); }
642
+ const data = await res.json();
643
+ projectId = data.projectId;
644
+ process.stderr.write(`📦 Project created: ${projectId}\n`);
645
+ } else {
646
+ // Create project with images
647
+ const base64s = chatImages.map(imgPath => {
648
+ process.stderr.write(`📤 Uploading ${path.basename(imgPath)}...\n`);
649
+ const buf = fs.readFileSync(imgPath);
650
+ return `data:image/jpeg;base64,${buf.toString('base64')}`;
651
+ });
652
+ const res = await fetch(`${baseUrl}/api/projects/create`, {
653
+ method: 'POST',
654
+ headers: { 'Content-Type': 'application/json', ...headers },
655
+ body: JSON.stringify({ imageBase64s: base64s }),
656
+ });
657
+ if (!res.ok) { process.stderr.write(`❌ Failed to create project: ${await res.text()}\n`); process.exit(1); }
658
+ const data = await res.json();
659
+ projectId = data.projectId;
660
+ process.stderr.write(`📦 Project created: ${projectId} (${data.snapshots?.length || 0} images)\n`);
661
+ }
662
+ chatImages.length = 0; // already uploaded
663
+ }
664
+ // Upload additional images to existing project
632
665
  if (chatImages.length > 0) {
633
666
  const base64s = chatImages.map(imgPath => {
634
667
  process.stderr.write(`📤 Uploading ${path.basename(imgPath)}...\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "bin": {