gfclaw 2.0.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/README.md ADDED
@@ -0,0 +1,238 @@
1
+ # GFClaw
2
+
3
+ <img width="300" alt="image" src="https://github.com/user-attachments/assets/41512c51-e61d-4550-b461-eed06a1b0ec8" />
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx gfclaw@latest
9
+ ```
10
+
11
+ This will:
12
+ 1. Check OpenClaw and dependencies are installed
13
+ 2. Guide you to get a Google Gemini API key
14
+ 3. Install the skill to `~/.openclaw/skills/gfclaw-selfie/`
15
+ 4. Configure OpenClaw to use the skill
16
+ 5. Add selfie capabilities to your agent's SOUL.md
17
+ 6. Configure agent tools (profile, exec, sandbox)
18
+ 7. Optionally **create a brand new agent** with Telegram binding
19
+
20
+ After installation, GFClaw will **onboard you via Telegram** — asking for your preferred reference photo and personality traits on first interaction.
21
+
22
+ ## What It Does
23
+
24
+ GFClaw Selfie enables your OpenClaw agent to:
25
+ - **Generate selfies** using a consistent reference image
26
+ - **Send photos** across all messaging platforms (Telegram, Discord, WhatsApp, etc.)
27
+ - **Respond visually** to "what are you doing?" and "send a pic" requests
28
+
29
+ ### Selfie Modes
30
+
31
+ | Mode | Best For | Keywords |
32
+ |------|----------|----------|
33
+ | **Mirror** | Full-body shots, outfits | wearing, outfit, fashion |
34
+ | **Direct** | Close-ups, locations | cafe, beach, portrait, smile |
35
+
36
+ ## Telegram Onboarding
37
+
38
+ On the **first interaction** via Telegram after installation, GFClaw will:
39
+
40
+ 1. **Ask for a reference photo** — Send any photo of how you want GFClaw to look. This replaces the default `gfclaw.png` for all future selfies.
41
+ 2. **Ask for personality traits** — Tell GFClaw how to act (caring, sassy, chill, chaotic, etc.). She'll adopt that personality completely.
42
+ 3. **Confirm setup** — Once done, GFClaw is ready for selfie requests!
43
+
44
+ ### Changing Settings Later
45
+
46
+ | Command | What it does |
47
+ |---------|-------------|
48
+ | `/newphoto` | Send a new reference photo |
49
+ | `/personality` | Change GFClaw's personality traits |
50
+ | `/status` | Show current setup (image, personality, date) |
51
+
52
+ You can also use natural language: "change my photo", "act more sassy", "update your personality", etc.
53
+
54
+ ## Prerequisites
55
+
56
+ - [OpenClaw](https://github.com/openclaw/openclaw) installed and configured
57
+ - [Google Gemini API key](https://aistudio.google.com/apikey) with billing enabled
58
+ - `jq` and `python3` installed on your system
59
+
60
+ ## Manual Installation
61
+
62
+ If you prefer manual setup:
63
+
64
+ ### 1. Get API Key
65
+
66
+ Visit [aistudio.google.com/apikey](https://aistudio.google.com/apikey) and create an API key. Make sure billing is enabled for image generation.
67
+
68
+ ### 2. Clone the Skill
69
+
70
+ ```bash
71
+ git clone https://github.com/SumeLabs/gfclaw ~/.openclaw/skills/gfclaw-selfie
72
+ ```
73
+
74
+ ### 3. Configure OpenClaw
75
+
76
+ Add to `~/.openclaw/openclaw.json`:
77
+
78
+ ```json
79
+ {
80
+ "skills": {
81
+ "entries": {
82
+ "gfclaw-selfie": {
83
+ "enabled": true
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ Add to `~/.openclaw/.env`:
91
+
92
+ ```
93
+ GEMINI_API_KEY=your_gemini_api_key_here
94
+ ```
95
+
96
+ ### 4. Create Output Directory
97
+
98
+ ```bash
99
+ mkdir -p ~/.openclaw/workspace/.selfie-output
100
+ ```
101
+
102
+ ### 5. Agent Configuration (Important!)
103
+
104
+ Your agent's tools config **must** have:
105
+
106
+ ```json
107
+ {
108
+ "tools": {
109
+ "profile": "full",
110
+ "exec": {
111
+ "security": "full",
112
+ "ask": "off"
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ **Why?**
119
+ - `profile: "full"` — The `"coding"` profile excludes messaging tools, leaving the agent with zero relevant tools
120
+ - `exec.security: "full"` — The agent needs unrestricted exec to run the selfie script
121
+ - Do **NOT** use a `tools.allow` whitelist — it further restricts tools and can result in zero tools available
122
+
123
+ ### 6. Update SOUL.md
124
+
125
+ Add the selfie persona to your agent's `SOUL.md` (see `templates/soul-injection.md` for the full template):
126
+
127
+ ```markdown
128
+ ## GFClaw Selfie Capability
129
+
130
+ You have a physical appearance and can take selfies!
131
+ When users ask for pictures, use the gfclaw-selfie skill.
132
+ ```
133
+
134
+ ### 7. Copy SELFIE-SKILL.md to Workspace
135
+
136
+ If `fs.workspaceOnly: true` is set for your agent, copy the skill docs into the agent's workspace:
137
+
138
+ ```bash
139
+ cp ~/.openclaw/skills/gfclaw-selfie/SKILL.md ~/.openclaw/workspace/SELFIE-SKILL.md
140
+ ```
141
+
142
+ This allows the agent to read the full skill instructions (skill injection only provides a summary).
143
+
144
+ ## Usage Examples
145
+
146
+ Once installed, your agent responds to:
147
+
148
+ ```
149
+ "Send me a selfie"
150
+ "Send a pic wearing a cowboy hat"
151
+ "What are you doing right now?"
152
+ "Show me you at a coffee shop"
153
+ ```
154
+
155
+ ## Reference Image
156
+
157
+ The skill uses a fixed reference image for consistent appearance:
158
+
159
+ ```
160
+ assets/gfclaw.png
161
+ ```
162
+
163
+ You can replace this with your own reference image to customize the agent's appearance.
164
+
165
+ ## Technical Details
166
+
167
+ - **Image Generation**: Google Gemini (`gemini-2.5-flash-image`) — edits the reference image based on prompts
168
+ - **Image Storage**: Temporary files in `~/.openclaw/workspace/.selfie-output/` (auto-deleted after sending)
169
+ - **Messaging**: OpenClaw `message send` CLI
170
+ - **Supported Platforms**: Telegram, Discord, WhatsApp, Slack, Signal, MS Teams
171
+
172
+ ## Project Structure
173
+
174
+ ```
175
+ gfclaw/
176
+ ├── bin/
177
+ │ └── cli.js # npx installer (8-step setup + agent creation)
178
+ ├── skill/
179
+ │ ├── SKILL.md # Skill definition (copied to ~/.openclaw/skills/)
180
+ │ ├── scripts/
181
+ │ │ ├── gfclaw-selfie.sh # Generation + sending script
182
+ │ │ └── save-reference.sh # Base64 image decoder (used during onboarding)
183
+ │ └── assets/
184
+ │ └── gfclaw.png # Default reference image (fallback)
185
+ ├── templates/
186
+ │ └── soul-injection.md # Persona template with onboarding flow
187
+ ├── package.json
188
+ └── README.md
189
+ ```
190
+
191
+
192
+ ## Known Gotchas
193
+
194
+ 1. **`profile: "coding"` = no messaging tools** — Always use `"full"` profile for agents that need to send messages
195
+ 2. **`tools.allow` whitelist stacks with profile** — This can silently reduce available tools to zero. Avoid using it.
196
+ 3. **Skill injection is summary-only** — OpenClaw only injects ~200 chars from the skill into the system prompt. The full SKILL.md must be readable from the agent's workspace (copy it there).
197
+ 4. **`fs.workspaceOnly: true` blocks external reads** — The agent can't read files outside its workspace. Copy any needed docs into the workspace.
198
+ 5. **Output directory must be in the main workspace** — The `openclaw message send` CLI runs under the main agent's context, so files must be in `~/.openclaw/workspace/`.
199
+ 6. **Base64 images can be large** — During onboarding, the agent writes base64 data to a temp file then decodes it via script. This avoids command-line argument length limits.
200
+
201
+ ## Customization
202
+
203
+ ### Change the Reference Image (via Telegram)
204
+
205
+ The easiest way is to send `/newphoto` to GFClaw on Telegram and send a new photo.
206
+
207
+ Alternatively, replace `skill/assets/gfclaw.png` with your own image and reinstall. The Gemini model will edit this image to match selfie requests while maintaining the person's appearance.
208
+
209
+ ### Change the Persona (via Telegram)
210
+
211
+ Send `/personality` to GFClaw on Telegram and describe the new personality you want.
212
+ Alternatively, edit `templates/soul-injection.md` to customize the agent's backstory and behavior, then reinstall.
213
+
214
+ ### Change the Selfie Prompts
215
+
216
+ Edit `skill/scripts/gfclaw-selfie.sh` — look for the `EDIT_PROMPT` variable to customize how mirror and direct selfie prompts are constructed.
217
+
218
+ ### Multi-Agent Setup
219
+
220
+ The installer supports multiple agents on a single gateway. During Step 7, if you enter an agent name that doesn't exist, the installer will offer to create it with:
221
+ - Telegram bot token (from @BotFather)
222
+ - Telegram account binding
223
+ - Allowed user configuration
224
+ - Dedicated workspace directory
225
+
226
+ This is useful for running a dedicated selfie agent alongside your main agent.
227
+
228
+ ## Upgrading from v1 (fal.ai)
229
+
230
+ If you were using the previous version with fal.ai/Grok Imagine:
231
+
232
+ 1. Get a [Gemini API key](https://aistudio.google.com/apikey) (billing required)
233
+ 2. Run `npx gfclaw@latest` to reinstall
234
+ 3. The `FAL_KEY` is no longer needed — you can remove it from your `.env`
235
+
236
+ ## License
237
+
238
+ MIT