Skip to content

Commit c99d347

Browse files
committed
feat: prepare Agent Zero CLI for OSS
- add observer summaries and tighten docs - remove hardcoded collector key and add warnings - refresh README and usage instructions Developed by Wojciech Wiesner wojciech@theones.io -= join.theones.io =- be The One Who Is Many -
0 parents  commit c99d347

97 files changed

Lines changed: 12465 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
A clear description of the bug.
11+
12+
## Steps to Reproduce
13+
1. Go to '...'
14+
2. Run '...'
15+
3. See error
16+
17+
## Expected Behavior
18+
What you expected to happen.
19+
20+
## Actual Behavior
21+
What actually happened.
22+
23+
## Environment
24+
- OS: [e.g., macOS 14, Ubuntu 22.04, Windows 11]
25+
- Python version: [e.g., 3.11.5]
26+
- Agent Zero CLI version: [e.g., 0.1.0]
27+
- Agent Zero version: [e.g., 0.9.7]
28+
29+
## Configuration
30+
```yaml
31+
# Relevant parts of your config.yaml (REDACT ANY API KEYS!)
32+
security:
33+
mode: balanced
34+
```
35+
36+
## Logs
37+
```
38+
# Any relevant error messages or logs
39+
```
40+
41+
## Additional Context
42+
Any other information that might help.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem
10+
What problem does this feature solve? What's the use case?
11+
12+
## Proposed Solution
13+
Describe the feature you'd like to see.
14+
15+
## Alternatives Considered
16+
Any alternative solutions you've thought about.
17+
18+
## Additional Context
19+
Screenshots, mockups, or examples from other tools.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Description
2+
Brief description of changes.
3+
4+
## Type of Change
5+
- [ ] Bug fix
6+
- [ ] New feature
7+
- [ ] Documentation
8+
- [ ] Refactoring
9+
- [ ] Other (describe):
10+
11+
## Checklist
12+
- [ ] I've read CONTRIBUTING.md
13+
- [ ] Tests pass locally (`pytest tests/`)
14+
- [ ] Code follows project style (ran `ruff` and `black`)
15+
- [ ] I've updated documentation if needed
16+
- [ ] No secrets or API keys in the code
17+
18+
## Related Issues
19+
Fixes #(issue number)
20+
21+
## Screenshots (if applicable)

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.11"
17+
- name: Install linters
18+
run: pip install ruff black
19+
- name: Run ruff
20+
run: ruff check . --exit-zero
21+
- name: Check black formatting
22+
run: black --check . --exclude venv || true
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
python: ["3.10", "3.11", "3.12"]
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python }}
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
38+
pip install pytest pytest-asyncio
39+
- name: Install package
40+
run: pip install . --no-build-isolation
41+
- name: Run tests
42+
run: pytest tests/ -v

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Python
2+
__pycache__/
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
7+
# Virtualenv
8+
venv/
9+
.venv/
10+
11+
# Build artifacts
12+
*.egg-info/
13+
14+
# Logs and cache
15+
.pytest_cache/
16+
.mypy_cache/
17+
.ruff_cache/
18+
19+
# Editors / OS
20+
.idea/
21+
.vscode/
22+
.DS_Store
23+
24+
# Local config and secrets
25+
.env
26+
.env.*
27+
config.yaml
28+
config.local.yaml
29+
config.local.yml
30+
31+
# App data
32+
.a0/
33+
.a0_cli_history
34+
uploads/
35+
.snapshots/
36+
feed.theones.io/api/news.json

