cliv-ai 1.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.
- cliv_ai-1.0.0/.gitignore +121 -0
- cliv_ai-1.0.0/LICENSE +21 -0
- cliv_ai-1.0.0/PKG-INFO +416 -0
- cliv_ai-1.0.0/README.MD +352 -0
- cliv_ai-1.0.0/cliv/__init__.py +13 -0
- cliv_ai-1.0.0/cliv/agent.py +1277 -0
- cliv_ai-1.0.0/cliv/cli.py +1944 -0
- cliv_ai-1.0.0/cliv/config.py +139 -0
- cliv_ai-1.0.0/cliv/diff_view.py +285 -0
- cliv_ai-1.0.0/cliv/diffs.py +76 -0
- cliv_ai-1.0.0/cliv/git.py +163 -0
- cliv_ai-1.0.0/cliv/guardian.py +522 -0
- cliv_ai-1.0.0/cliv/healing/__init__.py +5 -0
- cliv_ai-1.0.0/cliv/healing/engine.py +394 -0
- cliv_ai-1.0.0/cliv/healing/repair_plan.py +133 -0
- cliv_ai-1.0.0/cliv/healing/test_report.py +183 -0
- cliv_ai-1.0.0/cliv/history.py +203 -0
- cliv_ai-1.0.0/cliv/intelligence/__init__.py +46 -0
- cliv_ai-1.0.0/cliv/intelligence/code_parser.py +364 -0
- cliv_ai-1.0.0/cliv/intelligence/dependency_graph.py +324 -0
- cliv_ai-1.0.0/cliv/intelligence/embeddings.py +230 -0
- cliv_ai-1.0.0/cliv/intelligence/graph_explorer.py +492 -0
- cliv_ai-1.0.0/cliv/intelligence/project_scanner.py +337 -0
- cliv_ai-1.0.0/cliv/intelligence/rag_indexer.py +217 -0
- cliv_ai-1.0.0/cliv/intelligence/report.py +728 -0
- cliv_ai-1.0.0/cliv/intelligence/vector_store.py +185 -0
- cliv_ai-1.0.0/cliv/intent.py +193 -0
- cliv_ai-1.0.0/cliv/llm/__init__.py +31 -0
- cliv_ai-1.0.0/cliv/llm/base.py +86 -0
- cliv_ai-1.0.0/cliv/llm/discovery.py +213 -0
- cliv_ai-1.0.0/cliv/llm/groq_backend.py +162 -0
- cliv_ai-1.0.0/cliv/llm/ollama_backend.py +155 -0
- cliv_ai-1.0.0/cliv/llm/router.py +173 -0
- cliv_ai-1.0.0/cliv/memory.py +270 -0
- cliv_ai-1.0.0/cliv/models.py +50 -0
- cliv_ai-1.0.0/cliv/offline.py +272 -0
- cliv_ai-1.0.0/cliv/onboarding.py +387 -0
- cliv_ai-1.0.0/cliv/output.py +45 -0
- cliv_ai-1.0.0/cliv/review.py +536 -0
- cliv_ai-1.0.0/cliv/risk.py +443 -0
- cliv_ai-1.0.0/cliv/sanitizer.py +109 -0
- cliv_ai-1.0.0/cliv/security.py +136 -0
- cliv_ai-1.0.0/cliv/session_io.py +277 -0
- cliv_ai-1.0.0/cliv/slash.py +1421 -0
- cliv_ai-1.0.0/cliv/snapshots.py +518 -0
- cliv_ai-1.0.0/cliv/text.py +22 -0
- cliv_ai-1.0.0/cliv/timeline/__init__.py +9 -0
- cliv_ai-1.0.0/cliv/timeline/store.py +379 -0
- cliv_ai-1.0.0/cliv/tools/__init__.py +0 -0
- cliv_ai-1.0.0/cliv/tools/base.py +59 -0
- cliv_ai-1.0.0/cliv/tools/edit_file.py +121 -0
- cliv_ai-1.0.0/cliv/tools/git_diff.py +43 -0
- cliv_ai-1.0.0/cliv/tools/list_files.py +54 -0
- cliv_ai-1.0.0/cliv/tools/loader.py +242 -0
- cliv_ai-1.0.0/cliv/tools/memory.py +157 -0
- cliv_ai-1.0.0/cliv/tools/multi_edit.py +166 -0
- cliv_ai-1.0.0/cliv/tools/onboard.py +59 -0
- cliv_ai-1.0.0/cliv/tools/project_dna.py +49 -0
- cliv_ai-1.0.0/cliv/tools/rag.py +187 -0
- cliv_ai-1.0.0/cliv/tools/read_file.py +39 -0
- cliv_ai-1.0.0/cliv/tools/read_timeline.py +34 -0
- cliv_ai-1.0.0/cliv/tools/remove_file.py +69 -0
- cliv_ai-1.0.0/cliv/tools/review.py +67 -0
- cliv_ai-1.0.0/cliv/tools/run_command.py +169 -0
- cliv_ai-1.0.0/cliv/tools/run_test.py +81 -0
- cliv_ai-1.0.0/cliv/tools/search_codebase.py +247 -0
- cliv_ai-1.0.0/cliv/tools/workspace_tools.py +337 -0
- cliv_ai-1.0.0/cliv/tui.py +258 -0
- cliv_ai-1.0.0/cliv/ui.py +156 -0
- cliv_ai-1.0.0/cliv/workspace.py +270 -0
- cliv_ai-1.0.0/pyproject.toml +69 -0
cliv_ai-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
|
|
5
|
+
# C extensions
|
|
6
|
+
*.so
|
|
7
|
+
|
|
8
|
+
# Distribution / packaging
|
|
9
|
+
.Python
|
|
10
|
+
env/
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
*.egg-info/
|
|
23
|
+
.installed.cfg
|
|
24
|
+
*.egg
|
|
25
|
+
|
|
26
|
+
# PyInstaller
|
|
27
|
+
# Usually these files are written by a python script from a template
|
|
28
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
29
|
+
*.manifest
|
|
30
|
+
*.spec
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
|
|
36
|
+
# Unit test / coverage reports
|
|
37
|
+
htmlcov/
|
|
38
|
+
.tox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
|
|
46
|
+
# Translations
|
|
47
|
+
*.mo
|
|
48
|
+
*.pot
|
|
49
|
+
|
|
50
|
+
# Django stuff:
|
|
51
|
+
*.log
|
|
52
|
+
|
|
53
|
+
# Sphinx documentation
|
|
54
|
+
docs/_build/
|
|
55
|
+
|
|
56
|
+
# PyBuilder
|
|
57
|
+
target/
|
|
58
|
+
|
|
59
|
+
# DotEnv configuration
|
|
60
|
+
.env
|
|
61
|
+
|
|
62
|
+
# Database
|
|
63
|
+
*.db
|
|
64
|
+
*.rdb
|
|
65
|
+
|
|
66
|
+
# Pycharm
|
|
67
|
+
.idea
|
|
68
|
+
|
|
69
|
+
# VS Code
|
|
70
|
+
.vscode/
|
|
71
|
+
*.code-workspace
|
|
72
|
+
|
|
73
|
+
# Spyder
|
|
74
|
+
.spyproject/
|
|
75
|
+
|
|
76
|
+
# Jupyter NB Checkpoints
|
|
77
|
+
.ipynb_checkpoints/
|
|
78
|
+
|
|
79
|
+
# Mac OS-specific storage files
|
|
80
|
+
.DS_Store
|
|
81
|
+
|
|
82
|
+
# vim
|
|
83
|
+
*.swp
|
|
84
|
+
*.swo
|
|
85
|
+
|
|
86
|
+
# Mypy cache
|
|
87
|
+
.mypy_cache/
|
|
88
|
+
|
|
89
|
+
# Exclude virtual environment
|
|
90
|
+
.venv/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Exclude LanceDB database
|
|
97
|
+
lancedb/
|
|
98
|
+
|
|
99
|
+
# Exclude temporary files
|
|
100
|
+
temp/
|
|
101
|
+
|
|
102
|
+
# Exclude Qdrant data
|
|
103
|
+
qdrant_data/
|
|
104
|
+
|
|
105
|
+
# Exclude video files
|
|
106
|
+
*.mp4
|
|
107
|
+
|
|
108
|
+
.cursor/
|
|
109
|
+
|
|
110
|
+
# Claude Code
|
|
111
|
+
.claude/
|
|
112
|
+
CLAUDE.md
|
|
113
|
+
|
|
114
|
+
*/docs
|
|
115
|
+
|
|
116
|
+
# cliv local runtime cache
|
|
117
|
+
.cliv/rag/
|
|
118
|
+
.cliv/*.tmp
|
|
119
|
+
output.dot
|
|
120
|
+
output.md
|
|
121
|
+
test.md
|
cliv_ai-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Meghanath M M
|
|
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.
|
cliv_ai-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cliv-ai
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Terminal-native AI coding agent with time-travel undo, security guardian, and project onboarding
|
|
5
|
+
Project-URL: Homepage, https://github.com/Meghanath-M-M/cliv-ai-agent
|
|
6
|
+
Project-URL: Repository, https://github.com/Meghanath-M-M/cliv-ai-agent
|
|
7
|
+
Project-URL: Issues, https://github.com/Meghanath-M-M/cliv-ai-agent/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/Meghanath-M-M/cliv-ai-agent#readme
|
|
9
|
+
Author: Meghanath M M
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026 Meghanath M M
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Keywords: agent,ai,automation,cli,code-analysis,code-review,coding,developer-tools,groq,llm,mcp,ollama,rag,security,terminal
|
|
33
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
34
|
+
Classifier: Environment :: Console
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: Intended Audience :: Information Technology
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
44
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
45
|
+
Classifier: Topic :: Terminals
|
|
46
|
+
Classifier: Topic :: Utilities
|
|
47
|
+
Requires-Python: >=3.11
|
|
48
|
+
Requires-Dist: pygments>=2.17.0
|
|
49
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
50
|
+
Requires-Dist: rich>=13.0.0
|
|
51
|
+
Provides-Extra: all
|
|
52
|
+
Requires-Dist: groq>=0.4.0; extra == 'all'
|
|
53
|
+
Requires-Dist: numpy>=1.26; extra == 'all'
|
|
54
|
+
Requires-Dist: ollama>=0.1.0; extra == 'all'
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
57
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
58
|
+
Provides-Extra: offline
|
|
59
|
+
Requires-Dist: numpy>=1.26; extra == 'offline'
|
|
60
|
+
Requires-Dist: ollama>=0.1.0; extra == 'offline'
|
|
61
|
+
Provides-Extra: online
|
|
62
|
+
Requires-Dist: groq>=0.4.0; extra == 'online'
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
64
|
+
|
|
65
|
+
<div align="center">
|
|
66
|
+
|
|
67
|
+
<pre>
|
|
68
|
+
ββββββββββ ββββββ βββ
|
|
69
|
+
βββββββββββ ββββββ βββ
|
|
70
|
+
βββ βββ ββββββ βββ
|
|
71
|
+
βββ βββ βββββββ ββββ
|
|
72
|
+
βββββββββββββββββββ βββββββ
|
|
73
|
+
ββββββββββββββββββ βββββ
|
|
74
|
+
</pre>
|
|
75
|
+
|
|
76
|
+
# CLIV
|
|
77
|
+
|
|
78
|
+
**Terminal-native intelligence for your local codebase.**
|
|
79
|
+
|
|
80
|
+
A high-performance, privacy-first terminal AI coding assistant that reads, edits, reviews, tests, and debugs code across single and multi-repo projects. Built for speed, safety, and auditability, it leverages **Groq LPU cloud inference** for sub-second tool calling and **Ollama** for private local execution, featuring automatic network failover, time-travel safety snapshots, long-term memory, and GitHub Actions CI integration.
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
[](https://www.python.org/)
|
|
84
|
+
[](https://opensource.org/licenses/MIT)
|
|
85
|
+
[](https://github.com/Meghanath-M-M/cliv-ai-agent)
|
|
86
|
+
[](https://console.groq.com/)
|
|
87
|
+
[](https://ollama.com/)
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## β¨ Key Features
|
|
94
|
+
|
|
95
|
+
- π **Hybrid Online/Offline Execution** β Use high-speed cloud models via Groq (e.g. `openai/gpt-oss-120b`, `qwen/qwen3.8-27b`) or private local execution with Ollama (e.g. `llama3.1:8b`). Cliv checks connectivity at startup and between turns, gracefully degrading mid-session to Ollama if network drops.
|
|
96
|
+
|
|
97
|
+
- π― **Interactive Model Switcher (`/model`)** β Easily switch models inside the interactive REPL with keyboard navigation (`β`/`β` or `j`/`k`). A live preview card shows hardware specs, parameter size, provider, and direct tool-calling readiness in real time. Press `Enter` to switch, or `q`/`Esc` to cancel.
|
|
98
|
+
|
|
99
|
+
- β‘ **Live Thinking & Tool Activity Indicators** β Real-time animated status spinners distinguish LLM reasoning (`Thinking (<model>)...`), tool execution (`Running <tools>...`), offline processing, and self-healing. Completion pills (`β‘ Tool <name> completed`) provide clear feedback on agent operations.
|
|
100
|
+
|
|
101
|
+
- π **Automated Project Onboarding (`cliv onboard`)** β Generate comprehensive architectural orientation guides from codebase DNA, git history, detected environments (Python, Node, Rust, Go), test runners, and team conventions. View in terminal, export to `ONBOARDING.md` (`cliv onboard --save`), or dump structured JSON.
|
|
102
|
+
|
|
103
|
+
- π‘οΈ **CI/CD Code Review & Secret Detection (`cliv review`)** β Automated static code review for pull requests and local working trees. Detects hardcoded API keys/credentials, blocks unsafe calls (`eval`, `exec`), validates syntax via AST, runs test suites, formats GitHub Actions PR comments (`--format github`), and auto-generates workflow files (`cliv review --init-ci`).
|
|
104
|
+
|
|
105
|
+
- ποΈ **Multi-Repo Workspace Support (`cliv workspace`)** β Link, manage, and search across multiple project repositories simultaneously with strict path-boundary security enforcement.
|
|
106
|
+
|
|
107
|
+
- π§ **Agent Long-Term Memory & Conventions (`cliv memory`)** β Persistent project conventions and user preferences stored in local SQLite and synchronized with `CLIV.md`. Use natural language tools (`remember` and `recall`) or `/memory` to manage team guidelines.
|
|
108
|
+
|
|
109
|
+
- β‘ **Parallel Tool Execution** β Independent read-only tools (e.g. scanning multiple directories, reading files, searching RAG embeddings) are automatically batched and executed concurrently via thread pooling.
|
|
110
|
+
|
|
111
|
+
- π§© **3-Tier Tool Plugin System (`cliv tools`)** β Extend the agent with custom Python tools without modifying the core codebase. Automatically discovers tools from built-in directories, user global plugins (`~/.config/cliv/plugins/`), and project-local plugins (`<project>/.cliv/plugins/`). Scaffold new tools instantly with `cliv tools scaffold <name>`.
|
|
112
|
+
|
|
113
|
+
- βͺ **Safety Snapshots & Time-Travel Undo (`cliv undo`)** β Automatic pre-write file snapshots captured before any file modification or deletion. Inspect diffs and restore previous project states instantly with conflict detection.
|
|
114
|
+
|
|
115
|
+
- 𧬠**Project DNA & Visual Dependency Explorer (`cliv dna`, `cliv graph`)** β In-depth architectural analysis extracting classes, functions, circular dependencies, and component topologies with interactive TUI navigation and Mermaid/Graphviz export.
|
|
116
|
+
|
|
117
|
+
- π©Ί **Self-Healing Test Loop** β Run `cliv "Fix all failing tests"`. Cliv runs pytest, parses failures, formulates targeted repair plans, applies changes through the approval gate, and reruns tests iteratively until the suite passes.
|
|
118
|
+
|
|
119
|
+
- π **Development Intelligence Timeline (`cliv timeline`)** β An append-only, secret-redacted SQLite audit log recording every request, tool call, snapshot, test run, and undo operation scoped per repository.
|
|
120
|
+
|
|
121
|
+
- π **Structured Output Modes (`--json`, `-q`/`--quiet`, `/json`)** β First-class scripting and CI pipeline support. Every major subcommand and single-shot run supports `--json` output, minimal `--quiet` text mode, and interactive REPL `/json` toggling.
|
|
122
|
+
|
|
123
|
+
- πΈ **Real-Time Cost & Token Telemetry (`cliv cost`)** β Live token counts and estimated USD cost tracking per conversation turn and aggregated across projects and models.
|
|
124
|
+
|
|
125
|
+
- πΎ **Session Management & Export/Import (`cliv session`, `/export`, `/import`)** β Export active chat sessions to Markdown or JSON, and restore past contexts seamlessly.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## π Quick Start
|
|
130
|
+
|
|
131
|
+
### 1. Installation
|
|
132
|
+
|
|
133
|
+
Install via PyPI:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pip install cliv-ai
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Or install from source:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
git clone https://github.com/Meghanath-M-M/cliv-ai-agent.git
|
|
143
|
+
cd cliv-ai-agent
|
|
144
|
+
|
|
145
|
+
# Install using uv (recommended for speed)
|
|
146
|
+
uv sync --extra all
|
|
147
|
+
|
|
148
|
+
# Or install with pip
|
|
149
|
+
pip install -e ".[all]"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Verify installation:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
cliv --version
|
|
156
|
+
# Output: cliv 1.0.0
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
*Install extras: `[online]` (Groq), `[offline]` (Ollama + NumPy), `[all]` (both), or `[dev]` (testing suite).*
|
|
160
|
+
|
|
161
|
+
### 2. Configure Models
|
|
162
|
+
|
|
163
|
+
* **Online Mode (Groq LPU):** Get a free API key at [console.groq.com](https://console.groq.com/keys) and configure:
|
|
164
|
+
```bash
|
|
165
|
+
cliv config api-key YOUR_GROQ_API_KEY
|
|
166
|
+
```
|
|
167
|
+
* **Offline Mode (Local Ollama):** Install [Ollama](https://ollama.com/) and pull recommended models:
|
|
168
|
+
```bash
|
|
169
|
+
ollama pull llama3.1:8b
|
|
170
|
+
ollama pull nomic-embed-text
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 3. Launch
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Launch interactive REPL
|
|
177
|
+
cliv
|
|
178
|
+
|
|
179
|
+
# Or run a one-off single-shot command
|
|
180
|
+
cliv "Analyze project structure and run pytest"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## π» CLI Subcommand Reference
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
cliv [OPTIONS] <COMMAND> [ARGS]...
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
| Command | Description | Example |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| `run` *(default)* | Run interactive REPL or single-shot instruction | `cliv "Fix test failures in auth"` |
|
|
194
|
+
| `onboard` | Generate architectural orientation guide & setup checklist | `cliv onboard --save` |
|
|
195
|
+
| `review` *(check)* | Automated code review, security scanner, and PR formatter | `cliv review --format github` |
|
|
196
|
+
| `dna` | Generate Project DNA architecture & component report | `cliv dna --json` |
|
|
197
|
+
| `graph` | Visual interactive codebase explorer (TUI / Mermaid export) | `cliv graph --mermaid arch.md` |
|
|
198
|
+
| `workspace` *(ws)* | Multi-repo workspace management (list, add, remove, info) | `cliv workspace add ../backend-api` |
|
|
199
|
+
| `memory` | Manage long-term agent guidelines and conventions | `cliv memory list --json` |
|
|
200
|
+
| `tools` *(plugins)* | List, inspect, or scaffold custom tool plugins | `cliv tools scaffold lint_checker` |
|
|
201
|
+
| `models` | Show Ollama and Groq model discovery and health dashboard | `cliv models` |
|
|
202
|
+
| `cost` | View session and cumulative project token spend | `cliv cost --json` |
|
|
203
|
+
| `rag` | Semantic codebase search and embedding index management | `cliv rag query "authentication flow"` |
|
|
204
|
+
| `snapshots` | List safety snapshots captured before file writes | `cliv snapshots list` |
|
|
205
|
+
| `undo` | Restore project files from the latest or specified snapshot | `cliv undo` |
|
|
206
|
+
| `timeline` | View append-only SQLite development event log | `cliv timeline -n 20` |
|
|
207
|
+
| `session` | Manage and export/import conversation sessions | `cliv session export session.md` |
|
|
208
|
+
| `git` | Safe Git operations (branch, status, commit) | `cliv git status` |
|
|
209
|
+
| `config` | View or configure API keys, models, and permissions | `cliv config set groq_model qwen/qwen3.8-27b` |
|
|
210
|
+
|
|
211
|
+
### Key Flags & Automation Modes
|
|
212
|
+
|
|
213
|
+
* `--version`, `-V` β Show installed cliv version (`cliv --version`).
|
|
214
|
+
* `--json` β Machine-readable JSON output on single-shot turns and all subcommands:
|
|
215
|
+
```bash
|
|
216
|
+
cliv --json "list files in cliv/tools"
|
|
217
|
+
cliv cost --json
|
|
218
|
+
cliv onboard --json
|
|
219
|
+
```
|
|
220
|
+
* `-q`, `--quiet` β Minimal output mode (suppresses banners, ASCII logos, spinners, and dashboards).
|
|
221
|
+
* `-y`, `--yes` β Auto-approve tool calls (use with caution in automated CI pipelines).
|
|
222
|
+
* `--dry-run` β Preview tool executions and visual diffs without applying any changes.
|
|
223
|
+
* `--offline` β Force offline execution with local Ollama models.
|
|
224
|
+
* `--permissions` β Restrict capabilities: `--permissions read,write` or `--permissions read`.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## β¨οΈ Interactive Slash-Command Reference
|
|
229
|
+
|
|
230
|
+
Inside the interactive REPL (`cliv`), manage active sessions without consuming LLM tokens:
|
|
231
|
+
|
|
232
|
+
| Slash Command | Description | Example |
|
|
233
|
+
|---|---|---|
|
|
234
|
+
| `/help` | Display table of available slash commands | `/help` |
|
|
235
|
+
| `/model` | **Interactive TUI selector** with `β`/`β`/`jk` navigation & specs | `/model` or `/model llama3.1:8b` |
|
|
236
|
+
| `/onboard` | Generate orientation report (view or export to file) | `/onboard` or `/onboard save` |
|
|
237
|
+
| `/review` | Run automated code review on uncommitted changes or base ref | `/review` or `/review main` |
|
|
238
|
+
| `/json` | Toggle structured JSON output mode in REPL | `/json on` or `/json off` |
|
|
239
|
+
| `/dna` | Display Project DNA architecture report | `/dna` |
|
|
240
|
+
| `/graph` | Launch interactive codebase dependency graph explorer | `/graph` |
|
|
241
|
+
| `/workspace` *(ws)* | Manage multi-repo workspaces (list, add, remove, info) | `/workspace add ../core` |
|
|
242
|
+
| `/memory` | Add or inspect persistent preferences and conventions | `/memory add "Use pytest fixtures"` |
|
|
243
|
+
| `/tools` *(plugins)* | Inspect, scaffold, or reload custom tool plugins | `/tools info edit_file` |
|
|
244
|
+
| `/cost` | View live token usage and spend for current project | `/cost` |
|
|
245
|
+
| `/diff` | Show Git working tree status and color-coded diff | `/diff` |
|
|
246
|
+
| `/undo` | Roll back to last snapshot or specific snapshot ID | `/undo` or `/undo 20261111T...` |
|
|
247
|
+
| `/snapshots` | List recent pre-write safety snapshots | `/snapshots 10` |
|
|
248
|
+
| `/timeline` | Show recent development timeline events | `/timeline 15` |
|
|
249
|
+
| `/rag` | Semantic code search or index rebuild | `/rag query "JWT auth"` |
|
|
250
|
+
| `/export` | Export active conversation turn history to Markdown/JSON | `/export session.md` |
|
|
251
|
+
| `/import` | Import past session context into active conversation | `/import session.json` |
|
|
252
|
+
| `/sessions` | List archived conversation sessions | `/sessions 10` |
|
|
253
|
+
| `/branch` | Show or create a Git branch | `/branch feat/new-login` |
|
|
254
|
+
| `/commit` | Commit files modified by cliv this session | `/commit "Update auth middleware"` |
|
|
255
|
+
| `/permissions` | Inspect or update tool permissions (`read`, `write`, `execute`) | `/permissions read,write` |
|
|
256
|
+
| `/clear` | Clear active conversation turn history | `/clear` |
|
|
257
|
+
| `/exit` *(quit)* | Exit session | `/exit` |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## π οΈ Built-in Tool Reference
|
|
262
|
+
|
|
263
|
+
All 22 built-in tools are strictly confined to the project root, governed by Security Guardian policies, and snapshot-backed before mutations:
|
|
264
|
+
|
|
265
|
+
| Tool Name | Description | Permissions | Approval |
|
|
266
|
+
|---|---|---|---|
|
|
267
|
+
| `read_file` | Read a file inside the project root (sensitive paths blocked) | `read` | No |
|
|
268
|
+
| `list_files` | List directory contents and subdirectories | `read` | No |
|
|
269
|
+
| `search_codebase` | Semantic code search via local embeddings and cosine similarity | `read` | No |
|
|
270
|
+
| `rag_query` | Query vectorized codebase embeddings for relevant symbol chunks | `read` | No |
|
|
271
|
+
| `rag_index` | Build or update semantic vector search index | `read`, `write` | No |
|
|
272
|
+
| `rag_stats` | Inspect chunk count, unique files, and vector index health | `read` | No |
|
|
273
|
+
| `analyse_project` | Project DNA scan, AST symbol extractor, and dependency graph | `read` | No |
|
|
274
|
+
| `project_onboard` | Generate comprehensive onboarding report and setup guide | `read` | No |
|
|
275
|
+
| `code_review` | Automated code review, security scanner, and syntax check | `read` | No |
|
|
276
|
+
| `read_timeline` | Query append-only SQLite development audit event history | `read` | No |
|
|
277
|
+
| `remember` | Save a project convention or user preference to persistent memory | `read`, `write` | No |
|
|
278
|
+
| `recall` | Search remembered preferences, conventions, and guidelines | `read` | No |
|
|
279
|
+
| `list_workspaces` | List registered multi-repo workspaces | `read` | No |
|
|
280
|
+
| `read_workspace_file` | Read a file from a linked peer workspace repository | `read` | No |
|
|
281
|
+
| `list_workspace_files` | List files within a linked peer workspace repository | `read` | No |
|
|
282
|
+
| `search_workspace` | Search text or regex within a linked peer workspace | `read` | No |
|
|
283
|
+
| `git_diff` | Inspect Git working-tree status and uncommitted changes | `read` | No |
|
|
284
|
+
| `edit_file` | Write, replace, or create files (diff-previewed & snapshot-backed) | `read`, `write` | **Yes** |
|
|
285
|
+
| `multi_edit` | Apply multi-file atomic edits with combined visual diff | `read`, `write` | **Yes** |
|
|
286
|
+
| `remove_file` | Delete a file (diff-previewed & snapshot-backed) | `read`, `write` | **Yes** |
|
|
287
|
+
| `run_tests` | Execute pytest test suite in isolated project environment | `execute` | **Yes** |
|
|
288
|
+
| `run_command` | Execute allowlisted binary without shell expansion | `execute` *(+net)* | **Yes** |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## π‘οΈ Security & Privacy Architecture
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
User Prompt / Request
|
|
296
|
+
β
|
|
297
|
+
Security Guardian (Permission Policy Check: read / write / execute / network)
|
|
298
|
+
β
|
|
299
|
+
Path Boundary Enforcement (Strict Path.resolve() against project root)
|
|
300
|
+
β
|
|
301
|
+
Sensitive File Blocking (.env, .ssh, private keys, .git write-protection)
|
|
302
|
+
β
|
|
303
|
+
Human-in-the-Loop Gate (Visual Risk Assessment: LOW/MED/HIGH/CRITICAL + Side-by-Side Diff)
|
|
304
|
+
β
|
|
305
|
+
Pre-Write Safety Snapshot (Automatic byte-level rollback capture)
|
|
306
|
+
β
|
|
307
|
+
Execution β Output Sanitizer (Secret Redaction & Prompt Injection Detection)
|
|
308
|
+
β
|
|
309
|
+
Append-Only Timeline Audit Event Log (~/.config/cliv/timeline.db)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
* **No Unvetted Write Operations:** Files are never modified silently. Every write, deletion, command execution, or test run presents a risk assessment and syntax-highlighted diff.
|
|
313
|
+
* **Secret Redaction:** Recognized credentials (API keys, private keys, authorization tokens) are sanitized and replaced with `[REDACTED]` before reaching model context or timeline logs.
|
|
314
|
+
* **Injection Defense:** Output from tools and external sources is scanned for adversarial prompt injection strings.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## π€ CI/CD Integration & GitHub Actions
|
|
319
|
+
|
|
320
|
+
Automate code reviews on every pull request using `cliv review`.
|
|
321
|
+
|
|
322
|
+
### 1. Scaffold Workflow
|
|
323
|
+
Generate a production-ready GitHub Actions workflow in one command:
|
|
324
|
+
```bash
|
|
325
|
+
cliv review --init-ci
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### 2. Workflow Definition (`.github/workflows/cliv-review.yml`)
|
|
329
|
+
```yaml
|
|
330
|
+
name: cliv Automated Code Review & CI
|
|
331
|
+
|
|
332
|
+
on:
|
|
333
|
+
pull_request:
|
|
334
|
+
branches: [main, master, develop]
|
|
335
|
+
push:
|
|
336
|
+
branches: [main, master]
|
|
337
|
+
|
|
338
|
+
permissions:
|
|
339
|
+
contents: read
|
|
340
|
+
pull-requests: write
|
|
341
|
+
|
|
342
|
+
jobs:
|
|
343
|
+
review:
|
|
344
|
+
name: cliv Code Review
|
|
345
|
+
runs-on: ubuntu-latest
|
|
346
|
+
steps:
|
|
347
|
+
- name: Checkout Code
|
|
348
|
+
uses: actions/checkout@v4
|
|
349
|
+
with:
|
|
350
|
+
fetch-depth: 0
|
|
351
|
+
|
|
352
|
+
- name: Set up Python
|
|
353
|
+
uses: actions/setup-python@v5
|
|
354
|
+
with:
|
|
355
|
+
python-version: "3.11"
|
|
356
|
+
cache: "pip"
|
|
357
|
+
|
|
358
|
+
- name: Install cliv & Dependencies
|
|
359
|
+
run: |
|
|
360
|
+
python -m pip install --upgrade pip
|
|
361
|
+
pip install -e .
|
|
362
|
+
|
|
363
|
+
- name: Run cliv Code Review
|
|
364
|
+
run: |
|
|
365
|
+
cliv review --base ${{ github.event.pull_request.base.sha || 'HEAD~1' }} --format github > review_output.md || true
|
|
366
|
+
cat review_output.md >> $GITHUB_STEP_SUMMARY
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## π§ͺ Testing & Verification
|
|
372
|
+
|
|
373
|
+
Cliv is backed by a comprehensive regression test suite covering all security boundaries, tool execution loops, offline fallbacks, and multi-repo registries:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Run the complete test suite
|
|
377
|
+
pytest tests/ -v
|
|
378
|
+
|
|
379
|
+
# Run with test coverage
|
|
380
|
+
pytest --cov=cliv --cov-report=term-missing
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Results:** 436 passing tests.
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## πΊοΈ Roadmap Milestones
|
|
388
|
+
|
|
389
|
+
- [x] **Rank 1:** Expose `rag_query` semantic search tool directly to agent
|
|
390
|
+
- [x] **Rank 2:** Real-time token and USD cost tracking per session and project
|
|
391
|
+
- [x] **Rank 3:** Session export/import (`/export`, `/import`, `cliv session export`)
|
|
392
|
+
- [x] **Rank 4:** Custom tool plugin architecture (builtin, `~/.config/cliv/plugins`, `.cliv/plugins`)
|
|
393
|
+
- [x] **Rank 5:** Parallel execution engine for independent read-only tools
|
|
394
|
+
- [x] **Rank 6:** Long-term memory store (`remember`, `recall`, `/memory`, `CLIV.md` sync)
|
|
395
|
+
- [x] **Rank 7:** Multi-repo workspace management (`/workspace`, workspace tools)
|
|
396
|
+
- [x] **Rank 8:** Model discovery, health diagnostics, and graceful network degradation
|
|
397
|
+
- [x] **Rank 9:** Structured output modes (`--json`, `-q`/`--quiet`, `/json`)
|
|
398
|
+
- [x] **Rank 10:** Automated project onboarding reports (`cliv onboard`, `/onboard`, `ONBOARDING.md`)
|
|
399
|
+
- [x] **Rank 11:** CI/CD integration (`cliv review`, secret scanner, GitHub Actions scaffolder)
|
|
400
|
+
- [x] **UI/UX:** Interactive TUI model switcher (`/model` with arrow keys & `jk`), live thinking spinners, and visual execution badges
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## π€ Contributing
|
|
405
|
+
|
|
406
|
+
Contributions are welcome! Please follow these guidelines:
|
|
407
|
+
1. Fork the repository and create a feature branch (`git checkout -b feat/my-feature`).
|
|
408
|
+
2. Implement clean code with type annotations and docstrings.
|
|
409
|
+
3. Ensure all tests pass (`pytest tests/`).
|
|
410
|
+
4. Submit a pull request with a descriptive summary.
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## π License
|
|
415
|
+
|
|
416
|
+
Distributed under the MIT License. See [LICENSE](LICENSE) for details.
|