eva-cli 3.0.0__tar.gz
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.
- eva_cli-3.0.0/.github/workflows/ci.yaml +46 -0
- eva_cli-3.0.0/.github/workflows/release.yml +108 -0
- eva_cli-3.0.0/.gitignore +58 -0
- eva_cli-3.0.0/.pre-commit-config.yaml +6 -0
- eva_cli-3.0.0/CHANGELOG.md +79 -0
- eva_cli-3.0.0/CONTRIBUTING.md +105 -0
- eva_cli-3.0.0/Dockerfile +60 -0
- eva_cli-3.0.0/LICENSE +21 -0
- eva_cli-3.0.0/PKG-INFO +344 -0
- eva_cli-3.0.0/README.md +314 -0
- eva_cli-3.0.0/SECURITY.md +77 -0
- eva_cli-3.0.0/assets/demo.gif +0 -0
- eva_cli-3.0.0/assets/demo2.gif +0 -0
- eva_cli-3.0.0/assets/demo3.gif +0 -0
- eva_cli-3.0.0/assets/demo4.gif +0 -0
- eva_cli-3.0.0/assets/demo5.gif +0 -0
- eva_cli-3.0.0/assets/logo.png +0 -0
- eva_cli-3.0.0/install.sh +59 -0
- eva_cli-3.0.0/pyproject.toml +55 -0
- eva_cli-3.0.0/rust/eva_fastwalk/Cargo.lock +423 -0
- eva_cli-3.0.0/rust/eva_fastwalk/Cargo.toml +13 -0
- eva_cli-3.0.0/rust/eva_fastwalk/src/lib.rs +139 -0
- eva_cli-3.0.0/src/eva/__init__.py +3 -0
- eva_cli-3.0.0/src/eva/budget.py +31 -0
- eva_cli-3.0.0/src/eva/cache/__init__.py +17 -0
- eva_cli-3.0.0/src/eva/cache/cache.py +40 -0
- eva_cli-3.0.0/src/eva/cache.py +19 -0
- eva_cli-3.0.0/src/eva/chat_session.py +5 -0
- eva_cli-3.0.0/src/eva/cli/__init__.py +3 -0
- eva_cli-3.0.0/src/eva/cli/app.py +851 -0
- eva_cli-3.0.0/src/eva/cli.py +5 -0
- eva_cli-3.0.0/src/eva/config/__init__.py +33 -0
- eva_cli-3.0.0/src/eva/config/config.py +129 -0
- eva_cli-3.0.0/src/eva/config.py +35 -0
- eva_cli-3.0.0/src/eva/context/__init__.py +19 -0
- eva_cli-3.0.0/src/eva/context/finder.py +5 -0
- eva_cli-3.0.0/src/eva/context/gitignore.py +5 -0
- eva_cli-3.0.0/src/eva/context/io.py +5 -0
- eva_cli-3.0.0/src/eva/context/tokenizer.py +5 -0
- eva_cli-3.0.0/src/eva/context/tree.py +5 -0
- eva_cli-3.0.0/src/eva/diagnostics.py +9 -0
- eva_cli-3.0.0/src/eva/git_ops.py +15 -0
- eva_cli-3.0.0/src/eva/indexing/__init__.py +18 -0
- eva_cli-3.0.0/src/eva/indexing/finder.py +42 -0
- eva_cli-3.0.0/src/eva/indexing/io.py +35 -0
- eva_cli-3.0.0/src/eva/indexing/repo_index.py +240 -0
- eva_cli-3.0.0/src/eva/indexing/tokenizer.py +37 -0
- eva_cli-3.0.0/src/eva/indexing/tree.py +60 -0
- eva_cli-3.0.0/src/eva/plugins/__init__.py +3 -0
- eva_cli-3.0.0/src/eva/prompts/__init__.py +36 -0
- eva_cli-3.0.0/src/eva/providers/__init__.py +150 -0
- eva_cli-3.0.0/src/eva/providers/gemini_provider.py +72 -0
- eva_cli-3.0.0/src/eva/providers/groq_provider.py +37 -0
- eva_cli-3.0.0/src/eva/providers/llamacpp_provider.py +69 -0
- eva_cli-3.0.0/src/eva/providers/ollama_provider.py +70 -0
- eva_cli-3.0.0/src/eva/providers/openai_compat.py +57 -0
- eva_cli-3.0.0/src/eva/providers/opencode_zen_provider.py +53 -0
- eva_cli-3.0.0/src/eva/providers/openrouter_provider.py +55 -0
- eva_cli-3.0.0/src/eva/replay/__init__.py +11 -0
- eva_cli-3.0.0/src/eva/replay/player.py +91 -0
- eva_cli-3.0.0/src/eva/replay/recorder.py +67 -0
- eva_cli-3.0.0/src/eva/router/__init__.py +25 -0
- eva_cli-3.0.0/src/eva/router/gemini_provider.py +5 -0
- eva_cli-3.0.0/src/eva/router/groq_provider.py +5 -0
- eva_cli-3.0.0/src/eva/router/openai_compat.py +5 -0
- eva_cli-3.0.0/src/eva/router/opencode_zen_provider.py +5 -0
- eva_cli-3.0.0/src/eva/router/openrouter_provider.py +5 -0
- eva_cli-3.0.0/src/eva/security/__init__.py +32 -0
- eva_cli-3.0.0/src/eva/security/audit.py +126 -0
- eva_cli-3.0.0/src/eva/security/redaction.py +80 -0
- eva_cli-3.0.0/src/eva/security/sandbox.py +55 -0
- eva_cli-3.0.0/src/eva/security/work_safety.py +85 -0
- eva_cli-3.0.0/src/eva/shell/__init__.py +3 -0
- eva_cli-3.0.0/src/eva/shell/runner.py +6 -0
- eva_cli-3.0.0/src/eva/telemetry/__init__.py +10 -0
- eva_cli-3.0.0/src/eva/telemetry/diagnostics.py +43 -0
- eva_cli-3.0.0/src/eva/telemetry/metrics.py +68 -0
- eva_cli-3.0.0/src/eva/ui/formatter.py +46 -0
- eva_cli-3.0.0/src/eva/ui/streaming.py +21 -0
- eva_cli-3.0.0/src/eva/work_safety.py +21 -0
- eva_cli-3.0.0/src/eva/workflows/__init__.py +39 -0
- eva_cli-3.0.0/src/eva/workflows/budget.py +139 -0
- eva_cli-3.0.0/src/eva/workflows/builtins/dependency_audit.yaml +12 -0
- eva_cli-3.0.0/src/eva/workflows/builtins/repo_health.yaml +16 -0
- eva_cli-3.0.0/src/eva/workflows/builtins/security_scan.yaml +12 -0
- eva_cli-3.0.0/src/eva/workflows/chat_session.py +54 -0
- eva_cli-3.0.0/src/eva/workflows/engine.py +267 -0
- eva_cli-3.0.0/src/eva/workspace/__init__.py +39 -0
- eva_cli-3.0.0/src/eva/workspace/git_ops.py +202 -0
- eva_cli-3.0.0/src/eva/workspace/gitignore.py +47 -0
- eva_cli-3.0.0/src/eva/workspace/session.py +184 -0
- eva_cli-3.0.0/tests/conftest.py +20 -0
- eva_cli-3.0.0/tests/fixtures/golden/patches/sample1_expected.diff +6 -0
- eva_cli-3.0.0/tests/fixtures/golden/patches/sample1_fenced.txt +8 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/analyze_system_prompt.txt +3 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/ask_system_prompt.txt +2 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/chat_system_prompt.txt +2 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/commit_system_prompt.txt +3 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/edit_system_prompt.txt +6 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/explain_system_prompt.txt +3 -0
- eva_cli-3.0.0/tests/fixtures/golden/prompts/work_system_prompt.txt +4 -0
- eva_cli-3.0.0/tests/test_basic.py +105 -0
- eva_cli-3.0.0/tests/unit/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/cache/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/cache/test_cache.py +22 -0
- eva_cli-3.0.0/tests/unit/cli/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/cli/test_cli.py +29 -0
- eva_cli-3.0.0/tests/unit/cli/test_cli_commands.py +142 -0
- eva_cli-3.0.0/tests/unit/cli/test_cli_coverage.py +55 -0
- eva_cli-3.0.0/tests/unit/cli/test_cli_more.py +67 -0
- eva_cli-3.0.0/tests/unit/config/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/config/test_config.py +29 -0
- eva_cli-3.0.0/tests/unit/config/test_config_keys.py +84 -0
- eva_cli-3.0.0/tests/unit/golden/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/golden/test_golden_patches.py +31 -0
- eva_cli-3.0.0/tests/unit/golden/test_golden_prompts.py +49 -0
- eva_cli-3.0.0/tests/unit/indexing/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/indexing/test_indexing.py +32 -0
- eva_cli-3.0.0/tests/unit/indexing/test_indexing_more.py +35 -0
- eva_cli-3.0.0/tests/unit/indexing/test_repo_index.py +68 -0
- eva_cli-3.0.0/tests/unit/providers/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/providers/test_offline_providers.py +133 -0
- eva_cli-3.0.0/tests/unit/providers/test_provider_coverage.py +81 -0
- eva_cli-3.0.0/tests/unit/providers/test_provider_errors.py +51 -0
- eva_cli-3.0.0/tests/unit/providers/test_providers.py +92 -0
- eva_cli-3.0.0/tests/unit/providers/test_providers_more.py +34 -0
- eva_cli-3.0.0/tests/unit/replay/test_replay.py +55 -0
- eva_cli-3.0.0/tests/unit/security/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/security/test_audit_chain.py +65 -0
- eva_cli-3.0.0/tests/unit/security/test_redaction.py +53 -0
- eva_cli-3.0.0/tests/unit/security/test_safety_audit.py +32 -0
- eva_cli-3.0.0/tests/unit/security/test_sandbox.py +31 -0
- eva_cli-3.0.0/tests/unit/security/test_work_safety.py +119 -0
- eva_cli-3.0.0/tests/unit/shell/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/shell/test_shell.py +7 -0
- eva_cli-3.0.0/tests/unit/telemetry/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/telemetry/test_metrics.py +72 -0
- eva_cli-3.0.0/tests/unit/telemetry/test_telemetry.py +16 -0
- eva_cli-3.0.0/tests/unit/test_compatibility_imports.py +25 -0
- eva_cli-3.0.0/tests/unit/ui/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/ui/test_ui.py +25 -0
- eva_cli-3.0.0/tests/unit/workflows/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/workflows/test_chat_session.py +26 -0
- eva_cli-3.0.0/tests/unit/workflows/test_workflow_engine.py +147 -0
- eva_cli-3.0.0/tests/unit/workflows/test_workflows.py +31 -0
- eva_cli-3.0.0/tests/unit/workspace/__init__.py +1 -0
- eva_cli-3.0.0/tests/unit/workspace/test_git_ops.py +41 -0
- eva_cli-3.0.0/tests/unit/workspace/test_session_workspace.py +102 -0
- eva_cli-3.0.0/tests/unit/workspace/test_workspace.py +19 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
|
|
22
|
+
- name: Install ripgrep
|
|
23
|
+
run: sudo apt-get update && sudo apt-get install -y ripgrep
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: python -m pip install -e ".[dev]"
|
|
27
|
+
|
|
28
|
+
- name: Lint with Ruff
|
|
29
|
+
run: ruff check .
|
|
30
|
+
|
|
31
|
+
- name: Check code formatting
|
|
32
|
+
run: ruff format --check .
|
|
33
|
+
|
|
34
|
+
- name: Run test suite with 85% coverage gate
|
|
35
|
+
run: pytest -v --cov=eva --cov-report=term-missing --cov-fail-under=85
|
|
36
|
+
|
|
37
|
+
docker:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- name: Build Docker image
|
|
43
|
+
run: docker build -t eva-cli:latest .
|
|
44
|
+
|
|
45
|
+
- name: Verify Docker container execution
|
|
46
|
+
run: docker run --rm eva-cli:latest --version
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write # to attach files to the GitHub Release
|
|
9
|
+
id-token: write # for PyPI trusted publishing (OIDC)
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build sdist and wheel
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install build tool
|
|
23
|
+
run: python -m pip install --upgrade build
|
|
24
|
+
|
|
25
|
+
- name: Build sdist + wheel
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Upload build artifacts
|
|
29
|
+
uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: dist
|
|
32
|
+
path: dist/*
|
|
33
|
+
|
|
34
|
+
publish-pypi:
|
|
35
|
+
name: Publish to PyPI
|
|
36
|
+
needs: build
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
environment: pypi
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist
|
|
44
|
+
|
|
45
|
+
- name: Publish to PyPI
|
|
46
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
47
|
+
# No password/token needed: uses OIDC trusted publishing.
|
|
48
|
+
|
|
49
|
+
github-release:
|
|
50
|
+
name: Attach files to GitHub Release
|
|
51
|
+
needs: build
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/download-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: dist
|
|
57
|
+
path: dist
|
|
58
|
+
|
|
59
|
+
- name: Create/update GitHub Release
|
|
60
|
+
uses: softprops/action-gh-release@v2
|
|
61
|
+
with:
|
|
62
|
+
files: dist/*
|
|
63
|
+
generate_release_notes: true
|
|
64
|
+
|
|
65
|
+
publish-docker:
|
|
66
|
+
name: Build and push Docker image to GHCR
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
permissions:
|
|
69
|
+
contents: read
|
|
70
|
+
packages: write
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v4
|
|
73
|
+
|
|
74
|
+
- name: Set up QEMU (for arm64 build)
|
|
75
|
+
uses: docker/setup-qemu-action@v3
|
|
76
|
+
|
|
77
|
+
- name: Set up Docker Buildx
|
|
78
|
+
uses: docker/setup-buildx-action@v3
|
|
79
|
+
|
|
80
|
+
- name: Log in to GHCR
|
|
81
|
+
uses: docker/login-action@v3
|
|
82
|
+
with:
|
|
83
|
+
registry: ghcr.io
|
|
84
|
+
username: ${{ github.actor }}
|
|
85
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
|
|
87
|
+
- name: Derive tags/labels from the git tag
|
|
88
|
+
id: meta
|
|
89
|
+
uses: docker/metadata-action@v5
|
|
90
|
+
with:
|
|
91
|
+
images: ghcr.io/${{ github.repository }}
|
|
92
|
+
tags: |
|
|
93
|
+
type=semver,pattern={{version}}
|
|
94
|
+
type=raw,value=latest
|
|
95
|
+
|
|
96
|
+
- name: Build and push (linux/amd64 + linux/arm64)
|
|
97
|
+
uses: docker/build-push-action@v6
|
|
98
|
+
with:
|
|
99
|
+
context: .
|
|
100
|
+
platforms: linux/amd64,linux/arm64
|
|
101
|
+
push: true
|
|
102
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
103
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
104
|
+
|
|
105
|
+
# One-time manual step after your FIRST push: open the package on GitHub
|
|
106
|
+
# (org/user Packages tab) -> Package settings -> change visibility to
|
|
107
|
+
# Public. Without this, `docker pull ghcr.io/rootagi/eva` will 401 for
|
|
108
|
+
# anyone who isn't logged in.
|
eva_cli-3.0.0/.gitignore
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# Unit test / linter caches
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.ruff_cache/
|
|
32
|
+
.coverage
|
|
33
|
+
htmlcov/
|
|
34
|
+
|
|
35
|
+
# Virtual Environments
|
|
36
|
+
venv/
|
|
37
|
+
env/
|
|
38
|
+
.venv/
|
|
39
|
+
|
|
40
|
+
# Rust build artifacts
|
|
41
|
+
rust/**/target/
|
|
42
|
+
target/
|
|
43
|
+
|
|
44
|
+
# Logs and databases
|
|
45
|
+
*.log
|
|
46
|
+
eva.log
|
|
47
|
+
|
|
48
|
+
# IDE & OS files
|
|
49
|
+
.vscode/
|
|
50
|
+
.idea/
|
|
51
|
+
*.swp
|
|
52
|
+
*.swo
|
|
53
|
+
.DS_Store
|
|
54
|
+
|
|
55
|
+
# Temporary / agent directories
|
|
56
|
+
.agents/
|
|
57
|
+
.codex/
|
|
58
|
+
assets/demo.mp4
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Eva 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
|
+
## [3.0.0] - 2026-08-05
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Security Hardening Framework (`src/eva/security/`):**
|
|
12
|
+
- Centralized secret and API-key redaction (`src/eva/security/redaction.py`) combining regex pattern matching for API keys, tokens, and private key blocks with Shannon entropy threshold checks ($H(S) > 3.5$). Redaction is executed **before** any provider network request and before writing to local disk.
|
|
13
|
+
- Cryptographic hash-chained audit log (`src/eva/security/audit.py`) with sequential SHA-256 signatures for tamper detection (`verify_audit_chain()`).
|
|
14
|
+
- Sandboxed execution (`src/eva/security/sandbox.py`) providing a restricted subprocess environment with environment variable stripping, stdin isolation, and execution timeouts. Opt-in via `sandbox_risky_commands = true` in config.
|
|
15
|
+
- **Terminal Replay Subsystem (`eva replay`):**
|
|
16
|
+
- Session execution recorder and player (`src/eva/replay/`). Captures command, output, exit code, duration, and working directory with automatic secret redaction at write time.
|
|
17
|
+
- New commands: `eva replay <session>` and `eva replay --list`.
|
|
18
|
+
- **Opt-In Telemetry (`src/eva/telemetry/`):**
|
|
19
|
+
- Local-only telemetry collector (`src/eva/telemetry/metrics.py`) tracking provider response latency, error rates, and success status only. Zero prompt text or file content collected. Disabled by default; opt-in via `telemetry_enabled = true`. Optional self-hosted HTTP POST export endpoint supported.
|
|
20
|
+
- **Documentation:**
|
|
21
|
+
- Created `SECURITY.md` detailing security mechanisms, redaction patterns, audit chain format, sandbox controls, and vulnerability reporting.
|
|
22
|
+
|
|
23
|
+
## [2.3.0] - 2026-08-05
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Declarative Workflow Engine (`eva workflow`):** YAML workflow definitions with approval gates reusing Phase 1 work safety policy (`eva workflow run`, `eva workflow list`, `eva workflow show`). Shipped 3 built-in workflows: `repo_health`, `dependency_audit`, and `security_scan`.
|
|
28
|
+
- **Offline Model Support (`ollama` & `llamacpp`):** Added Ollama and llama.cpp GGUF backends with automatic local fallback when cloud providers are unreachable or quota-exhausted.
|
|
29
|
+
- **Project Understanding (`src/eva/indexing/repo_index.py`):** Automated project stack detection (languages, frameworks, package managers, test frameworks, CI configs) and module-level dependency graph feeding `eva explain` at repo roots.
|
|
30
|
+
- **Session Workspaces (`eva workspace`):** Named session contexts (`eva workspace create`, `switch`, `list`, `note`, `bookmark`, `show`) with secret redaction before writing to disk and strict isolation between workspace names.
|
|
31
|
+
|
|
32
|
+
## [2.2.0] - 2026-08-05
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- **CRITICAL:** `eva changes` and `eva commit-message` no longer crash when git output contains bracket characters (Rich MarkupError).
|
|
36
|
+
- **BROKEN:** `eva tree <path>`, `eva grep <pattern> <path>`, and `eva find <pattern> <path>` now correctly accept path arguments.
|
|
37
|
+
- `eva doctor` now shows ⚠ for providers with missing API keys instead of a misleading ✔.
|
|
38
|
+
- `eva config status` no longer shows doubled emoji prefixes.
|
|
39
|
+
- Cache keys now include the model name, preventing stale responses when switching models within a provider.
|
|
40
|
+
- Option injection vulnerability in `eva grep` fixed by adding `--` separator before user arguments.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
- Streaming responses now show real-time progress (`Receiving... (N chars)`) instead of a static spinner.
|
|
44
|
+
- Provider code refactored: OpenRouter, Groq, and OpenCode Zen now share an `OpenAICompatibleProvider` base class, eliminating ~90% code duplication.
|
|
45
|
+
- `cli.py` split into focused modules: `git_ops.py` for git operations and `chat_session.py` for the interactive REPL.
|
|
46
|
+
- Work safety blocklist hardened against absolute path bypasses, `env`/`command` prefix attacks, `xargs rm`, and interpreter code execution.
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
- Multi-file context support: `eva ask --file a.py --file b.py` now accepts multiple `--file` flags.
|
|
50
|
+
- `--no-cache` flag for `eva ask` to bypass the response cache.
|
|
51
|
+
- `CONTRIBUTING.md` with development setup, architecture overview, and suggested contributions including local model integration.
|
|
52
|
+
- Explicit `__init__.py` for the `context` package.
|
|
53
|
+
|
|
54
|
+
### Removed
|
|
55
|
+
- Stale `test_gemini.py` scratchpad file that was breaking pytest collection.
|
|
56
|
+
|
|
57
|
+
## [2.1.0] - 2025-07-01
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- Provider abstraction with fallback routing across OpenRouter, Groq, Gemini, and OpenCode Zen.
|
|
61
|
+
- Streaming responses with disk-backed caching.
|
|
62
|
+
- Local RPM/RPD budget tracking.
|
|
63
|
+
- `.gitignore`-aware context collection.
|
|
64
|
+
- Safe file-context reads with binary-file and large-file handling.
|
|
65
|
+
- Hardened command generation via `eva work`.
|
|
66
|
+
- Git-aware workflows (`eva changes`, `eva commit-message`).
|
|
67
|
+
- Reviewable patch generation with `eva edit`.
|
|
68
|
+
- Health checks through `eva doctor`.
|
|
69
|
+
- Persistent chat sessions with `eva chat --session`.
|
|
70
|
+
|
|
71
|
+
## [2.0.0] - 2025-06-01
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
- Complete rewrite with provider routing and safety model.
|
|
75
|
+
|
|
76
|
+
## [1.0.0] - 2025-05-01
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- Initial release with basic AI-powered terminal assistant functionality.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Contributing to Eva CLI
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Eva! This document provides guidelines and ideas for contribution.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Clone the repository
|
|
9
|
+
git clone https://github.com/your-org/eva-cli.git
|
|
10
|
+
cd eva-cli
|
|
11
|
+
|
|
12
|
+
# Create and activate a virtual environment
|
|
13
|
+
python -m venv venv
|
|
14
|
+
source venv/bin/activate # Linux/macOS
|
|
15
|
+
# venv\Scripts\activate # Windows
|
|
16
|
+
|
|
17
|
+
# Install in editable mode with dev dependencies
|
|
18
|
+
python -m pip install -e ".[dev]"
|
|
19
|
+
|
|
20
|
+
# Run tests
|
|
21
|
+
pytest
|
|
22
|
+
|
|
23
|
+
# Run linting
|
|
24
|
+
ruff check .
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Code Style
|
|
28
|
+
|
|
29
|
+
- We use [Ruff](https://docs.astral.sh/ruff/) for linting with a line length of 120 characters.
|
|
30
|
+
- Target Python 3.10+.
|
|
31
|
+
- Type hints are encouraged for all public functions.
|
|
32
|
+
- Use docstrings for public modules, classes, and functions.
|
|
33
|
+
|
|
34
|
+
## Project Structure
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
src/eva/
|
|
38
|
+
├── cli.py # Typer command definitions
|
|
39
|
+
├── chat_session.py # Chat REPL session logic
|
|
40
|
+
├── git_ops.py # Git diff/apply/commit operations
|
|
41
|
+
├── config.py # Configuration and keyring management
|
|
42
|
+
├── budget.py # Local RPM/RPD budget tracking
|
|
43
|
+
├── cache.py # Disk-backed response cache
|
|
44
|
+
├── diagnostics.py # Logging setup
|
|
45
|
+
├── work_safety.py # Command safety validation
|
|
46
|
+
├── context/ # File reading, trees, tokenizer
|
|
47
|
+
├── prompts/ # System prompt definitions
|
|
48
|
+
├── router/ # Provider dispatch and fallback
|
|
49
|
+
│ ├── __init__.py # Registry, dispatch, error types
|
|
50
|
+
│ ├── openai_compat.py # Base class for OpenAI-compatible providers
|
|
51
|
+
│ ├── openrouter_provider.py
|
|
52
|
+
│ ├── groq_provider.py
|
|
53
|
+
│ ├── gemini_provider.py
|
|
54
|
+
│ └── opencode_zen_provider.py
|
|
55
|
+
└── ui/ # Terminal output, streaming, formatting
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Making Changes
|
|
59
|
+
|
|
60
|
+
1. Fork the repository and create a feature branch.
|
|
61
|
+
2. Make your changes with clear, descriptive commit messages.
|
|
62
|
+
3. Add tests for new functionality where applicable.
|
|
63
|
+
4. Run `ruff check .` and `pytest` before submitting.
|
|
64
|
+
5. Open a pull request with a clear description of what changed and why.
|
|
65
|
+
|
|
66
|
+
## Areas for Contribution
|
|
67
|
+
|
|
68
|
+
### 🟢 Good First Issues
|
|
69
|
+
|
|
70
|
+
- Add shell completion documentation and setup instructions.
|
|
71
|
+
- Improve error messages for common misconfiguration scenarios.
|
|
72
|
+
- Add more file type detection in `context/io.py`.
|
|
73
|
+
|
|
74
|
+
### 🟡 Medium Difficulty
|
|
75
|
+
|
|
76
|
+
- **Local Model Support (Ollama / llama.cpp / vLLM):** Add a new provider that connects to a local LLM server. This would allow fully offline usage. The provider should implement the `Provider` protocol from `eva/router/__init__.py` and register itself. Ollama exposes an OpenAI-compatible API, so subclassing `OpenAICompatibleProvider` from `eva/router/openai_compat.py` would be the easiest approach.
|
|
77
|
+
- **`eva review` Command:** Implement a multi-file code review command that collects context from multiple files and generates a structured review.
|
|
78
|
+
- **`eva test` Command:** Generate unit tests for specified files using the LLM.
|
|
79
|
+
- **Cost Estimation:** Show estimated cost before sending paid-tier requests.
|
|
80
|
+
- **Conversation Branching:** Allow saving and restoring conversation branches during chat sessions.
|
|
81
|
+
|
|
82
|
+
### 🔴 Advanced
|
|
83
|
+
|
|
84
|
+
- **MCP (Model Context Protocol) Integration:** Connect Eva to external tool servers for database queries, API calls, and documentation lookup.
|
|
85
|
+
- **RAG over Codebase:** Build a codebase embedding and semantic search system for intelligent context selection.
|
|
86
|
+
|
|
87
|
+
- **Plugin/Extension System:** Allow community-contributed providers and custom commands.
|
|
88
|
+
|
|
89
|
+
## Adding a New Provider
|
|
90
|
+
|
|
91
|
+
1. Create a new file in `src/eva/router/` (e.g., `ollama_provider.py`).
|
|
92
|
+
2. If the provider exposes an OpenAI-compatible API, subclass `OpenAICompatibleProvider` from `openai_compat.py`.
|
|
93
|
+
3. If it uses a different SDK, implement the `Provider` protocol directly (see `gemini_provider.py` as an example).
|
|
94
|
+
4. Register the provider at the bottom of your file:
|
|
95
|
+
```python
|
|
96
|
+
from eva.router import register_provider
|
|
97
|
+
|
|
98
|
+
register_provider(YourProvider())
|
|
99
|
+
```
|
|
100
|
+
5. Import your provider module in `cli.py` so it self-registers on startup.
|
|
101
|
+
6. Add a default configuration entry in `config.py`.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
By contributing to Eva CLI, you agree that your contributions will be licensed under the MIT License.
|
eva_cli-3.0.0/Dockerfile
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Multi-stage Dockerfile for Eva CLI
|
|
2
|
+
FROM python:3.11-slim as builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
# Install system build dependencies
|
|
7
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
8
|
+
build-essential \
|
|
9
|
+
curl \
|
|
10
|
+
git \
|
|
11
|
+
ripgrep \
|
|
12
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
13
|
+
|
|
14
|
+
# Install Rust toolchain for fastwalk extension
|
|
15
|
+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
16
|
+
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
17
|
+
|
|
18
|
+
# Copy package metadata
|
|
19
|
+
COPY pyproject.toml README.md ./
|
|
20
|
+
COPY src/ src/
|
|
21
|
+
COPY rust/ rust/
|
|
22
|
+
|
|
23
|
+
# Build wheels and install
|
|
24
|
+
RUN python -m pip install --upgrade pip setuptools wheel maturin
|
|
25
|
+
RUN cd rust/eva_fastwalk && maturin build --release -o /app/dist
|
|
26
|
+
RUN python -m pip install /app/dist/*.whl
|
|
27
|
+
RUN python -m pip install .
|
|
28
|
+
|
|
29
|
+
# Final slim runtime image
|
|
30
|
+
FROM python:3.11-slim as runner
|
|
31
|
+
|
|
32
|
+
# Required so GHCR links this image to the repo (source, license, description
|
|
33
|
+
# show up on the package page) and so the package can inherit repo visibility.
|
|
34
|
+
LABEL org.opencontainers.image.source="https://github.com/rootagi/eva" \
|
|
35
|
+
org.opencontainers.image.description="Eva - command-line AI assistant" \
|
|
36
|
+
org.opencontainers.image.licenses="MIT"
|
|
37
|
+
|
|
38
|
+
WORKDIR /workspace
|
|
39
|
+
|
|
40
|
+
# Install runtime dependencies (ripgrep, git) and a non-root user.
|
|
41
|
+
# Eva runs shell commands and edits files, often against a host directory
|
|
42
|
+
# mounted in via `-v $(pwd):/workspace` — running as root inside the
|
|
43
|
+
# container is unnecessary risk once this image is public.
|
|
44
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
45
|
+
git \
|
|
46
|
+
ripgrep \
|
|
47
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
48
|
+
&& useradd --create-home --uid 1000 --shell /bin/bash eva
|
|
49
|
+
|
|
50
|
+
# Copy installed site-packages and binaries from builder
|
|
51
|
+
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
|
52
|
+
COPY --from=builder /usr/local/bin/eva /usr/local/bin/eva
|
|
53
|
+
|
|
54
|
+
RUN chown -R eva:eva /workspace
|
|
55
|
+
USER eva
|
|
56
|
+
ENV HOME=/home/eva
|
|
57
|
+
|
|
58
|
+
ENTRYPOINT ["eva"]
|
|
59
|
+
CMD ["--help"]
|
|
60
|
+
|
eva_cli-3.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eva contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|