Skip to content

Commit 3fa8481

Browse files
authored
Merge pull request #1504 from 3clyp50/a0-cli
skills: update guidance for plugins uninstall(); Flare Tunnel option for A0 CLI connector
2 parents 5479cde + 4359645 commit 3fa8481

6 files changed

Lines changed: 36 additions & 6 deletions

File tree

skills/a0-create-plugin/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ If your plugin needs framework-internal hook points, add a `hooks.py` file at th
282282
- Current built-in usage:
283283
- the plugin installer calls `install()` in `hooks.py` after placing a plugin in `usr/plugins/`
284284
- the plugin updater calls `pre_update()` in `hooks.py` immediately before pulling new plugin code into place
285+
- the plugin uninstaller calls `uninstall()` in `hooks.py` before deleting the plugin directory — use this to clean up any dependencies or state created by `install()`
285286
- Hook functions may be sync or async.
286287
- Hooks should be reversible and cleanup-safe. Prefer framework-managed state and plugin-owned paths over permanent system modifications.
287288

skills/a0-debug-plugin/SKILL.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,21 @@ print('Done')
138138
"
139139
```
140140

141+
If the `uninstall()` hook is not running when the plugin is removed:
142+
- Check the function is named exactly `uninstall` (not `on_uninstall` or similar)
143+
- Check for exceptions in the function
144+
- The `uninstall()` hook is called by `uninstall_plugin()` in `helpers/plugins.py` before the plugin directory is deleted. If the user removed the plugin manually (`rm -rf`), the hook was bypassed — always use the API or UI to uninstall.
145+
- Manually trigger it in the **framework runtime** the same way:
146+
147+
```bash
148+
cd /a0 && /opt/venv-a0/bin/python -c "
149+
import asyncio
150+
from helpers.plugins import call_plugin_hook
151+
asyncio.run(call_plugin_hook('<plugin_name>', 'uninstall'))
152+
print('Done')
153+
"
154+
```
155+
141156
---
142157

143158
## 8. Check Agent Zero logs

skills/a0-plugin-router/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ always_enabled: false # forces ON, disables toggle (framework use only)
7676
| `extensions/webui/<point>/` | HTML/JS injected into UI breakpoints |
7777
| `webui/config.html` | Plugin settings UI |
7878
| `webui/*.html`, `webui/*.js` | Full plugin pages and Alpine stores |
79-
| `hooks.py` | Framework runtime hooks (install, pre_update, cache, registration) |
79+
| `hooks.py` | Framework runtime hooks (install, uninstall, pre_update, cache, registration) |
8080
| `execute.py` | User-triggered script (setup, maintenance, repair) |
8181
| `default_config.yaml` | Settings defaults |
8282
| `README.md` | Optional locally; strongly recommended for community plugins so Plugin Hub users can inspect the plugin |

skills/a0-review-plugin/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Inspect the plugin directory layout:
5252
- [ ] If `agents/` exists: agent profiles with `<profile>/agent.yaml` (standard directory)
5353
- [ ] If `conf/` exists: configuration files such as `model_providers.yaml` (standard directory)
5454
- [ ] If `webui/config.html` exists: plugin must declare at least one `settings_sections` entry
55-
- [ ] If `hooks.py` exists: review whether it defines the lifecycle hook functions the plugin appears to rely on, especially `install` and `pre_update` when the plugin needs install-time or update-time behavior
55+
- [ ] If `hooks.py` exists: review whether it defines the lifecycle hook functions the plugin appears to rely on, especially `install`, `pre_update`, and `uninstall` when the plugin needs install-time, update-time, or cleanup behavior — if `install()` adds dependencies, flag a missing `uninstall()` as WARN
5656
- [ ] If `execute.py` exists: check it has a `main()` function and `if __name__ == "__main__": sys.exit(main())`
5757
- [ ] `LICENSE` at plugin root: Agent Zero does not require it for local plugins, but it is **required** at the repo root before submitting to the Plugin Index. If missing → **WARN**`LICENSE absent — required for community contribution (Plugin Index); optional for local-only use`
5858
- [ ] `default_config.yaml` (if present): valid YAML

skills/a0-review-plugin/checklists.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ save_plugin_config(
232232
## hooks.py Environment Targeting
233233

234234
```python
235-
# hooks.py - install/pre_update hook example
235+
# hooks.py - install/uninstall/pre_update hook example
236236
import subprocess
237237
import sys
238238

@@ -241,6 +241,10 @@ def install():
241241
# This installs into the Agent Zero FRAMEWORK runtime (/opt/venv-a0)
242242
subprocess.run([sys.executable, "-m", "pip", "install", "some-package==1.0.0"], check=True)
243243

244+
def uninstall():
245+
"""Called by framework before deleting plugin directory. Clean up dependencies added by install()."""
246+
subprocess.run([sys.executable, "-m", "pip", "uninstall", "-y", "some-package"], check=True)
247+
244248
def pre_update():
245249
"""Called by framework immediately before plugin update pulls new code into place."""
246250
# This installs into the Agent Zero FRAMEWORK runtime (/opt/venv-a0)

skills/a0-setup-cli/SKILL.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: a0-setup-cli
33
description: Guide the user through installing and connecting the A0 CLI on the host machine so Dockerized Agent Zero can work on real local files. Use when asked to install A0, set up the CLI connector, connect Agent Zero to local files, or troubleshoot host-vs-container setup confusion.
4-
version: 1.0.0
4+
version: 1.1.0
55
author: Agent Zero Team
66
tags: ["agent-zero", "a0", "cli", "connector", "docker", "setup", "local-files"]
77
trigger_patterns:
@@ -106,7 +106,10 @@ Tell the user what to expect:
106106

107107
- `a0` opens the host picker first.
108108
- If Agent Zero is running locally, `a0` may discover it automatically.
109-
- If not, the user can enter the Agent Zero web URL manually.
109+
- If not, the user can enter the Agent Zero web URL manually in the custom URL field.
110+
- The custom URL can be either a normal address with a port, such as `http://localhost:50001`, or a tunnel URL.
111+
- For Flare Tunnel, tell the user to open `Settings > External Services > Flare Tunnel`, click `Create Tunnel`, then copy and paste the HTTPS URL into `a0` exactly as shown.
112+
- Tunnel URLs such as `https://example.trycloudflare.com` do not need a port appended.
110113
- `AGENT_ZERO_HOST` can prefill the target host without bypassing the picker.
111114

112115
Example:
@@ -116,6 +119,13 @@ export AGENT_ZERO_HOST=http://localhost:50001
116119
a0
117120
```
118121

122+
Tunnel example:
123+
124+
```bash
125+
export AGENT_ZERO_HOST=https://example.trycloudflare.com
126+
a0
127+
```
128+
119129
### 8. Define success clearly
120130

121131
Successful setup looks like this:
@@ -130,7 +140,7 @@ Successful setup looks like this:
130140
- If the user says they installed inside Docker or shows `/a0` paths, redirect them to the host-machine install.
131141
- If `a0` gets a connector `404`, explain that the running Agent Zero build likely does not include the builtin `_a0_connector` support yet and should be updated.
132142
- If the browser UI works but `a0` does not, remind them the web UI can run without connector support but the CLI cannot.
133-
- If Docker discovery does not find the instance, have them enter the exact Agent Zero URL or set `AGENT_ZERO_HOST`.
143+
- If Docker discovery does not find the instance, have them enter the exact Agent Zero URL with `host:port`, or create a Flare Tunnel in `Settings > External Services > Flare Tunnel` and paste that HTTPS URL directly.
134144

135145
## Example Requests And Responses
136146

0 commit comments

Comments
 (0)