@lazarusrolando/crayoncli 0.4.0 → 0.4.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 +24 -1
- package/dist/index.js +41 -0
- package/package.json +1 -1
- package/src/index.ts +44 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# CRAYON v0.4.
|
|
1
|
+
# CRAYON v0.4.1 — Gemma 4 E2B Multimodal CLI
|
|
2
2
|
|
|
3
3
|
Local multimodal CLI using the official Transformers interface for `google/gemma-4-E2B-it`.
|
|
4
4
|
|
|
@@ -76,3 +76,26 @@ AutoModelForMultimodalLM
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
rather than the text-only `AutoTokenizer` / `AutoModelForCausalLM` path.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Help
|
|
82
|
+
|
|
83
|
+
Show help before starting the model:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
node dist/index.js --help
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Short form:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
node dist/index.js -h
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Inside interactive mode:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
/help
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The help screen lists text, image, audio, video, exit, and one-shot CLI commands.
|
package/dist/index.js
CHANGED
|
@@ -41,8 +41,44 @@ async function streamMedia(prompt, type, path) {
|
|
|
41
41
|
reader.releaseLock();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
function printHelp() {
|
|
45
|
+
console.log(`
|
|
46
|
+
CRAYON v0.4.1 - Gemma 4 E2B Multimodal CLI
|
|
47
|
+
|
|
48
|
+
Usage:
|
|
49
|
+
crayon [prompt]
|
|
50
|
+
crayon image <file> <question>
|
|
51
|
+
crayon audio <file> <question>
|
|
52
|
+
crayon video <file> <question>
|
|
53
|
+
crayon --help
|
|
54
|
+
crayon -h
|
|
55
|
+
|
|
56
|
+
Commands:
|
|
57
|
+
/help Show available interactive commands
|
|
58
|
+
/image <file> <question> Analyze an image
|
|
59
|
+
/audio <file> <question> Analyze/transcribe audio
|
|
60
|
+
/video <file> <question> Analyze a video
|
|
61
|
+
/exit Exit CRAYON
|
|
62
|
+
|
|
63
|
+
CLI commands:
|
|
64
|
+
image <file> <question> One-shot image analysis
|
|
65
|
+
audio <file> <question> One-shot audio analysis
|
|
66
|
+
video <file> <question> One-shot video analysis
|
|
67
|
+
--help, -h Show this help
|
|
68
|
+
|
|
69
|
+
Examples:
|
|
70
|
+
crayon \"Explain recursion in JavaScript\"
|
|
71
|
+
crayon image photo.jpg \"What is in this image?\"
|
|
72
|
+
crayon audio speech.wav \"Transcribe this audio.\"
|
|
73
|
+
crayon video clip.mp4 \"Describe what happens in this video.\"
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
44
76
|
async function main() {
|
|
45
77
|
const args = process.argv.slice(2);
|
|
78
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
79
|
+
printHelp();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
46
82
|
await gemma.start();
|
|
47
83
|
// One-shot:
|
|
48
84
|
// crayon "Explain this"
|
|
@@ -93,6 +129,11 @@ Examples:
|
|
|
93
129
|
shutdown();
|
|
94
130
|
return;
|
|
95
131
|
}
|
|
132
|
+
if (input === "/help" || input === "help" || input === "?") {
|
|
133
|
+
printHelp();
|
|
134
|
+
rl.prompt();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
96
137
|
rl.pause();
|
|
97
138
|
try {
|
|
98
139
|
const parts = input.split(/\s+/);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -45,8 +45,47 @@ async function streamMedia(prompt:string,type:"image"|"audio"|"video",path:strin
|
|
|
45
45
|
}finally{reader.releaseLock();}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function printHelp() {
|
|
49
|
+
console.log(`
|
|
50
|
+
CRAYON v0.4.1 - Gemma 4 E2B Multimodal CLI
|
|
51
|
+
|
|
52
|
+
Usage:
|
|
53
|
+
crayon [prompt]
|
|
54
|
+
crayon image <file> <question>
|
|
55
|
+
crayon audio <file> <question>
|
|
56
|
+
crayon video <file> <question>
|
|
57
|
+
crayon --help
|
|
58
|
+
crayon -h
|
|
59
|
+
|
|
60
|
+
Commands:
|
|
61
|
+
/help Show available interactive commands
|
|
62
|
+
/image <file> <question> Analyze an image
|
|
63
|
+
/audio <file> <question> Analyze/transcribe audio
|
|
64
|
+
/video <file> <question> Analyze a video
|
|
65
|
+
/exit Exit CRAYON
|
|
66
|
+
|
|
67
|
+
CLI commands:
|
|
68
|
+
image <file> <question> One-shot image analysis
|
|
69
|
+
audio <file> <question> One-shot audio analysis
|
|
70
|
+
video <file> <question> One-shot video analysis
|
|
71
|
+
--help, -h Show this help
|
|
72
|
+
|
|
73
|
+
Examples:
|
|
74
|
+
crayon \"Explain recursion in JavaScript\"
|
|
75
|
+
crayon image photo.jpg \"What is in this image?\"
|
|
76
|
+
crayon audio speech.wav \"Transcribe this audio.\"
|
|
77
|
+
crayon video clip.mp4 \"Describe what happens in this video.\"
|
|
78
|
+
`);
|
|
79
|
+
}
|
|
80
|
+
|
|
48
81
|
async function main(){
|
|
49
82
|
const args=process.argv.slice(2);
|
|
83
|
+
|
|
84
|
+
if(args.includes('--help') || args.includes('-h')){
|
|
85
|
+
printHelp();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
50
89
|
await gemma.start();
|
|
51
90
|
|
|
52
91
|
// One-shot:
|
|
@@ -96,6 +135,11 @@ Examples:
|
|
|
96
135
|
const input=line.trim();
|
|
97
136
|
if(!input){rl.prompt();return;}
|
|
98
137
|
if(input==="/exit"){shutdown();return;}
|
|
138
|
+
if(input==="/help" || input==="help" || input==="?"){
|
|
139
|
+
printHelp();
|
|
140
|
+
rl.prompt();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
99
143
|
rl.pause();
|
|
100
144
|
|
|
101
145
|
try{
|