@ai-agent-tools/picgen 0.1.0-alpha.1 → 0.1.0-alpha.10
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 +41 -4
- package/dist/cli.js +1036 -54
- package/docs/agent-install.md +155 -0
- package/docs/release-alpha.md +37 -3
- package/package.json +5 -3
- package/skills/picgen/SKILL.md +146 -5
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Alpha goals:
|
|
|
10
10
|
- Gemini reference-image generation
|
|
11
11
|
- `provider + preset + routing` configuration
|
|
12
12
|
- `picgen setup`, `picgen doctor`, `picgen create --dry-run`
|
|
13
|
+
- Local web interface with settings, generation, and history
|
|
13
14
|
- Local Codex skill instructions
|
|
14
15
|
|
|
15
16
|
## Development
|
|
@@ -26,32 +27,46 @@ npm run build
|
|
|
26
27
|
## Install
|
|
27
28
|
|
|
28
29
|
```bash
|
|
30
|
+
node -v
|
|
31
|
+
npm -v
|
|
29
32
|
npm install -g @ai-agent-tools/picgen
|
|
33
|
+
npx -y skills add ai-agent-tools/picgen --skill picgen -g -y --copy
|
|
34
|
+
picgen skill install codex
|
|
30
35
|
picgen --help
|
|
31
36
|
picgen quickstart
|
|
37
|
+
picgen open
|
|
32
38
|
```
|
|
33
39
|
|
|
40
|
+
Use `npx -y skills add ...` for cross-agent skill installation when supported. `picgen skill install codex` is a Codex-only fallback that copies the bundled skill into `~/.codex/skills/picgen`.
|
|
41
|
+
|
|
34
42
|
Agent trial prompt:
|
|
35
43
|
|
|
36
44
|
```text
|
|
37
|
-
|
|
45
|
+
请帮我安装并配置 PicGen 生图工具。请先阅读并按这个指南执行:https://raw.githubusercontent.com/ai-agent-tools/picgen/refs/heads/main/docs/agent-install.md 。你负责判断是否在本机持久环境、安装 CLI 和 skill、引导我配置 provider/API key,并先预览生成方案,等我确认后再生成测试图。不要让我理解命令细节,也不要让我把 API key 发到聊天里。
|
|
38
46
|
```
|
|
39
47
|
|
|
40
|
-
For first-user rollout, see [docs/release-alpha.md](./docs/release-alpha.md).
|
|
48
|
+
For agent-assisted installation, see [docs/agent-install.md](./docs/agent-install.md). For first-user rollout, see [docs/release-alpha.md](./docs/release-alpha.md).
|
|
41
49
|
|
|
42
50
|
## Commands
|
|
43
51
|
|
|
44
52
|
```bash
|
|
45
53
|
picgen setup
|
|
46
54
|
picgen quickstart
|
|
55
|
+
picgen open
|
|
56
|
+
npx -y skills add ai-agent-tools/picgen --skill picgen -g -y --copy
|
|
57
|
+
picgen skill install codex
|
|
47
58
|
picgen update check
|
|
48
59
|
picgen doctor --json
|
|
49
|
-
picgen create --dry-run "
|
|
50
|
-
picgen create --yes "
|
|
60
|
+
picgen create --dry-run --preset fast-draft "一张简洁的 PicGen 测试图"
|
|
61
|
+
picgen create --yes --preset fast-draft "一张简洁的 PicGen 测试图"
|
|
51
62
|
picgen create --dry-run --provider gemini_official --reference ./reference.png "基于参考图生成一张品牌海报"
|
|
52
63
|
picgen create --yes --provider gemini_official --reference ./reference.png "基于参考图生成一张品牌海报"
|
|
53
64
|
picgen provider list
|
|
54
65
|
picgen provider add
|
|
66
|
+
picgen provider quick-add gemini-proxy --host https://www.pandai.vip --prefer
|
|
67
|
+
picgen key set PICGEN_GEMINI_PROXY_KEY --clipboard
|
|
68
|
+
picgen key set PICGEN_GEMINI_PROXY_KEY --stdin
|
|
69
|
+
picgen key list --json
|
|
55
70
|
picgen provider test openai_official --json
|
|
56
71
|
picgen provider prefer gemini_official
|
|
57
72
|
picgen provider disable gemini_proxy
|
|
@@ -66,6 +81,8 @@ Quick-add setup asks only for the essentials: provider name, host URL, API key e
|
|
|
66
81
|
|
|
67
82
|
Real `picgen create` calls ask for confirmation before contacting a provider. Use `--yes` only when you want to skip that CLI confirmation.
|
|
68
83
|
|
|
84
|
+
`picgen open` starts a local web interface at `127.0.0.1`, defaulting to port `8188`. It is a foreground local server: keep the terminal open while using the page, and press Ctrl+C to close it. The page can configure multiple providers, save API keys to PicGen's managed env file, preview generation plans, generate images, and browse saved history under `outputs/picgen`.
|
|
85
|
+
|
|
69
86
|
`--reference <path>` can be repeated to pass local reference images. Alpha supports reference images through the Gemini adapter. The OpenAI-compatible `/v1/images/generations` adapter does not support reference images yet; use a Gemini provider for reference-image generation.
|
|
70
87
|
|
|
71
88
|
Gemini generation requests ask for image-only responses with `responseModalities: ["IMAGE"]`. Provider health checks still use a text-only request so they can verify host, key, model, and endpoint readiness without triggering image generation.
|
|
@@ -91,6 +108,20 @@ OPENAI_API_KEY=...
|
|
|
91
108
|
GEMINI_API_KEY=...
|
|
92
109
|
```
|
|
93
110
|
|
|
111
|
+
For non-technical users, `picgen setup` can save API keys for you in:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
~/.picgen/.env
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
PicGen loads this managed env file automatically. Shell environment variables take priority, and a project `.env` can override the managed file for local testing.
|
|
118
|
+
|
|
119
|
+
Each provider should have its own `api_key_env` value. When adding another provider of the same type, PicGen assigns a new key name by default, such as `PICGEN_GEMINI_PROXY_2_KEY`, so multiple channels do not overwrite each other's API keys.
|
|
120
|
+
|
|
121
|
+
Older configs that reused the same `api_key_env` across multiple providers are migrated automatically when PicGen loads the config. PicGen keeps the first provider unchanged, assigns unique key names to the later providers, and copies the existing key value into the managed env file when the value is available.
|
|
122
|
+
|
|
123
|
+
When agents inspect key configuration, they should use `picgen key list/show` so chat output only contains masked key status. To inspect or edit the full saved key directly, open `~/.picgen/.env`; a project `.env` in the current directory may override it, and shell environment variables take highest priority.
|
|
124
|
+
|
|
94
125
|
You can start from the included example:
|
|
95
126
|
|
|
96
127
|
```bash
|
|
@@ -101,6 +132,12 @@ Provider `base_url` values should be host-only. Do not include `/v1` or `/v1beta
|
|
|
101
132
|
|
|
102
133
|
Providers may optionally set `test_model` in `~/.picgen/config.yaml` when health checks should use a lightweight model instead of the first generation model.
|
|
103
134
|
|
|
135
|
+
Generation requests use adaptive provider timeouts: fast draft requests allow 120s, balanced requests allow 180s, and high quality or large requests allow 300s. If a third-party channel is slower, override it with `PICGEN_PROVIDER_TIMEOUT_MS`:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
PICGEN_PROVIDER_TIMEOUT_MS=450000 picgen create --yes --preset poster "一张产品发布会主视觉"
|
|
139
|
+
```
|
|
140
|
+
|
|
104
141
|
Providers expose capabilities such as `text-to-image` and `reference-image`. Old configs that omit capabilities are upgraded in memory from the provider protocol: Gemini supports both text and reference-image generation, while OpenAI-compatible `/v1/images/generations` supports text-to-image only.
|
|
105
142
|
|
|
106
143
|
Generated image data and provider-only fields such as base64 image payloads and Gemini thought signatures are redacted from metadata. PicGen keeps the generated assets as local image files and keeps stdout compact for agent workflows.
|