Metadata-Version: 2.4
Name: cion-cli
Version: 0.1.0
Summary: Spec-driven development with full traceability
Author-email: Cristian Ion <cristian.ion94@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/cristian-ion/cion
Project-URL: Repository, https://github.com/cristian-ion/cion
Keywords: ai,requirements,traceability,code-generation,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.25; extra == "anthropic"
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"
Provides-Extra: ollama
Requires-Dist: requests>=2.31; extra == "ollama"
Provides-Extra: all
Requires-Dist: anthropic>=0.25; extra == "all"
Requires-Dist: openai>=1.0; extra == "all"
Requires-Dist: requests>=2.31; extra == "all"
Dynamic: license-file

# cion

Most spec-to-code tools generate code and documentation separately, then try to link them after the fact. cion asks the model to produce the traceability graph **as it generates** — every class and method comes out already tagged with the requirement that justifies it. The links are structural, not scraped. That means impact analysis and coverage are computed from data the model committed to, not from pattern-matching on what it happened to produce.

---

## Install

```bash
pip install "cion-cli[anthropic]"   # Claude
pip install "cion-cli[openai]"      # GPT-4o
pip install "cion-cli[ollama]"      # local models via Ollama
```

---

## See it in 60 seconds

```text
$ cat requirements.txt
The system is a task management API.
Users can create tasks with a title and due date.
Tasks have a status: todo, in_progress, or done.
Users can list tasks filtered by status.
Users can delete a task by ID.

$ cion run requirements.txt
OK  Traceability graph → graph.json
✓   Written: output/task.py
✓   Written: output/task_repository.py
✓   Written: output/task_service.py
✓   Written: output/task_controller.py

Done!  Run cion coverage or cion trace to inspect the graph.
```

```text
$ cion trace
Traceability Graph
├── REQ-001  Users can create tasks with a title and due date
│   ├── CLS-001  Task
│   │   └── task.py
│   └── CLS-003  TaskService
│       └── task_service.py
├── REQ-003  Tasks have a status: todo, in_progress, or done
│   └── CLS-001  Task
│       └── task.py
├── REQ-005  Users can list tasks filtered by status
│   ├── CLS-002  TaskRepository
│   │   └── task_repository.py
│   └── CLS-003  TaskService
│       └── task_service.py
└── REQ-007  Users can delete a task by ID
    ├── CLS-002  TaskRepository
    │   └── task_repository.py
    └── CLS-003  TaskService
        └── task_service.py
```

```text
$ cion impact REQ-001
REQ-001  Users can create tasks with a title and due date
├── Classes (2)
│   ├── Task
│   └── TaskService
├── Methods (3)
│   ├── Task.__init__
│   ├── TaskService.create_task
│   └── TaskController.create_task_endpoint
└── Files (2)
    ├── task.py
    └── task_service.py
```

---

## Commands

| Command | What it does |
| ------- | ------------ |
| `cion run REQUIREMENTS_FILE` | Full pipeline: parse → class diagram → code |
| `cion trace` | Requirement → class → file tree |
| `cion coverage` | Table showing which classes and files cover each requirement |
| `cion impact REQ-ID` | Everything that changes if this requirement is modified |

`cion run` options: `--provider` / `-p` (`anthropic` · `openai` · `ollama`), `--model` / `-m`, `--output-dir` / `-o`, `--graph` / `-g`.

---

## How it works

Three chained LLM calls with structured JSON output:

1. **Parse** — plain text → `requirements[]` with sequential IDs and priorities
2. **Classes** — requirements → class diagram; every class and method carries `traces_to: [REQ-...]`
3. **Code** — class diagram → Python files; each file carries `traces_to` (class IDs) and `req_traces` (requirement IDs)

The traceability graph (`graph.json`) is built during generation. `cion trace`, `cion coverage`, and `cion impact` query it directly — no heuristics, no re-parsing the generated source.
