@hasna/skills 0.1.33 → 0.1.34
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/bin/index.js +1 -1
- package/bin/mcp.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/skills/browse/README.md +13 -256
- package/skills/browse/SKILL.md +24 -45
- package/skills/deepresearch/CLAUDE.md +6 -39
- package/skills/deepresearch/README.md +15 -150
- package/skills/deepresearch/SKILL.md +23 -32
- package/skills/image/README.md +13 -183
- package/skills/webcrawling/CLAUDE.md +6 -17
- package/skills/webcrawling/README.md +13 -66
- package/skills/browse/.env.example +0 -14
- package/skills/deepresearch/.env.example +0 -9
- package/skills/image/.env.example +0 -12
- package/skills/image/PROJECT_OVERVIEW.md +0 -216
- package/skills/image/QUICKSTART.md +0 -111
- package/skills/transcript/.env.example +0 -10
- package/skills/webcrawling/.env.example +0 -2
|
@@ -1,50 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deepresearch
|
|
3
|
-
description:
|
|
3
|
+
description: Run hosted deep research with parallel search, synthesis, citations, source notes, and downloadable report artifacts.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Deep Research
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Deep Research is a hosted premium skill. The OSS package exposes public
|
|
9
|
+
metadata and usage guidance only; search providers, model routing, prompts,
|
|
10
|
+
worker orchestration, and credentials stay server-side.
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Usage
|
|
11
13
|
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
+
```bash
|
|
15
|
+
skills setup --mode hosted
|
|
16
|
+
skills auth login
|
|
17
|
+
skills run deepresearch "Best practices for building production RAG systems" --depth normal
|
|
18
|
+
skills runs status <run-id>
|
|
19
|
+
skills exports download <run-id>
|
|
14
20
|
```
|
|
15
21
|
|
|
16
22
|
## Options
|
|
17
23
|
|
|
18
24
|
| Option | Description | Default |
|
|
19
|
-
|
|
20
|
-
| `--depth <level>` | Research depth: quick
|
|
21
|
-
| `--
|
|
22
|
-
| `--
|
|
23
|
-
| `--json` | Also save sources as JSON | false |
|
|
24
|
-
| `--no-firecrawl` | Skip deep scraping | false |
|
|
25
|
-
|
|
26
|
-
## Examples
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# Quick overview of a topic
|
|
30
|
-
/deepresearch "What is RAG?" --depth quick
|
|
31
|
-
|
|
32
|
-
# Standard research with Claude
|
|
33
|
-
/deepresearch "Best practices for building production ML systems"
|
|
34
|
-
|
|
35
|
-
# Deep research with OpenAI, custom output
|
|
36
|
-
/deepresearch "Compare Next.js vs Remix" --depth deep --model openai --output ./research.md
|
|
37
|
-
```
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `--depth <level>` | Research depth: `quick`, `normal`, or `deep` | `normal` |
|
|
27
|
+
| `--output <path>` | Requested output path inside the exported artifact bundle | hosted export |
|
|
28
|
+
| `--json` | Request raw source metadata in the exported bundle | `false` |
|
|
38
29
|
|
|
39
30
|
## Requirements
|
|
40
31
|
|
|
41
|
-
- `
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
- `FIRECRAWL_API_KEY` - Optional for deep scraping
|
|
32
|
+
- Authenticate with `skills auth login` or provide `SKILLS_API_KEY`.
|
|
33
|
+
- Provider credentials are managed by the hosted runtime and are not part of the
|
|
34
|
+
OSS package.
|
|
45
35
|
|
|
46
|
-
##
|
|
36
|
+
## Outputs
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
38
|
+
- Research report
|
|
39
|
+
- Source notes
|
|
40
|
+
- Citation metadata
|
|
41
|
+
- Run manifest
|
package/skills/image/README.md
CHANGED
|
@@ -1,195 +1,25 @@
|
|
|
1
|
-
# Image Generation
|
|
1
|
+
# Image Generation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Multiple AI providers in one unified interface
|
|
8
|
-
- Clean, type-safe TypeScript implementation
|
|
9
|
-
- Simple CLI interface
|
|
10
|
-
- Native Bun runtime (no external dependencies)
|
|
11
|
-
- Support for custom models and sizes
|
|
12
|
-
- Automatic image download and saving
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
cd image
|
|
18
|
-
bun install
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Configuration
|
|
22
|
-
|
|
23
|
-
Set up your API keys as environment variables:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# OpenAI
|
|
27
|
-
export OPENAI_API_KEY="your-openai-api-key"
|
|
28
|
-
|
|
29
|
-
# Google Gemini
|
|
30
|
-
export GEMINI_API_KEY="your-gemini-api-key"
|
|
31
|
-
export GOOGLE_PROJECT_ID="your-google-project-id"
|
|
32
|
-
|
|
33
|
-
# xAI
|
|
34
|
-
export XAI_API_KEY="your-xai-api-key"
|
|
35
|
-
```
|
|
3
|
+
Hosted image generation skill with provider-cost pricing and downloadable image
|
|
4
|
+
artifacts.
|
|
36
5
|
|
|
37
6
|
## Usage
|
|
38
7
|
|
|
39
|
-
### Basic Commands
|
|
40
|
-
|
|
41
8
|
```bash
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# Google Imagen 3
|
|
46
|
-
bun run src/index.ts generate --provider google --prompt "a dog" --output ./dog.png
|
|
47
|
-
|
|
48
|
-
# xAI Aurora
|
|
49
|
-
bun run src/index.ts generate --provider xai --prompt "a bird" --output ./bird.png
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Advanced Options
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Custom size with OpenAI
|
|
56
|
-
bun run src/index.ts generate \
|
|
57
|
-
--provider openai \
|
|
58
|
-
--prompt "a futuristic cityscape" \
|
|
59
|
-
--output ./city.png \
|
|
60
|
-
--size 1792x1024
|
|
61
|
-
|
|
62
|
-
# Custom model
|
|
63
|
-
bun run src/index.ts generate \
|
|
64
|
-
--provider openai \
|
|
65
|
-
--prompt "abstract art" \
|
|
66
|
-
--output ./art.png \
|
|
67
|
-
--model dall-e-3
|
|
68
|
-
|
|
69
|
-
# Google Imagen with aspect ratio
|
|
70
|
-
bun run src/index.ts generate \
|
|
71
|
-
--provider google \
|
|
72
|
-
--prompt "mountain landscape" \
|
|
73
|
-
--output ./mountain.png \
|
|
74
|
-
--size 16:9
|
|
9
|
+
skills setup --mode hosted
|
|
10
|
+
skills auth login
|
|
11
|
+
skills run image "editorial product photo on a white sweep"
|
|
75
12
|
```
|
|
76
13
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
bun run src/index.ts generate \
|
|
81
|
-
-p openai \
|
|
82
|
-
--prompt "a sunset" \
|
|
83
|
-
-o ./sunset.png \
|
|
84
|
-
-s 1024x1024
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Provider Details
|
|
88
|
-
|
|
89
|
-
### OpenAI DALL-E 3
|
|
90
|
-
|
|
91
|
-
- **Endpoint**: `https://api.openai.com/v1/images/generations`
|
|
92
|
-
- **Models**:
|
|
93
|
-
- `dall-e-3` (default) - Latest DALL-E model
|
|
94
|
-
- `gpt-image-1` - GPT-4o image generation
|
|
95
|
-
- **Sizes**:
|
|
96
|
-
- `1024x1024` (default, square)
|
|
97
|
-
- `1792x1024` (landscape)
|
|
98
|
-
- `1024x1792` (portrait)
|
|
99
|
-
- **Features**: High-quality, detailed images with prompt revision
|
|
100
|
-
|
|
101
|
-
### Google Imagen 3
|
|
102
|
-
|
|
103
|
-
- **Endpoint**: Vertex AI REST API
|
|
104
|
-
- **Model**: `imagen-3.0-generate-001`
|
|
105
|
-
- **Aspect Ratios**:
|
|
106
|
-
- `1:1` (default, square)
|
|
107
|
-
- `3:4` (portrait)
|
|
108
|
-
- `4:3` (landscape)
|
|
109
|
-
- `9:16` (vertical)
|
|
110
|
-
- `16:9` (wide)
|
|
111
|
-
- **Features**: Photorealistic images with excellent quality
|
|
112
|
-
|
|
113
|
-
### xAI Grok-2 Image
|
|
114
|
-
|
|
115
|
-
- **Endpoint**: `https://api.x.ai/v1/images/generations`
|
|
116
|
-
- **Model**: `grok-2-image-1212` (Grok's image generator)
|
|
117
|
-
- **Features**: Text-to-image with creative interpretation
|
|
118
|
-
- **Price**: $0.07 per image
|
|
119
|
-
|
|
120
|
-
## Project Structure
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
image/
|
|
124
|
-
├── SKILL.md # Skill metadata with YAML frontmatter
|
|
125
|
-
├── README.md # This file
|
|
126
|
-
├── package.json # Bun package configuration
|
|
127
|
-
├── tsconfig.json # TypeScript configuration
|
|
128
|
-
└── src/
|
|
129
|
-
├── index.ts # Main CLI entry point
|
|
130
|
-
├── types.ts # TypeScript type definitions
|
|
131
|
-
└── providers/
|
|
132
|
-
├── openai.ts # OpenAI DALL-E provider
|
|
133
|
-
├── google.ts # Google Imagen provider
|
|
134
|
-
└── xai.ts # xAI Aurora provider
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Development
|
|
138
|
-
|
|
139
|
-
The code is written in TypeScript and uses native Bun APIs:
|
|
140
|
-
|
|
141
|
-
- `fetch` for HTTP requests (built into Bun)
|
|
142
|
-
- File system operations via `fs/promises`
|
|
143
|
-
- No external dependencies for image generation
|
|
144
|
-
|
|
145
|
-
## Error Handling
|
|
146
|
-
|
|
147
|
-
The skill includes comprehensive error handling:
|
|
148
|
-
|
|
149
|
-
- API key validation
|
|
150
|
-
- HTTP error responses
|
|
151
|
-
- Invalid parameter detection
|
|
152
|
-
- File system errors
|
|
153
|
-
- Network failures
|
|
154
|
-
|
|
155
|
-
## Examples
|
|
156
|
-
|
|
157
|
-
### Generate a photorealistic image
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
bun run src/index.ts generate \
|
|
161
|
-
--provider google \
|
|
162
|
-
--prompt "a photorealistic portrait of a woman with red hair, studio lighting, professional photography" \
|
|
163
|
-
--output ./portrait.png
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Generate concept art
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
bun run src/index.ts generate \
|
|
170
|
-
--provider openai \
|
|
171
|
-
--prompt "concept art of a sci-fi spaceship, detailed, artstation trending" \
|
|
172
|
-
--output ./spaceship.png \
|
|
173
|
-
--size 1792x1024
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Generate creative interpretation
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
bun run src/index.ts generate \
|
|
180
|
-
--provider xai \
|
|
181
|
-
--prompt "the feeling of nostalgia as abstract art" \
|
|
182
|
-
--output ./nostalgia.png
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Help
|
|
186
|
-
|
|
187
|
-
View help information:
|
|
14
|
+
Poll and download results:
|
|
188
15
|
|
|
189
16
|
```bash
|
|
190
|
-
|
|
17
|
+
skills runs status <run-id>
|
|
18
|
+
skills exports download <run-id>
|
|
191
19
|
```
|
|
192
20
|
|
|
193
|
-
##
|
|
21
|
+
## Boundary
|
|
194
22
|
|
|
195
|
-
|
|
23
|
+
The OSS package contains metadata, pricing, and client contracts only. Provider
|
|
24
|
+
credentials, model routing, prompts, moderation, billing, worker code, and
|
|
25
|
+
artifact storage are owned by the hosted platform.
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Web Crawling
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Tech Stack
|
|
6
|
-
|
|
7
|
-
- Runtime: Bun
|
|
8
|
-
- Language: TypeScript
|
|
9
|
-
- CLI: Commander.js
|
|
10
|
-
- API: Firecrawl
|
|
11
|
-
|
|
12
|
-
## CLI
|
|
3
|
+
Use this skill through the hosted Skills runtime.
|
|
13
4
|
|
|
14
5
|
```bash
|
|
15
|
-
|
|
16
|
-
service-webcrawling crawl https://example.com -d 2 -l 20
|
|
17
|
-
service-webcrawling sessions
|
|
6
|
+
skills run webcrawling --url https://example.com --depth 2
|
|
18
7
|
```
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
The public package does not include provider credentials, crawler client code,
|
|
10
|
+
hosted worker implementation, logs, or artifact storage. Authenticate with
|
|
11
|
+
`skills auth login` before running.
|
|
@@ -1,77 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Web Crawling
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hosted web crawling and page extraction skill.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
skills setup --mode hosted
|
|
9
|
+
skills auth login
|
|
10
|
+
skills run webcrawling --url https://example.com --depth 2
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Poll and download results:
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# Scrape a single URL
|
|
17
|
-
service-webcrawling scrape https://example.com
|
|
18
|
-
|
|
19
|
-
# Crawl a website
|
|
20
|
-
service-webcrawling crawl https://example.com -d 2 -l 20
|
|
21
|
-
|
|
22
|
-
# List sessions
|
|
23
|
-
service-webcrawling sessions
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## CLI Commands
|
|
27
|
-
|
|
28
|
-
### scrape
|
|
29
|
-
|
|
30
|
-
Scrape a single URL.
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
service-webcrawling scrape <url> [options]
|
|
34
|
-
|
|
35
|
-
Options:
|
|
36
|
-
-f, --format <format> markdown, html, json (default: markdown)
|
|
37
|
-
--full-page Include full page, not just main content
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### crawl
|
|
41
|
-
|
|
42
|
-
Crawl an entire website.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
service-webcrawling crawl <url> [options]
|
|
46
|
-
|
|
47
|
-
Options:
|
|
48
|
-
-d, --depth <number> Max depth (default: 2)
|
|
49
|
-
-l, --limit <number> Max pages (default: 10)
|
|
50
|
-
--exclude <paths> Exclude paths (comma-separated)
|
|
51
|
-
--include <paths> Include only paths (comma-separated)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### sessions
|
|
55
|
-
|
|
56
|
-
List crawl sessions.
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
service-webcrawling sessions [--json]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### config
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
service-webcrawling config view
|
|
66
|
-
service-webcrawling config set firecrawlApiKey fc-...
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Environment Variables
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
FIRECRAWL_API_KEY=fc-... # Required
|
|
16
|
+
skills runs status <run-id>
|
|
17
|
+
skills exports download <run-id>
|
|
73
18
|
```
|
|
74
19
|
|
|
75
|
-
##
|
|
20
|
+
## Boundary
|
|
76
21
|
|
|
77
|
-
|
|
22
|
+
The OSS package contains metadata and documentation only. Crawling providers,
|
|
23
|
+
credentials, rate limits, worker orchestration, logs, and artifacts are owned by
|
|
24
|
+
the hosted runtime.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Browser-Use API Configuration
|
|
2
|
-
# Copy this file to .env and fill in your API key
|
|
3
|
-
|
|
4
|
-
# Browser-Use Cloud API Key
|
|
5
|
-
# Get your key from: https://cloud.browser-use.com/billing
|
|
6
|
-
BROWSER_USE_API_KEY=bu_xxx...
|
|
7
|
-
|
|
8
|
-
# Default LLM Model (optional)
|
|
9
|
-
# Options: gpt-4o, o3, claude-sonnet-4, etc.
|
|
10
|
-
# BROWSER_USE_MODEL=gpt-4o
|
|
11
|
-
|
|
12
|
-
# Default proxy settings (optional)
|
|
13
|
-
# BROWSER_USE_PROXY=true
|
|
14
|
-
# BROWSER_USE_PROXY_COUNTRY=us
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# OpenAI API Key
|
|
2
|
-
# Get your key from: https://platform.openai.com/api-keys
|
|
3
|
-
OPENAI_API_KEY=sk-...
|
|
4
|
-
|
|
5
|
-
# Google Gemini API Key and Project ID
|
|
6
|
-
# Get your key from: https://aistudio.google.com/apikey
|
|
7
|
-
GEMINI_API_KEY=...
|
|
8
|
-
GOOGLE_PROJECT_ID=your-project-id
|
|
9
|
-
|
|
10
|
-
# xAI API Key
|
|
11
|
-
# Get your key from: https://x.ai/api
|
|
12
|
-
XAI_API_KEY=...
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# Image Generation Skill - Project Overview
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
A complete Claude Code skill for AI-powered image generation supporting three major providers: OpenAI DALL-E 3, Google Imagen 3, and xAI Aurora.
|
|
6
|
-
|
|
7
|
-
## Key Statistics
|
|
8
|
-
|
|
9
|
-
- **Total Lines of Code**: ~993 lines
|
|
10
|
-
- **TypeScript Files**: 5 (457 lines)
|
|
11
|
-
- **Providers**: 3 (OpenAI, Google, xAI)
|
|
12
|
-
- **Documentation Files**: 5
|
|
13
|
-
- **Example Scripts**: 3
|
|
14
|
-
- **Dependencies**: Zero (uses native Bun APIs)
|
|
15
|
-
|
|
16
|
-
## File Structure
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
image/
|
|
20
|
-
├── SKILL.md [56 lines] - Skill metadata with YAML frontmatter
|
|
21
|
-
├── README.md [194 lines] - Comprehensive documentation
|
|
22
|
-
├── QUICKSTART.md [111 lines] - Quick start guide
|
|
23
|
-
├── PROJECT_OVERVIEW.md - This file
|
|
24
|
-
├── package.json [29 lines] - Bun package configuration
|
|
25
|
-
├── tsconfig.json [17 lines] - TypeScript configuration
|
|
26
|
-
├── .env.example [12 lines] - Environment variable template
|
|
27
|
-
├── .gitignore [12 lines] - Git ignore patterns
|
|
28
|
-
├── examples/
|
|
29
|
-
│ ├── openai-examples.sh [35 lines] - OpenAI usage examples
|
|
30
|
-
│ ├── google-examples.sh [37 lines] - Google usage examples
|
|
31
|
-
│ └── xai-examples.sh [33 lines] - xAI usage examples
|
|
32
|
-
└── src/
|
|
33
|
-
├── index.ts [189 lines] - Main CLI entry point
|
|
34
|
-
├── types.ts [37 lines] - TypeScript type definitions
|
|
35
|
-
└── providers/
|
|
36
|
-
├── openai.ts [80 lines] - OpenAI DALL-E provider
|
|
37
|
-
├── google.ts [78 lines] - Google Imagen provider
|
|
38
|
-
└── xai.ts [73 lines] - xAI Aurora provider
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Features Implemented
|
|
42
|
-
|
|
43
|
-
### Core Functionality
|
|
44
|
-
- ✅ Multi-provider image generation (OpenAI, Google, xAI)
|
|
45
|
-
- ✅ Clean CLI interface with argument parsing
|
|
46
|
-
- ✅ Automatic image download and file saving
|
|
47
|
-
- ✅ Support for custom models and sizes
|
|
48
|
-
- ✅ Environment variable configuration
|
|
49
|
-
- ✅ Comprehensive error handling
|
|
50
|
-
|
|
51
|
-
### OpenAI Provider
|
|
52
|
-
- ✅ DALL-E 3 support
|
|
53
|
-
- ✅ GPT-4o image generation (gpt-image-1)
|
|
54
|
-
- ✅ Three size options: 1024x1024, 1792x1024, 1024x1792
|
|
55
|
-
- ✅ Revised prompt display
|
|
56
|
-
- ✅ URL-based image retrieval
|
|
57
|
-
|
|
58
|
-
### Google Imagen Provider
|
|
59
|
-
- ✅ Imagen 3.0 support via Vertex AI REST API
|
|
60
|
-
- ✅ Five aspect ratio options: 1:1, 3:4, 4:3, 9:16, 16:9
|
|
61
|
-
- ✅ Base64 image decoding
|
|
62
|
-
- ✅ Project ID configuration
|
|
63
|
-
|
|
64
|
-
### xAI Aurora Provider
|
|
65
|
-
- ✅ Aurora model support
|
|
66
|
-
- ✅ OpenAI-compatible API format
|
|
67
|
-
- ✅ Support for both URL and base64 responses
|
|
68
|
-
- ✅ Flexible size configuration
|
|
69
|
-
|
|
70
|
-
### Developer Experience
|
|
71
|
-
- ✅ TypeScript with strict type checking
|
|
72
|
-
- ✅ Native Bun runtime (no external dependencies)
|
|
73
|
-
- ✅ Modular provider architecture
|
|
74
|
-
- ✅ Clean separation of concerns
|
|
75
|
-
- ✅ Comprehensive inline documentation
|
|
76
|
-
- ✅ Example scripts for all providers
|
|
77
|
-
|
|
78
|
-
### Error Handling
|
|
79
|
-
- ✅ API key validation
|
|
80
|
-
- ✅ Invalid provider detection
|
|
81
|
-
- ✅ Missing argument detection
|
|
82
|
-
- ✅ HTTP error handling
|
|
83
|
-
- ✅ Network failure handling
|
|
84
|
-
- ✅ Size validation (provider-specific)
|
|
85
|
-
|
|
86
|
-
## Usage Examples
|
|
87
|
-
|
|
88
|
-
### Basic Usage
|
|
89
|
-
```bash
|
|
90
|
-
bun run src/index.ts generate --provider openai --prompt "a cat" --output ./cat.png
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### With Custom Options
|
|
94
|
-
```bash
|
|
95
|
-
bun run src/index.ts generate \
|
|
96
|
-
--provider openai \
|
|
97
|
-
--prompt "a futuristic city" \
|
|
98
|
-
--output ./city.png \
|
|
99
|
-
--size 1792x1024 \
|
|
100
|
-
--model dall-e-3
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Short Flags
|
|
104
|
-
```bash
|
|
105
|
-
bun run src/index.ts generate -p google --prompt "a dog" -o ./dog.png -s 16:9
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## API Integration Details
|
|
109
|
-
|
|
110
|
-
### OpenAI DALL-E 3
|
|
111
|
-
- **Endpoint**: `https://api.openai.com/v1/images/generations`
|
|
112
|
-
- **Authentication**: Bearer token via `Authorization` header
|
|
113
|
-
- **Request Format**: JSON with model, prompt, size, response_format
|
|
114
|
-
- **Response Format**: URL or base64
|
|
115
|
-
- **Environment Variable**: `OPENAI_API_KEY`
|
|
116
|
-
|
|
117
|
-
### Google Imagen 3
|
|
118
|
-
- **Endpoint**: `https://{location}-aiplatform.googleapis.com/v1/projects/{projectId}/locations/{location}/publishers/google/models/{model}:predict`
|
|
119
|
-
- **Authentication**: Bearer token via `Authorization` header
|
|
120
|
-
- **Request Format**: JSON with instances and parameters
|
|
121
|
-
- **Response Format**: Base64 encoded image
|
|
122
|
-
- **Environment Variables**: `GOOGLE_API_KEY`, `GOOGLE_PROJECT_ID`
|
|
123
|
-
|
|
124
|
-
### xAI Aurora
|
|
125
|
-
- **Endpoint**: `https://api.x.ai/v1/images/generations`
|
|
126
|
-
- **Authentication**: Bearer token via `Authorization` header
|
|
127
|
-
- **Request Format**: OpenAI-compatible JSON
|
|
128
|
-
- **Response Format**: URL or base64
|
|
129
|
-
- **Environment Variable**: `XAI_API_KEY`
|
|
130
|
-
|
|
131
|
-
## Architecture Patterns
|
|
132
|
-
|
|
133
|
-
### Provider Interface
|
|
134
|
-
All providers implement the `ImageProvider` interface:
|
|
135
|
-
```typescript
|
|
136
|
-
interface ImageProvider {
|
|
137
|
-
generate(prompt: string, options?: {
|
|
138
|
-
model?: string;
|
|
139
|
-
size?: string;
|
|
140
|
-
}): Promise<Buffer>;
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Type Safety
|
|
145
|
-
- Strong typing throughout the codebase
|
|
146
|
-
- Provider-specific response interfaces
|
|
147
|
-
- Validated command-line options
|
|
148
|
-
- Type-safe error handling
|
|
149
|
-
|
|
150
|
-
### Modularity
|
|
151
|
-
- Each provider in separate file
|
|
152
|
-
- Shared types in dedicated module
|
|
153
|
-
- Clean CLI entry point
|
|
154
|
-
- No circular dependencies
|
|
155
|
-
|
|
156
|
-
## Testing Performed
|
|
157
|
-
|
|
158
|
-
✅ Help command display
|
|
159
|
-
✅ Invalid provider detection
|
|
160
|
-
✅ Missing argument validation
|
|
161
|
-
✅ Successful image generation (OpenAI)
|
|
162
|
-
✅ File output and directory creation
|
|
163
|
-
✅ TypeScript compilation
|
|
164
|
-
✅ Bun runtime compatibility
|
|
165
|
-
|
|
166
|
-
## Future Enhancement Possibilities
|
|
167
|
-
|
|
168
|
-
- Image editing capabilities (inpainting, outpainting)
|
|
169
|
-
- Batch generation support
|
|
170
|
-
- Image variation generation
|
|
171
|
-
- Progress bars for long-running operations
|
|
172
|
-
- Local image storage caching
|
|
173
|
-
- Configuration file support (JSON/YAML)
|
|
174
|
-
- Additional providers (Stability AI, Midjourney API)
|
|
175
|
-
- Image quality/resolution options
|
|
176
|
-
- Rate limiting and retry logic
|
|
177
|
-
- Cost estimation before generation
|
|
178
|
-
|
|
179
|
-
## Technical Highlights
|
|
180
|
-
|
|
181
|
-
1. **Zero Dependencies**: Uses only native Bun APIs (fetch, fs/promises)
|
|
182
|
-
2. **Type-Safe**: Comprehensive TypeScript types for all operations
|
|
183
|
-
3. **Clean Code**: Well-organized, readable, maintainable
|
|
184
|
-
4. **Error Resilient**: Handles all common error scenarios gracefully
|
|
185
|
-
5. **Extensible**: Easy to add new providers following existing pattern
|
|
186
|
-
6. **Production Ready**: Includes all necessary error handling and validation
|
|
187
|
-
|
|
188
|
-
## Quick Reference
|
|
189
|
-
|
|
190
|
-
| Provider | Model | Default Size | Custom Sizes |
|
|
191
|
-
|----------|-------|-------------|--------------|
|
|
192
|
-
| OpenAI | dall-e-3 | 1024x1024 | 1792x1024, 1024x1792 |
|
|
193
|
-
| Google | imagen-3.0-generate-001 | 1:1 | 3:4, 4:3, 9:16, 16:9 |
|
|
194
|
-
| xAI | aurora | Default | Provider-specific |
|
|
195
|
-
|
|
196
|
-
## Environment Setup
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
# OpenAI
|
|
200
|
-
export OPENAI_API_KEY="sk-..."
|
|
201
|
-
|
|
202
|
-
# Google
|
|
203
|
-
export GOOGLE_API_KEY="..."
|
|
204
|
-
export GOOGLE_PROJECT_ID="your-project"
|
|
205
|
-
|
|
206
|
-
# xAI
|
|
207
|
-
export XAI_API_KEY="..."
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## License
|
|
211
|
-
|
|
212
|
-
MIT
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
Built with Bun, TypeScript, and Claude Code
|