AGENTS.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# AGENTS.md — Agent Zero CLI
2+
3+
## Purpose
4+
5+
This file orients agentic coding assistants working in this repo. Keep edits small, follow existing conventions, and validate with tests/lint.
6+
7+
## Repo Overview
8+
9+
- Python 3.10+ CLI/TUI client for Agent Zero
10+
- Entry points: `a0cli` (CLI) and `a0tui` (TUI)
11+
- Core modules: `backend.py`, `cli/`, `ui/`, `observer/`, `llm_providers/`
12+
- Tests live in `tests/`
13+
14+
## Quick Start (Dev)
15+
16+
```bash
17+
python -m venv venv
18+
source venv/bin/activate # Windows: venv\Scripts\activate
19+
pip install -e ".[dev]"
20+
```
21+
22+
## Build / Run Commands
23+
24+
- Run CLI: `a0cli` or `python -m cli`
25+
- Run TUI: `a0tui` or `python -m main_new`
26+
- Package build (optional): `python -m build`
27+
28+
## Lint / Format
29+
30+
- Lint: `ruff check .`
31+
- Format check: `black --check .`
32+
- Auto-format: `black .`
33+
- Optional autofix: `ruff check . --fix`
34+
35+
## Tests
36+
37+
- Run full suite: `pytest tests/`
38+
- Run with coverage: `pytest tests/ --cov=. --cov-report=html`
39+
- Run a single file: `pytest tests/test_backend_context.py`
40+
- Run a single test: `pytest tests/test_backend_context.py::TestContextBuilder::test_preview_redaction`
41+
- Run by keyword: `pytest -k "context"`
42+
- E2E (mock server): `scripts/run_e2e.sh`
43+
44+
## Cursor / Copilot Rules
45+
46+
- No `.cursor/rules`, `.cursorrules`, or `.github/copilot-instructions.md` found in this repo.
47+
48+
## Code Style & Conventions
49+
50+
### Python & Typing
51+
52+
- Target Python 3.10+.
53+
- Use type hints for function signatures and public APIs.
54+
- Prefer `Optional[T]` or `T | None` over implicit `None`.
55+
- Keep functions small and focused; avoid side effects in helpers.
56+
57+
### Formatting
58+
59+
- Formatting is enforced by Black.
60+
- Line length is 100 characters (`[tool.black]` and `[tool.ruff]`).
61+
- Do not hand-format to a different width.
62+
63+
### Imports
64+
65+
- Follow Ruff import sorting (isort-style).
66+
- Group imports in this order: standard library, third-party, local.
67+
- Keep imports explicit; avoid `from x import *`.
68+
69+
### Naming
70+
71+
- Functions/variables: `snake_case`.
72+
- Classes: `PascalCase`.
73+
- Constants: `UPPER_SNAKE_CASE`.
74+
- Async functions: suffix with `_async` only if it clarifies intent.
75+
76+
### Error Handling
77+
78+
- Catch specific exceptions; avoid bare `except`.
79+
- Log with `logging.getLogger("agentzero.<module>")`.
80+
- Return safe, user-facing messages rather than raw stack traces.
81+
- Preserve original exceptions where helpful for debugging.
82+
83+
### Async & IO
84+
85+
- Prefer `async`/`await` with `aiohttp` where used.
86+
- Use timeouts and close sessions with context managers.
87+
- Avoid blocking calls in async paths; use `asyncio.to_thread` if needed.
88+
89+
### Configuration & Secrets
90+
91+
- Config lives in `config.yaml` / `config.example.yaml`.
92+
- Environment variables are prefixed with `AGENTZERO_`.
93+
- Never commit secrets or real API keys.
94+
95+
### Logging & Output
96+
97+
- Use `logging` instead of `print`.
98+
- Keep user-facing messages consistent with existing CLI/TUI output styles.
99+
100+
### Tests
101+
102+
- Use pytest and pytest-asyncio (`asyncio_mode = auto`).
103+
- Add tests for new behaviors; keep them deterministic.
104+
- Prefer unit tests in `tests/` over ad-hoc scripts.
105+
106+
## Repo Layout
107+
108+
- `backend.py` — Agent Zero client + context builder
109+
- `cli/` — CLI interface and slash commands
110+
- `ui/` — Textual-based TUI
111+
- `observer/` — Tool routing and observer logic
112+
- `llm_providers/` — LLM integration adapters
113+
- `docs/` — Project docs and specs
114+
115+
## Change Hygiene
116+
117+
- Keep diffs minimal and scoped to the task.
118+
- Do not add new dependencies without explicit approval.
119+
- Update docs when behavior or config changes.
120+
- Prefer tests + lint before requesting review.
121+
122+
## Security Notes
123+
124+
- Redact or exclude sensitive data in logs and previews.
125+
- Be careful with filesystem operations; avoid destructive defaults.
126+
127+
## How to Add New Tests
128+
129+
1. Place tests in `tests/` using `test_*.py` naming.
130+
2. Name test classes `TestSomething` and test functions `test_something`.
131+
3. For async tests, use `async def` + pytest-asyncio.
132+
133+
## Definition of Done
134+
135+
- Lint and format checks pass.
136+
- Relevant tests pass (or clearly noted).
137+
- No secrets added to git.
138+
- Documentation updated when needed.

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to Agent Zero CLI will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Preparing for public open source release
12+
13+
## [0.1.0] - 2025-01-12
14+
15+
### Added
16+
- Initial beta release
17+
- TUI interface with Textual framework
18+
- CLI interface (non-TUI mode)
19+
- Three security modes: `paranoid`, `balanced`, `god_mode`
20+
- Tool approval system with human-in-the-loop
21+
- Context builder with file tree, previews, git status
22+
- 12 retro-inspired themes (C64, Atari, ZX Spectrum, Mac Classic, etc.)
23+
- Multi-project workspace support
24+
- Agent profile switching
25+
- Real-time streaming of agent responses
26+
- Live feed with status/thinking/tool events
27+
- Built-in Space Invaders arcade game
28+
- Shell command whitelist/blacklist
29+
- Sensitive data redaction in context previews
30+
- OpenRouter and MCP Gateway LLM provider support
31+
- Observer system for workspace monitoring
32+
33+
### Security
34+
- Context preview redaction for API keys and secrets
35+
- Sensitive file exclusion (config.yaml, .env)
36+
- Symlink traversal protection

0 commit comments

Comments
 (0)