agent-lineup 0.1.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.
- agent_lineup-0.1.0/LICENSE +21 -0
- agent_lineup-0.1.0/PKG-INFO +107 -0
- agent_lineup-0.1.0/README.md +95 -0
- agent_lineup-0.1.0/pyproject.toml +27 -0
- agent_lineup-0.1.0/setup.cfg +4 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/PKG-INFO +107 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/SOURCES.txt +53 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/dependency_links.txt +1 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/entry_points.txt +2 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/requires.txt +3 -0
- agent_lineup-0.1.0/src/agent_lineup.egg-info/top_level.txt +1 -0
- agent_lineup-0.1.0/src/lineup/__init__.py +3 -0
- agent_lineup-0.1.0/src/lineup/__main__.py +5 -0
- agent_lineup-0.1.0/src/lineup/banner.py +70 -0
- agent_lineup-0.1.0/src/lineup/changes.py +403 -0
- agent_lineup-0.1.0/src/lineup/cli.py +440 -0
- agent_lineup-0.1.0/src/lineup/functions.py +152 -0
- agent_lineup-0.1.0/src/lineup/git.py +161 -0
- agent_lineup-0.1.0/src/lineup/guard.py +187 -0
- agent_lineup-0.1.0/src/lineup/hookjson.py +58 -0
- agent_lineup-0.1.0/src/lineup/hooks.py +326 -0
- agent_lineup-0.1.0/src/lineup/lineup-banner.txt +8 -0
- agent_lineup-0.1.0/src/lineup/llm.py +158 -0
- agent_lineup-0.1.0/src/lineup/paths.py +57 -0
- agent_lineup-0.1.0/src/lineup/rollback.py +252 -0
- agent_lineup-0.1.0/src/lineup/rules.py +229 -0
- agent_lineup-0.1.0/src/lineup/snapshot.py +170 -0
- agent_lineup-0.1.0/src/lineup/store.py +232 -0
- agent_lineup-0.1.0/src/lineup/summary.py +54 -0
- agent_lineup-0.1.0/src/lineup/table.py +54 -0
- agent_lineup-0.1.0/tests/test_ai_input.py +73 -0
- agent_lineup-0.1.0/tests/test_banner.py +146 -0
- agent_lineup-0.1.0/tests/test_changes.py +151 -0
- agent_lineup-0.1.0/tests/test_cli.py +69 -0
- agent_lineup-0.1.0/tests/test_commits.py +176 -0
- agent_lineup-0.1.0/tests/test_compare_photo.py +165 -0
- agent_lineup-0.1.0/tests/test_diff_ai.py +96 -0
- agent_lineup-0.1.0/tests/test_functions.py +73 -0
- agent_lineup-0.1.0/tests/test_git.py +41 -0
- agent_lineup-0.1.0/tests/test_hooks.py +190 -0
- agent_lineup-0.1.0/tests/test_hooks_init.py +207 -0
- agent_lineup-0.1.0/tests/test_llm.py +143 -0
- agent_lineup-0.1.0/tests/test_output_fixes.py +175 -0
- agent_lineup-0.1.0/tests/test_private_copies.py +56 -0
- agent_lineup-0.1.0/tests/test_redact.py +100 -0
- agent_lineup-0.1.0/tests/test_report.py +80 -0
- agent_lineup-0.1.0/tests/test_rollback.py +313 -0
- agent_lineup-0.1.0/tests/test_rollback_safety.py +254 -0
- agent_lineup-0.1.0/tests/test_rules.py +292 -0
- agent_lineup-0.1.0/tests/test_session_start.py +140 -0
- agent_lineup-0.1.0/tests/test_snapshot.py +112 -0
- agent_lineup-0.1.0/tests/test_store.py +67 -0
- agent_lineup-0.1.0/tests/test_summary.py +110 -0
- agent_lineup-0.1.0/tests/test_symlinks.py +80 -0
- agent_lineup-0.1.0/tests/test_table.py +33 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Harshavardhan
|
|
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.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-lineup
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: See what your coding agent just changed, which edits are risky, and undo a file.
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest; extra == "dev"
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
<p align="center"><img src="assets/lineup-logo.svg" alt="lineup logo" width="324"></p>
|
|
14
|
+
|
|
15
|
+
# lineup
|
|
16
|
+
|
|
17
|
+
`lineup` shows what your coding agent (Claude Code or Codex) just changed, flags the risky edits, and lets you undo a file.
|
|
18
|
+
|
|
19
|
+
## Demo
|
|
20
|
+
|
|
21
|
+
After the agent's reply, the hook prints a short line:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
⚠ ≈ lineup: 2 HIGH
|
|
25
|
+
2 auth.py auth or payment file changed
|
|
26
|
+
3 test_utils.py assertion removed
|
|
27
|
+
Undo: lineup rollback 2
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`lineup risky` shows every changed file and the rule behind its score:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
| ID | File | Risk | Why (rule) | Other |
|
|
34
|
+
| 1 | .env | HIGH | .env or key file changed, contents not read | Can't roll back |
|
|
35
|
+
| 2 | auth.py | HIGH | auth or payment file changed | |
|
|
36
|
+
| 3 | test_utils.py | HIGH | assertion removed | |
|
|
37
|
+
| 4 | utils.py | LOW | code edited, + function added: mul | |
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`lineup rollback 2` (or `lineup rollback auth.py`) puts the file back:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
2 auth.py restored
|
|
44
|
+
Your versions from before this rollback are saved in .git/lineup/backups/2026-11-06_004042/.
|
|
45
|
+
Also changed: .env (ID 1), test_utils.py (ID 3), utils.py (ID 4). Check whether they depend on this file.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
Needs Python 3.10 or newer, git, and [pipx](https://pipx.pypa.io).
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pipx install git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup
|
|
54
|
+
cd your-repo
|
|
55
|
+
lineup init --agent claude
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Use `--agent codex` if you use Codex, or leave `--agent` out for both.
|
|
59
|
+
|
|
60
|
+
`lineup init` shows the hooks it will add and asks before writing. Then start a new Claude Code session. In Codex, run `/hooks` and trust the lineup hooks.
|
|
61
|
+
|
|
62
|
+
- No pipx: `python -m pip install --user pipx`, then `python -m pipx ensurepath`, then open a new terminal.
|
|
63
|
+
- No git: the install fails with "Cannot find command 'git'". Install git first.
|
|
64
|
+
- Upgrade: `pipx upgrade agent-lineup`. If it says it's already up to date, run `pipx install --force git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup`.
|
|
65
|
+
- Uninstall: run `lineup init --remove` in each repo first, then `pipx uninstall agent-lineup`. To delete lineup's saved data too, delete the `.git/lineup` folder in each repo.
|
|
66
|
+
|
|
67
|
+
## Commands
|
|
68
|
+
|
|
69
|
+
| Command | What it does |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `lineup init` | Adds the hooks for Claude Code (`.claude/settings.local.json`) and Codex (`.codex/hooks.json`). `--agent claude` or `--agent codex` picks one. `--remove` takes them out again. |
|
|
72
|
+
| `lineup diff` | What changed since the session started, with a short AI summary. |
|
|
73
|
+
| `lineup risky` | Scores each changed file HIGH, MED or LOW using fixed rules, and shows the rule. |
|
|
74
|
+
| `lineup rollback 3 4` | Undoes files by ID or name. Your current version is backed up first. |
|
|
75
|
+
| `lineup report` | Usage counts to send as tester feedback. No code or file names. |
|
|
76
|
+
|
|
77
|
+
## What gets sent to the AI
|
|
78
|
+
|
|
79
|
+
Only `lineup diff` uses AI. It sends the changed lines to the agent you already have (Claude Code with Haiku, or Codex), with no tools. Nothing goes anywhere else, and lineup needs no API key.
|
|
80
|
+
|
|
81
|
+
- `.env`, key and credential files are never sent. They're listed by name only.
|
|
82
|
+
- Lockfile contents are left out. Secret-looking text is hidden before sending.
|
|
83
|
+
- The hooks, `risky`, `rollback` and `report` use no AI. They run only on your machine.
|
|
84
|
+
- lineup keeps its photo, file copies and backups in `.git/lineup/` in your repo. Private files are kept as fingerprints only, never copied.
|
|
85
|
+
|
|
86
|
+
## Run it in a second terminal
|
|
87
|
+
|
|
88
|
+
You can run lineup with `!` in the same session (for example `! lineup risky`), but the agent may comment on the output. Its commentary isn't part of lineup's check: the scores come from fixed rules, not from the agent.
|
|
89
|
+
|
|
90
|
+
To avoid this, open a second terminal in the same folder and run lineup there.
|
|
91
|
+
|
|
92
|
+
## Known limits
|
|
93
|
+
|
|
94
|
+
- **Claude Code is tested. Codex hooks aren't fully tested yet**, and you must trust them with `/hooks` before they run.
|
|
95
|
+
- The secret scan can miss things. Don't rely on it alone.
|
|
96
|
+
- Tested on Windows. Mac and Linux aren't tested yet.
|
|
97
|
+
- Rollback can't undo private files, files over 10 MB, links, or changes that are already committed.
|
|
98
|
+
- Scores come from simple rules, so expect some false flags.
|
|
99
|
+
|
|
100
|
+
## Develop
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pytest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Testers: [docs/testers.md](https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup/blob/main/docs/testers.md).
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<p align="center"><img src="assets/lineup-logo.svg" alt="lineup logo" width="324"></p>
|
|
2
|
+
|
|
3
|
+
# lineup
|
|
4
|
+
|
|
5
|
+
`lineup` shows what your coding agent (Claude Code or Codex) just changed, flags the risky edits, and lets you undo a file.
|
|
6
|
+
|
|
7
|
+
## Demo
|
|
8
|
+
|
|
9
|
+
After the agent's reply, the hook prints a short line:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
⚠ ≈ lineup: 2 HIGH
|
|
13
|
+
2 auth.py auth or payment file changed
|
|
14
|
+
3 test_utils.py assertion removed
|
|
15
|
+
Undo: lineup rollback 2
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`lineup risky` shows every changed file and the rule behind its score:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
| ID | File | Risk | Why (rule) | Other |
|
|
22
|
+
| 1 | .env | HIGH | .env or key file changed, contents not read | Can't roll back |
|
|
23
|
+
| 2 | auth.py | HIGH | auth or payment file changed | |
|
|
24
|
+
| 3 | test_utils.py | HIGH | assertion removed | |
|
|
25
|
+
| 4 | utils.py | LOW | code edited, + function added: mul | |
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`lineup rollback 2` (or `lineup rollback auth.py`) puts the file back:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
2 auth.py restored
|
|
32
|
+
Your versions from before this rollback are saved in .git/lineup/backups/2026-11-06_004042/.
|
|
33
|
+
Also changed: .env (ID 1), test_utils.py (ID 3), utils.py (ID 4). Check whether they depend on this file.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
Needs Python 3.10 or newer, git, and [pipx](https://pipx.pypa.io).
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
pipx install git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup
|
|
42
|
+
cd your-repo
|
|
43
|
+
lineup init --agent claude
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use `--agent codex` if you use Codex, or leave `--agent` out for both.
|
|
47
|
+
|
|
48
|
+
`lineup init` shows the hooks it will add and asks before writing. Then start a new Claude Code session. In Codex, run `/hooks` and trust the lineup hooks.
|
|
49
|
+
|
|
50
|
+
- No pipx: `python -m pip install --user pipx`, then `python -m pipx ensurepath`, then open a new terminal.
|
|
51
|
+
- No git: the install fails with "Cannot find command 'git'". Install git first.
|
|
52
|
+
- Upgrade: `pipx upgrade agent-lineup`. If it says it's already up to date, run `pipx install --force git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup`.
|
|
53
|
+
- Uninstall: run `lineup init --remove` in each repo first, then `pipx uninstall agent-lineup`. To delete lineup's saved data too, delete the `.git/lineup` folder in each repo.
|
|
54
|
+
|
|
55
|
+
## Commands
|
|
56
|
+
|
|
57
|
+
| Command | What it does |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `lineup init` | Adds the hooks for Claude Code (`.claude/settings.local.json`) and Codex (`.codex/hooks.json`). `--agent claude` or `--agent codex` picks one. `--remove` takes them out again. |
|
|
60
|
+
| `lineup diff` | What changed since the session started, with a short AI summary. |
|
|
61
|
+
| `lineup risky` | Scores each changed file HIGH, MED or LOW using fixed rules, and shows the rule. |
|
|
62
|
+
| `lineup rollback 3 4` | Undoes files by ID or name. Your current version is backed up first. |
|
|
63
|
+
| `lineup report` | Usage counts to send as tester feedback. No code or file names. |
|
|
64
|
+
|
|
65
|
+
## What gets sent to the AI
|
|
66
|
+
|
|
67
|
+
Only `lineup diff` uses AI. It sends the changed lines to the agent you already have (Claude Code with Haiku, or Codex), with no tools. Nothing goes anywhere else, and lineup needs no API key.
|
|
68
|
+
|
|
69
|
+
- `.env`, key and credential files are never sent. They're listed by name only.
|
|
70
|
+
- Lockfile contents are left out. Secret-looking text is hidden before sending.
|
|
71
|
+
- The hooks, `risky`, `rollback` and `report` use no AI. They run only on your machine.
|
|
72
|
+
- lineup keeps its photo, file copies and backups in `.git/lineup/` in your repo. Private files are kept as fingerprints only, never copied.
|
|
73
|
+
|
|
74
|
+
## Run it in a second terminal
|
|
75
|
+
|
|
76
|
+
You can run lineup with `!` in the same session (for example `! lineup risky`), but the agent may comment on the output. Its commentary isn't part of lineup's check: the scores come from fixed rules, not from the agent.
|
|
77
|
+
|
|
78
|
+
To avoid this, open a second terminal in the same folder and run lineup there.
|
|
79
|
+
|
|
80
|
+
## Known limits
|
|
81
|
+
|
|
82
|
+
- **Claude Code is tested. Codex hooks aren't fully tested yet**, and you must trust them with `/hooks` before they run.
|
|
83
|
+
- The secret scan can miss things. Don't rely on it alone.
|
|
84
|
+
- Tested on Windows. Mac and Linux aren't tested yet.
|
|
85
|
+
- Rollback can't undo private files, files over 10 MB, links, or changes that are already committed.
|
|
86
|
+
- Scores come from simple rules, so expect some false flags.
|
|
87
|
+
|
|
88
|
+
## Develop
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
pip install -e ".[dev]"
|
|
92
|
+
pytest
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Testers: [docs/testers.md](https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup/blob/main/docs/testers.md).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agent-lineup"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "See what your coding agent just changed, which edits are risky, and undo a file."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
dependencies = []
|
|
13
|
+
|
|
14
|
+
[project.optional-dependencies]
|
|
15
|
+
dev = ["pytest"]
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
lineup = "lineup.cli:main"
|
|
19
|
+
|
|
20
|
+
[tool.setuptools.packages.find]
|
|
21
|
+
where = ["src"]
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.package-data]
|
|
24
|
+
lineup = ["lineup-banner.txt"]
|
|
25
|
+
|
|
26
|
+
[tool.pytest.ini_options]
|
|
27
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-lineup
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: See what your coding agent just changed, which edits are risky, and undo a file.
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest; extra == "dev"
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
<p align="center"><img src="assets/lineup-logo.svg" alt="lineup logo" width="324"></p>
|
|
14
|
+
|
|
15
|
+
# lineup
|
|
16
|
+
|
|
17
|
+
`lineup` shows what your coding agent (Claude Code or Codex) just changed, flags the risky edits, and lets you undo a file.
|
|
18
|
+
|
|
19
|
+
## Demo
|
|
20
|
+
|
|
21
|
+
After the agent's reply, the hook prints a short line:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
⚠ ≈ lineup: 2 HIGH
|
|
25
|
+
2 auth.py auth or payment file changed
|
|
26
|
+
3 test_utils.py assertion removed
|
|
27
|
+
Undo: lineup rollback 2
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`lineup risky` shows every changed file and the rule behind its score:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
| ID | File | Risk | Why (rule) | Other |
|
|
34
|
+
| 1 | .env | HIGH | .env or key file changed, contents not read | Can't roll back |
|
|
35
|
+
| 2 | auth.py | HIGH | auth or payment file changed | |
|
|
36
|
+
| 3 | test_utils.py | HIGH | assertion removed | |
|
|
37
|
+
| 4 | utils.py | LOW | code edited, + function added: mul | |
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`lineup rollback 2` (or `lineup rollback auth.py`) puts the file back:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
2 auth.py restored
|
|
44
|
+
Your versions from before this rollback are saved in .git/lineup/backups/2026-11-06_004042/.
|
|
45
|
+
Also changed: .env (ID 1), test_utils.py (ID 3), utils.py (ID 4). Check whether they depend on this file.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
Needs Python 3.10 or newer, git, and [pipx](https://pipx.pypa.io).
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pipx install git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup
|
|
54
|
+
cd your-repo
|
|
55
|
+
lineup init --agent claude
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Use `--agent codex` if you use Codex, or leave `--agent` out for both.
|
|
59
|
+
|
|
60
|
+
`lineup init` shows the hooks it will add and asks before writing. Then start a new Claude Code session. In Codex, run `/hooks` and trust the lineup hooks.
|
|
61
|
+
|
|
62
|
+
- No pipx: `python -m pip install --user pipx`, then `python -m pipx ensurepath`, then open a new terminal.
|
|
63
|
+
- No git: the install fails with "Cannot find command 'git'". Install git first.
|
|
64
|
+
- Upgrade: `pipx upgrade agent-lineup`. If it says it's already up to date, run `pipx install --force git+https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup`.
|
|
65
|
+
- Uninstall: run `lineup init --remove` in each repo first, then `pipx uninstall agent-lineup`. To delete lineup's saved data too, delete the `.git/lineup` folder in each repo.
|
|
66
|
+
|
|
67
|
+
## Commands
|
|
68
|
+
|
|
69
|
+
| Command | What it does |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `lineup init` | Adds the hooks for Claude Code (`.claude/settings.local.json`) and Codex (`.codex/hooks.json`). `--agent claude` or `--agent codex` picks one. `--remove` takes them out again. |
|
|
72
|
+
| `lineup diff` | What changed since the session started, with a short AI summary. |
|
|
73
|
+
| `lineup risky` | Scores each changed file HIGH, MED or LOW using fixed rules, and shows the rule. |
|
|
74
|
+
| `lineup rollback 3 4` | Undoes files by ID or name. Your current version is backed up first. |
|
|
75
|
+
| `lineup report` | Usage counts to send as tester feedback. No code or file names. |
|
|
76
|
+
|
|
77
|
+
## What gets sent to the AI
|
|
78
|
+
|
|
79
|
+
Only `lineup diff` uses AI. It sends the changed lines to the agent you already have (Claude Code with Haiku, or Codex), with no tools. Nothing goes anywhere else, and lineup needs no API key.
|
|
80
|
+
|
|
81
|
+
- `.env`, key and credential files are never sent. They're listed by name only.
|
|
82
|
+
- Lockfile contents are left out. Secret-looking text is hidden before sending.
|
|
83
|
+
- The hooks, `risky`, `rollback` and `report` use no AI. They run only on your machine.
|
|
84
|
+
- lineup keeps its photo, file copies and backups in `.git/lineup/` in your repo. Private files are kept as fingerprints only, never copied.
|
|
85
|
+
|
|
86
|
+
## Run it in a second terminal
|
|
87
|
+
|
|
88
|
+
You can run lineup with `!` in the same session (for example `! lineup risky`), but the agent may comment on the output. Its commentary isn't part of lineup's check: the scores come from fixed rules, not from the agent.
|
|
89
|
+
|
|
90
|
+
To avoid this, open a second terminal in the same folder and run lineup there.
|
|
91
|
+
|
|
92
|
+
## Known limits
|
|
93
|
+
|
|
94
|
+
- **Claude Code is tested. Codex hooks aren't fully tested yet**, and you must trust them with `/hooks` before they run.
|
|
95
|
+
- The secret scan can miss things. Don't rely on it alone.
|
|
96
|
+
- Tested on Windows. Mac and Linux aren't tested yet.
|
|
97
|
+
- Rollback can't undo private files, files over 10 MB, links, or changes that are already committed.
|
|
98
|
+
- Scores come from simple rules, so expect some false flags.
|
|
99
|
+
|
|
100
|
+
## Develop
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pytest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Testers: [docs/testers.md](https://github.com/HARSHAVARDHAN-RAJU5/agent-lineup/blob/main/docs/testers.md).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/agent_lineup.egg-info/PKG-INFO
|
|
5
|
+
src/agent_lineup.egg-info/SOURCES.txt
|
|
6
|
+
src/agent_lineup.egg-info/dependency_links.txt
|
|
7
|
+
src/agent_lineup.egg-info/entry_points.txt
|
|
8
|
+
src/agent_lineup.egg-info/requires.txt
|
|
9
|
+
src/agent_lineup.egg-info/top_level.txt
|
|
10
|
+
src/lineup/__init__.py
|
|
11
|
+
src/lineup/__main__.py
|
|
12
|
+
src/lineup/banner.py
|
|
13
|
+
src/lineup/changes.py
|
|
14
|
+
src/lineup/cli.py
|
|
15
|
+
src/lineup/functions.py
|
|
16
|
+
src/lineup/git.py
|
|
17
|
+
src/lineup/guard.py
|
|
18
|
+
src/lineup/hookjson.py
|
|
19
|
+
src/lineup/hooks.py
|
|
20
|
+
src/lineup/lineup-banner.txt
|
|
21
|
+
src/lineup/llm.py
|
|
22
|
+
src/lineup/paths.py
|
|
23
|
+
src/lineup/rollback.py
|
|
24
|
+
src/lineup/rules.py
|
|
25
|
+
src/lineup/snapshot.py
|
|
26
|
+
src/lineup/store.py
|
|
27
|
+
src/lineup/summary.py
|
|
28
|
+
src/lineup/table.py
|
|
29
|
+
tests/test_ai_input.py
|
|
30
|
+
tests/test_banner.py
|
|
31
|
+
tests/test_changes.py
|
|
32
|
+
tests/test_cli.py
|
|
33
|
+
tests/test_commits.py
|
|
34
|
+
tests/test_compare_photo.py
|
|
35
|
+
tests/test_diff_ai.py
|
|
36
|
+
tests/test_functions.py
|
|
37
|
+
tests/test_git.py
|
|
38
|
+
tests/test_hooks.py
|
|
39
|
+
tests/test_hooks_init.py
|
|
40
|
+
tests/test_llm.py
|
|
41
|
+
tests/test_output_fixes.py
|
|
42
|
+
tests/test_private_copies.py
|
|
43
|
+
tests/test_redact.py
|
|
44
|
+
tests/test_report.py
|
|
45
|
+
tests/test_rollback.py
|
|
46
|
+
tests/test_rollback_safety.py
|
|
47
|
+
tests/test_rules.py
|
|
48
|
+
tests/test_session_start.py
|
|
49
|
+
tests/test_snapshot.py
|
|
50
|
+
tests/test_store.py
|
|
51
|
+
tests/test_summary.py
|
|
52
|
+
tests/test_symlinks.py
|
|
53
|
+
tests/test_table.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lineup
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""The lineup banner, for the user's own terminal only (init, --version, no command).
|
|
2
|
+
|
|
3
|
+
Never printed by hooks, diff, risky or rollback, so nothing the agent reads ever contains it.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
from importlib import resources
|
|
9
|
+
|
|
10
|
+
BLUE = "\x1b[38;2;111;140;216m" # #6F8CD8, readable on dark terminals
|
|
11
|
+
BLUE_256 = "\x1b[38;5;68m" # nearest 256-colour shade, for terminals without 24-bit colour
|
|
12
|
+
RESET = "\x1b[0m"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def text():
|
|
16
|
+
return resources.files("lineup").joinpath("lineup-banner.txt").read_text(encoding="utf-8")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _windows_colour_on(stream):
|
|
20
|
+
"""Turn on colour codes in a Windows console. False if it can't be done."""
|
|
21
|
+
try:
|
|
22
|
+
import ctypes
|
|
23
|
+
import msvcrt
|
|
24
|
+
handle = msvcrt.get_osfhandle(stream.fileno())
|
|
25
|
+
kernel32 = ctypes.windll.kernel32
|
|
26
|
+
mode = ctypes.c_uint32()
|
|
27
|
+
if not kernel32.GetConsoleMode(handle, ctypes.byref(mode)):
|
|
28
|
+
return False
|
|
29
|
+
return bool(mode.value & 0x0004 or kernel32.SetConsoleMode(handle, mode.value | 0x0004))
|
|
30
|
+
except (AttributeError, OSError, ValueError, ImportError):
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def colour(stream):
|
|
35
|
+
"""The colour code to use, or "" for plain text."""
|
|
36
|
+
if "NO_COLOR" in os.environ or os.environ.get("TERM") == "dumb":
|
|
37
|
+
return ""
|
|
38
|
+
if not is_terminal(stream):
|
|
39
|
+
return ""
|
|
40
|
+
if sys.platform == "win32":
|
|
41
|
+
return BLUE if _windows_colour_on(stream) else ""
|
|
42
|
+
if os.environ.get("COLORTERM", "").lower() in ("truecolor", "24bit"):
|
|
43
|
+
return BLUE
|
|
44
|
+
return BLUE_256
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def is_terminal(stream):
|
|
48
|
+
try:
|
|
49
|
+
return stream.isatty()
|
|
50
|
+
except (AttributeError, ValueError):
|
|
51
|
+
return False
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def show(stream=None):
|
|
55
|
+
"""Print the banner, only to a real terminal (piped or redirected output gets none)."""
|
|
56
|
+
stream = stream or sys.stdout
|
|
57
|
+
if not is_terminal(stream):
|
|
58
|
+
return
|
|
59
|
+
banner = text()
|
|
60
|
+
code = colour(stream)
|
|
61
|
+
if code:
|
|
62
|
+
banner = code + banner.rstrip("\n") + RESET + "\n"
|
|
63
|
+
try:
|
|
64
|
+
stream.write(banner)
|
|
65
|
+
except UnicodeEncodeError: # e.g. piped output on Windows: send the exact UTF-8 bytes
|
|
66
|
+
stream.flush()
|
|
67
|
+
stream.buffer.write(banner.encode("utf-8"))
|
|
68
|
+
stream.buffer.flush()
|
|
69
|
+
stream.write("\n")
|
|
70
|
+
stream.flush()
|