Skip to content

Commit 48bbe77

Browse files
authored
Merge pull request #1496 from 3clyp50/cli
add a0-setup-cli Skill and restore lexical trigger matching
2 parents e131b65 + 954eca3 commit 48bbe77

File tree

12 files changed

+379
-36
lines changed

12 files changed

+379
-36
lines changed

docs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ Welcome to the Agent Zero documentation hub. Whether you're getting started or d
77

88
- **[Quickstart Guide](quickstart.md):** Get up and running in 5 minutes with Agent Zero.
99
- **[Installation Guide](setup/installation.md):** Install scripts, updates, and advanced Docker setup (includes [How to Update](setup/installation.md#how-to-update-agent-zero)).
10+
- **[A0 CLI Connector](guides/a0-cli-connector.md):** Install the terminal-native connector, connect it to Agent Zero, and copy a setup brief for another agent.
1011
- **[Self Update](guides/self-update.md):** How the in-app updater works (technical reference).
1112
- **[VPS Deployment](setup/vps-deployment.md):** Deploy Agent Zero on a remote server.
1213
- **[Development Setup](setup/dev-setup.md):** Set up a local development environment.
1314

1415
## User Guides
1516

1617
- **[Usage Guide](guides/usage.md):** Comprehensive guide to Agent Zero's features and capabilities.
18+
- **[A0 CLI Connector](guides/a0-cli-connector.md):** Terminal-first companion workflow for Agent Zero.
1719
- **[Projects Tutorial](guides/projects.md):** Learn to create isolated workspaces with dedicated context and memory.
1820
- **[API Integration](guides/api-integration.md):** Add external APIs without writing code.
1921
- **[MCP Setup](guides/mcp-setup.md):** Configure Model Context Protocol servers.
@@ -69,6 +71,7 @@ Welcome to the Agent Zero documentation hub. Whether you're getting started or d
6971
- [Self Update (technical)](guides/self-update.md)
7072
- [VPS Deployment](setup/vps-deployment.md)
7173
- [Development Setup](setup/dev-setup.md)
74+
- [A0 CLI Connector](guides/a0-cli-connector.md)
7275

7376
- [User Guides](#user-guides)
7477
- [Usage Guide](guides/usage.md)
@@ -91,6 +94,7 @@ Welcome to the Agent Zero documentation hub. Whether you're getting started or d
9194
- [Voice Interface](guides/usage.md#voice-interface)
9295
- [Memory Management](guides/usage.md#memory-management)
9396
- [Backup & Restore](guides/usage.md#backup--restore)
97+
- [A0 CLI Connector](guides/a0-cli-connector.md)
9498
- [Projects Tutorial](guides/projects.md)
9599
- [API Integration](guides/api-integration.md)
96100
- [MCP Setup](guides/mcp-setup.md)

docs/guides/a0-cli-connector.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# A0 CLI Connector
2+
3+
Agent Zero lives in Docker for a reason. That keeps it safer. The problem is that people see Docker and assume the agent can never really touch the code on their computer.
4+
5+
A0 CLI is the answer to that.
6+
7+
Agent Zero stays in Docker. A0 CLI installs on the host machine. That is what lets Agent Zero finally work on the real files on your real computer.
8+
9+
For now, use the install commands below.
10+
11+
## Quick Install
12+
13+
**macOS / Linux:**
14+
```bash
15+
curl -LsSf https://raw.githubusercontent.com/agent0ai/a0-connector/main/install.sh | sh
16+
```
17+
18+
**Windows (PowerShell):**
19+
```powershell
20+
irm https://raw.githubusercontent.com/agent0ai/a0-connector/main/install.ps1 | iex
21+
```
22+
23+
**Manual fallback when uv is already installed or if URLs give 404:**
24+
```bash
25+
uv tool install git+https://github.com/agent0ai/a0-connector
26+
```
27+
28+
Run these on the host machine, not inside the Agent Zero container.
29+
30+
The installer uses `uv`, and `uv` will select or download a compatible Python if needed.
31+
32+
## Open it and start working
33+
34+
1. Make sure Agent Zero is already running.
35+
2. Launch A0 CLI on the host machine:
36+
37+
```bash
38+
a0
39+
```
40+
41+
3. If Agent Zero is running on the same machine, A0 CLI will usually find it for you.
42+
4. If Agent Zero is somewhere else, enter the exact web address or set `AGENT_ZERO_HOST` as env variable before launching `a0`.
43+
5. Open or create a chat and confirm you can talk to Agent Zero from the host machine.
44+
45+
> [!NOTE]
46+
> Current Agent Zero builds starting from v1.9 include the builtin connector support that A0 CLI expects. If you see a connector-specific `404`, update Agent Zero first.
47+
48+
## Give this to another agent
49+
50+
If another agent is helping with setup, do not paste a whole checklist. Paste one line:
51+
52+
```text
53+
Set up the A0 CLI connector for Agent Zero on this machine using the a0-setup-cli Skill.
54+
```
55+
56+
## Troubleshooting
57+
58+
- **Nothing appears locally:** Enter the Agent Zero web address manually or export `AGENT_ZERO_HOST`.
59+
- **You tried to install from inside Docker:** A0 CLI belongs on the host machine. Agent Zero stays in Docker.
60+
- **Function keys do nothing:** Some terminals and IDEs capture function keys. Use `Ctrl+P`.
61+
- **Connector route returns `404`:** Update Agent Zero to a build with builtin connector support.
62+
63+
## Related links
64+
65+
- [Quick Start](../quickstart.md)
66+
- [Installation Guide](../setup/installation.md)

docs/quickstart.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,34 @@ Follow the CLI prompts for port and authentication, complete onboarding, then op
2323
> [!NOTE]
2424
> For manual Docker Desktop setup, volume mapping, and platform-specific detail, see the [Installation Guide](setup/installation.md#manual-installation-advanced).
2525
26+
## Use Agent Zero on your real local files
27+
28+
If you want Agent Zero to work on the actual files on your computer, this is the important part.
29+
30+
Agent Zero stays in Docker for safety. The A0 CLI installs and runs on your host machine. That host-side CLI is what lets Agent Zero work on the real files on your real computer.
31+
32+
**macOS / Linux:**
33+
```bash
34+
curl -LsSf https://raw.githubusercontent.com/agent0ai/a0-connector/main/install.sh | sh
35+
```
36+
37+
**Windows (PowerShell):**
38+
```powershell
39+
irm https://raw.githubusercontent.com/agent0ai/a0-connector/main/install.ps1 | iex
40+
```
41+
42+
Run those on the host machine, not inside the Agent Zero container.
43+
44+
Then launch:
45+
46+
```bash
47+
a0
48+
```
49+
50+
Once `a0` connects, open or create a chat there. That is the path that lets Agent Zero stay in Docker while still working on real local files on your machine.
51+
52+
For the full setup flow, manual fallback install paths, remote-host tips, and a copy-ready brief for another agent, see the [A0 CLI Connector guide](guides/a0-cli-connector.md).
53+
2654
### Open the Web UI and configure your API key
2755

2856
Open your browser and navigate to `http://localhost:<PORT>`. The Web UI will show the onboarding banner. Click Start Onboarding to set your AI models and API key.

docs/setup/installation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ docker run -p 80:80 agent0ai/agent-zero
2525

2626
Once the install completes, open the URL shown in your terminal to access the Web UI. Follow the prompts in the CLI to set your port and authentication, complete onboarding, add your API key, then continue to [Step 3: Configure Agent Zero](#step-3-configure-agent-zero).
2727

28+
> [!TIP]
29+
> Prefer a terminal-native workflow too? Install the optional [A0 CLI Connector](../guides/a0-cli-connector.md) from GitHub, then run `a0` to connect to this Agent Zero instance from your terminal.
30+
2831
---
2932

3033
## How to Update Agent Zero
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from agent import LoopData
2+
from helpers.extension import Extension
3+
from helpers import skills as skills_helper
4+
5+
6+
class RecallRelevantSkills(Extension):
7+
async def execute(self, loop_data: LoopData = LoopData(), **kwargs):
8+
if not self.agent or loop_data.iteration != 0:
9+
return
10+
11+
user_instruction = (
12+
loop_data.user_message.output_text() if loop_data.user_message else ""
13+
).strip()
14+
if len(user_instruction) < 8:
15+
return
16+
17+
matches = skills_helper.search_skills(
18+
user_instruction,
19+
limit=6,
20+
agent=self.agent,
21+
)
22+
if not matches:
23+
return
24+
25+
lines: list[str] = []
26+
for skill in matches:
27+
name = skill.name.strip().replace("\n", " ")[:100]
28+
desc = (skill.description or "").replace("\n", " ").strip()
29+
if len(desc) > 220:
30+
desc = desc[:220].rstrip() + "…"
31+
lines.append(f"- {name}: {desc}")
32+
33+
if not lines:
34+
return
35+
36+
loop_data.extras_temporary["relevant_skills"] = self.agent.read_prompt(
37+
"agent.system.skills.relevant.md",
38+
skills="\n".join(lines),
39+
)

helpers/skills.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,23 +450,43 @@ def search_skills(
450450
if not q:
451451
return []
452452

453-
terms = [t for t in re.split(r"\s+", q) if t]
453+
raw_terms = [t for t in re.split(r"\s+", q) if t]
454+
terms = [
455+
t for t in raw_terms
456+
if len(t) >= 3 or any(ch.isdigit() for ch in t)
457+
] or raw_terms
454458
candidates = list_skills(agent)
455459

456460
scored: List[Tuple[int, Skill]] = []
457461
for s in candidates:
458462
name = s.name.lower()
459463
desc = (s.description or "").lower()
460464
tags = [t.lower() for t in s.tags]
465+
triggers = [t.lower() for t in s.triggers]
461466

462467
score = 0
468+
if q == name:
469+
score += 10
470+
if any(q == trigger for trigger in triggers):
471+
score += 9
472+
if q in name:
473+
score += 6
474+
if q in desc:
475+
score += 4
476+
if any(q in tag for tag in tags):
477+
score += 3
478+
if any(q in trigger for trigger in triggers):
479+
score += 8
480+
463481
for term in terms:
464482
if term in name:
465483
score += 3
466484
if term in desc:
467485
score += 2
468486
if any(term in tag for tag in tags):
469487
score += 1
488+
if any(term in trigger for trigger in triggers):
489+
score += 4
470490

471491
if score > 0:
472492
scored.append((score, s))
@@ -524,4 +544,3 @@ def validate_skill_md(skill_md_path: Path) -> List[str]:
524544
if not skill:
525545
return ["Unable to parse SKILL.md frontmatter"]
526546
return validate_skill(skill)
527-

helpers/skills_cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,19 @@ class Skill:
4242
def get_skills_dirs() -> List[Path]:
4343
"""Get all skill directories"""
4444
base = Path(files.get_abs_path("usr", "skills"))
45-
return [
45+
roots = [
46+
Path(files.get_abs_path("skills")),
47+
base,
4648
base / "custom",
4749
base / "default",
4850
]
51+
seen: set[Path] = set()
52+
ordered: List[Path] = []
53+
for root in roots:
54+
if root not in seen:
55+
seen.add(root)
56+
ordered.append(root)
57+
return ordered
4958

5059

5160
def parse_skill_file(skill_path: Path) -> Optional[Skill]:

prompts/agent.system.skills.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
## skills
2-
use `skills_tool:list` to discover skills when specialized instructions may help
2+
use `skills_tool:search` when the user's wording sounds like a task, trigger phrase, or keyword match for a skill
3+
use `skills_tool:list` when you need a broader catalog view
34
use `skills_tool:load` before following a skill
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# relevant skills
2+
- the following skills matched the user's current request by lexical search, including trigger phrases
3+
- use `skills_tool:load` to load one before following it
4+
5+
{{skills}}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
### skills_tool
22
use skills only when relevant
33
workflow:
4+
- `skills_tool:search`: find candidate skills by keywords or trigger phrases from the current task
45
- `skills_tool:list`: discover available skills
56
- `skills_tool:load`: load one skill by `skill_name`
67
after loading a skill, follow its instructions and use referenced files or scripts with other tools
78
reload a skill if its instructions are no longer in context
89
example:
910
~~~json
1011
{
11-
"thoughts": ["A skill may already encode the workflow I need."],
12-
"headline": "Loading relevant skill",
13-
"tool_name": "skills_tool:load",
12+
"thoughts": ["The user's request sounds like a skill trigger phrase, so I should search first."],
13+
"headline": "Searching for relevant skill",
14+
"tool_name": "skills_tool:search",
1415
"tool_args": {
15-
"skill_name": "playwright"
16+
"query": "set up a0 cli connector"
1617
}
1718
}
1819
~~~

0 commit comments

Comments
 (0)