diffuser-cli 0.1.0__tar.gz → 0.1.1__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.
- diffuser_cli-0.1.1/PKG-INFO +141 -0
- diffuser_cli-0.1.1/README.md +129 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/pyproject.toml +2 -3
- diffuser_cli-0.1.1/src/diffuser/__init__.py +72 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/src/diffuser/_version.py +2 -2
- diffuser_cli-0.1.0/PKG-INFO +0 -126
- diffuser_cli-0.1.0/README.md +0 -114
- diffuser_cli-0.1.0/src/diffuser/__init__.py +0 -38
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/.github/workflows/ci.yml +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/.github/workflows/release.yml +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/.gitignore +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/.python-version +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/LICENSE +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/skills/diffuser/SKILL.md +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/src/diffuser/parse.py +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/src/diffuser/render.py +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/src/diffuser/skill.py +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/tests/test_parse.py +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/tests/test_render.py +0 -0
- {diffuser_cli-0.1.0 → diffuser_cli-0.1.1}/uv.lock +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: diffuser-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: CriticMarkup viewer for the terminal
|
|
5
|
+
Author-email: shakedlokits <shakedl@salt.security>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: rich>=14.3.3
|
|
10
|
+
Requires-Dist: typer>=0.24.1
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
██████╗ ██╗███████╗███████╗██╗ ██╗███████╗███████╗██████╗
|
|
15
|
+
██╔══██╗██║██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██╔══██╗
|
|
16
|
+
██║ ██║██║█████╗ █████╗ ██║ ██║███████╗█████╗ ██████╔╝
|
|
17
|
+
██║ ██║██║██╔══╝ ██╔══╝ ██║ ██║╚════██║██╔══╝ ██╔══██╗
|
|
18
|
+
██████╔╝██║██║ ██║ ╚██████╔╝███████║███████╗██║ ██║
|
|
19
|
+
╚═════╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
CriticMarkup viewer for the terminal.
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
### Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install diffuser-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or with uv:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv tool install diffuser-cli
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Quick Example
|
|
39
|
+
|
|
40
|
+
Given a markdown file with CriticMarkup annotations:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
The system processed the data and {~~returned results to~>delivered results
|
|
44
|
+
back to~~} the user.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Render it in the terminal with color-coded annotations:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
diffuser view my-document.md
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Background & Rationale
|
|
54
|
+
|
|
55
|
+
Writing blog posts in markdown is straightforward until you start editing.
|
|
56
|
+
You change a sentence, rewrite a paragraph, cut a section. The next morning,
|
|
57
|
+
you're not sure what you changed or why. Git solves this for code, but
|
|
58
|
+
version control for prose is a different problem. You don't want branches
|
|
59
|
+
and merge conflicts for a blog post. You want to see what changed, right
|
|
60
|
+
there in the text.
|
|
61
|
+
|
|
62
|
+
Fletcher Penney saw this clearly. Penney is the creator of
|
|
63
|
+
[MultiMarkdown](https://fletcherpenney.net/multimarkdown/). He has spent
|
|
64
|
+
years building tools for writers who think in plain text. Together with Gabe
|
|
65
|
+
Weatherhead, he created [CriticMarkup](http://criticmarkup.com): five
|
|
66
|
+
simple inline annotations that track changes without leaving the document.
|
|
67
|
+
`{++add this++}`, `{--remove this--}`, `{~~old~>new~~}`. No external
|
|
68
|
+
tooling. No version control. Just the text.
|
|
69
|
+
|
|
70
|
+
The idea was brilliant. I just needed it in the terminal. That's diffuser.
|
|
71
|
+
|
|
72
|
+
## How It Works
|
|
73
|
+
|
|
74
|
+
diffuser preprocesses CriticMarkup syntax into Rich markup, then delegates
|
|
75
|
+
all markdown rendering to the `rich` library. No custom HTML parser, no
|
|
76
|
+
browser. Just your terminal.
|
|
77
|
+
|
|
78
|
+
### CriticMarkup Syntax
|
|
79
|
+
|
|
80
|
+
| Syntax | Meaning |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `{++text++}` | Insertion |
|
|
83
|
+
| `{--text--}` | Deletion |
|
|
84
|
+
| `{~~old~>new~~}` | Substitution |
|
|
85
|
+
| `{==text==}` | Highlight |
|
|
86
|
+
| `{>>text<<}` | Comment |
|
|
87
|
+
|
|
88
|
+
Full specification: http://criticmarkup.com/spec.php
|
|
89
|
+
|
|
90
|
+
## Agent Skill
|
|
91
|
+
|
|
92
|
+
diffuser ships with a skill that teaches AI agents how to use CriticMarkup
|
|
93
|
+
when editing your writing. Install it with the [skills CLI](https://skills.sh):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx skills add shakedlokits/diffuser
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or view the skill content directly:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
diffuser skill
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The skill instructs the agent to annotate files in-place using CriticMarkup
|
|
106
|
+
syntax, never deleting or replacing original text directly.
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
### Setup
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/shakedlokits/diffuser.git
|
|
114
|
+
cd diffuser
|
|
115
|
+
uv sync
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Running
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
uv run diffuser view my-document.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Running Tests
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
uv run pytest
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Releasing
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git tag v0.1.0
|
|
134
|
+
git push origin v0.1.0
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Credits
|
|
138
|
+
|
|
139
|
+
CriticMarkup was created by [Fletcher Penney](https://fletcherpenney.net/)
|
|
140
|
+
and [Gabe Weatherhead](http://macdrifter.com). Full specification at
|
|
141
|
+
[criticmarkup.com](http://criticmarkup.com/spec.php).
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
```
|
|
2
|
+
██████╗ ██╗███████╗███████╗██╗ ██╗███████╗███████╗██████╗
|
|
3
|
+
██╔══██╗██║██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██╔══██╗
|
|
4
|
+
██║ ██║██║█████╗ █████╗ ██║ ██║███████╗█████╗ ██████╔╝
|
|
5
|
+
██║ ██║██║██╔══╝ ██╔══╝ ██║ ██║╚════██║██╔══╝ ██╔══██╗
|
|
6
|
+
██████╔╝██║██║ ██║ ╚██████╔╝███████║███████╗██║ ██║
|
|
7
|
+
╚═════╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
CriticMarkup viewer for the terminal.
|
|
11
|
+
|
|
12
|
+
## Getting Started
|
|
13
|
+
|
|
14
|
+
### Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install diffuser-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or with uv:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv tool install diffuser-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Quick Example
|
|
27
|
+
|
|
28
|
+
Given a markdown file with CriticMarkup annotations:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
The system processed the data and {~~returned results to~>delivered results
|
|
32
|
+
back to~~} the user.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Render it in the terminal with color-coded annotations:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
diffuser view my-document.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Background & Rationale
|
|
42
|
+
|
|
43
|
+
Writing blog posts in markdown is straightforward until you start editing.
|
|
44
|
+
You change a sentence, rewrite a paragraph, cut a section. The next morning,
|
|
45
|
+
you're not sure what you changed or why. Git solves this for code, but
|
|
46
|
+
version control for prose is a different problem. You don't want branches
|
|
47
|
+
and merge conflicts for a blog post. You want to see what changed, right
|
|
48
|
+
there in the text.
|
|
49
|
+
|
|
50
|
+
Fletcher Penney saw this clearly. Penney is the creator of
|
|
51
|
+
[MultiMarkdown](https://fletcherpenney.net/multimarkdown/). He has spent
|
|
52
|
+
years building tools for writers who think in plain text. Together with Gabe
|
|
53
|
+
Weatherhead, he created [CriticMarkup](http://criticmarkup.com): five
|
|
54
|
+
simple inline annotations that track changes without leaving the document.
|
|
55
|
+
`{++add this++}`, `{--remove this--}`, `{~~old~>new~~}`. No external
|
|
56
|
+
tooling. No version control. Just the text.
|
|
57
|
+
|
|
58
|
+
The idea was brilliant. I just needed it in the terminal. That's diffuser.
|
|
59
|
+
|
|
60
|
+
## How It Works
|
|
61
|
+
|
|
62
|
+
diffuser preprocesses CriticMarkup syntax into Rich markup, then delegates
|
|
63
|
+
all markdown rendering to the `rich` library. No custom HTML parser, no
|
|
64
|
+
browser. Just your terminal.
|
|
65
|
+
|
|
66
|
+
### CriticMarkup Syntax
|
|
67
|
+
|
|
68
|
+
| Syntax | Meaning |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `{++text++}` | Insertion |
|
|
71
|
+
| `{--text--}` | Deletion |
|
|
72
|
+
| `{~~old~>new~~}` | Substitution |
|
|
73
|
+
| `{==text==}` | Highlight |
|
|
74
|
+
| `{>>text<<}` | Comment |
|
|
75
|
+
|
|
76
|
+
Full specification: http://criticmarkup.com/spec.php
|
|
77
|
+
|
|
78
|
+
## Agent Skill
|
|
79
|
+
|
|
80
|
+
diffuser ships with a skill that teaches AI agents how to use CriticMarkup
|
|
81
|
+
when editing your writing. Install it with the [skills CLI](https://skills.sh):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx skills add shakedlokits/diffuser
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Or view the skill content directly:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
diffuser skill
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The skill instructs the agent to annotate files in-place using CriticMarkup
|
|
94
|
+
syntax, never deleting or replacing original text directly.
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
### Setup
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone https://github.com/shakedlokits/diffuser.git
|
|
102
|
+
cd diffuser
|
|
103
|
+
uv sync
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Running
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv run diffuser view my-document.md
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Running Tests
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uv run pytest
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Releasing
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
git tag v0.1.0
|
|
122
|
+
git push origin v0.1.0
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Credits
|
|
126
|
+
|
|
127
|
+
CriticMarkup was created by [Fletcher Penney](https://fletcherpenney.net/)
|
|
128
|
+
and [Gabe Weatherhead](http://macdrifter.com). Full specification at
|
|
129
|
+
[criticmarkup.com](http://criticmarkup.com/spec.php).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "diffuser-cli"
|
|
3
3
|
dynamic = ["version"]
|
|
4
|
-
description = "CriticMarkup
|
|
4
|
+
description = "CriticMarkup viewer for the terminal"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
7
|
-
{ name = "
|
|
7
|
+
{ name = "shakedlokits", email = "shakedl@salt.security" }
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
license = "GPL-3.0-or-later"
|
|
@@ -22,7 +22,6 @@ build-backend = "hatchling.build"
|
|
|
22
22
|
|
|
23
23
|
[tool.hatch.version]
|
|
24
24
|
source = "vcs"
|
|
25
|
-
fallback-version = "0.0.0"
|
|
26
25
|
|
|
27
26
|
[tool.hatch.build.hooks.vcs]
|
|
28
27
|
version-file = "src/diffuser/_version.py"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""diffuser -- CriticMarkup viewer for the terminal."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
import typer
|
|
7
|
+
|
|
8
|
+
from diffuser.parse import prepare
|
|
9
|
+
from diffuser.render import render
|
|
10
|
+
from diffuser.skill import get_skill_content
|
|
11
|
+
|
|
12
|
+
_BANNER = r"""
|
|
13
|
+
██████╗ ██╗███████╗███████╗██╗ ██╗███████╗███████╗██████╗
|
|
14
|
+
██╔══██╗██║██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██╔══██╗
|
|
15
|
+
██║ ██║██║█████╗ █████╗ ██║ ██║███████╗█████╗ ██████╔╝
|
|
16
|
+
██║ ██║██║██╔══╝ ██╔══╝ ██║ ██║╚════██║██╔══╝ ██╔══██╗
|
|
17
|
+
██████╔╝██║██║ ██║ ╚██████╔╝███████║███████╗██║ ██║
|
|
18
|
+
╚═════╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _version_callback(value: bool) -> None:
|
|
23
|
+
if value:
|
|
24
|
+
from diffuser._version import __version__
|
|
25
|
+
|
|
26
|
+
typer.echo(f"diffuser {__version__}")
|
|
27
|
+
raise typer.Exit()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
app = typer.Typer(
|
|
31
|
+
help=_BANNER + "\n CriticMarkup viewer for the terminal.",
|
|
32
|
+
epilog="Made by Shaked Lokits. https://github.com/shakedlokits/diffuser",
|
|
33
|
+
no_args_is_help=True,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@app.callback()
|
|
38
|
+
def _main_callback(
|
|
39
|
+
version: Optional[bool] = typer.Option(
|
|
40
|
+
None,
|
|
41
|
+
"--version",
|
|
42
|
+
"-v",
|
|
43
|
+
callback=_version_callback,
|
|
44
|
+
is_eager=True,
|
|
45
|
+
help="Show version and exit.",
|
|
46
|
+
),
|
|
47
|
+
) -> None:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@app.command()
|
|
52
|
+
def view(
|
|
53
|
+
file: Path = typer.Argument(..., help="Markdown file to render"),
|
|
54
|
+
) -> None:
|
|
55
|
+
"""Render a CriticMarkup-annotated markdown file in the terminal."""
|
|
56
|
+
if not file.exists():
|
|
57
|
+
typer.echo(f"Error: file not found: {file}", err=True)
|
|
58
|
+
raise typer.Exit(code=1)
|
|
59
|
+
|
|
60
|
+
text = file.read_text()
|
|
61
|
+
prepared = prepare(text)
|
|
62
|
+
render(prepared)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@app.command()
|
|
66
|
+
def skill() -> None:
|
|
67
|
+
"""Print the CriticMarkup agent skill (SKILL.md) to stdout."""
|
|
68
|
+
typer.echo(get_skill_content())
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def main() -> None:
|
|
72
|
+
app()
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
21
|
+
__version__ = version = '0.1.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
diffuser_cli-0.1.0/PKG-INFO
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: diffuser-cli
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: CriticMarkup-aware markdown viewer for the terminal
|
|
5
|
-
Author-email: shaked-lokits <shakedl@salt.security>
|
|
6
|
-
License-Expression: GPL-3.0-or-later
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Requires-Python: >=3.11
|
|
9
|
-
Requires-Dist: rich>=14.3.3
|
|
10
|
-
Requires-Dist: typer>=0.24.1
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
██████ ██ ████████ ████████ ██ ██ ▄█████ ████████ ██████
|
|
16
|
-
██ ██ ██ ██ ██ ██ ██ ▀▀▀▄▄▄ ██ ██ ██
|
|
17
|
-
██ ██ ██ ██████ ██████ ██ ██ █████▀ ██████ ██████
|
|
18
|
-
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██
|
|
19
|
-
██████ ██ ██ ██ ██████ ██████▀ ████████ ██ ██
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
CriticMarkup-aware markdown viewer for the terminal.
|
|
24
|
-
|
|
25
|
-
## Getting Started
|
|
26
|
-
|
|
27
|
-
### Installation
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
pip install diffuser-cli
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Or with uv:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
uv tool install diffuser-cli
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Quick Example
|
|
40
|
-
|
|
41
|
-
Given a markdown file with CriticMarkup annotations:
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-
The system processed the data and {~~returned results to~>delivered results
|
|
45
|
-
back to~~} the user.{>>"Delivered back" is more active and specific.<<}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Render it in the terminal with color-coded annotations:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
diffuser view my-document.md
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Background & Rationale
|
|
55
|
-
|
|
56
|
-
When AI agents suggest changes to writing, they typically rewrite the whole
|
|
57
|
-
file. The original is gone. If you disagree with one sentence, tough luck --
|
|
58
|
-
you're diffing walls of prose in a terminal.
|
|
59
|
-
|
|
60
|
-
CriticMarkup solves this. It's a plain-text syntax for editorial annotations
|
|
61
|
-
that sits inside the document without destroying what was already there.
|
|
62
|
-
`{++add this++}`, `{--remove this--}`, `{~~old~>new~~}` -- five simple
|
|
63
|
-
marks that let an agent suggest changes while preserving every word of the
|
|
64
|
-
original.
|
|
65
|
-
|
|
66
|
-
What was missing was a way to view these annotations clearly from the
|
|
67
|
-
command line. Rich terminal rendering, color-coded by change type, without
|
|
68
|
-
leaving the shell. That's what diffuser does.
|
|
69
|
-
|
|
70
|
-
## How It Works
|
|
71
|
-
|
|
72
|
-
diffuser preprocesses CriticMarkup syntax into Rich markup, then delegates
|
|
73
|
-
all markdown rendering to the `rich` library. No custom HTML parser, no
|
|
74
|
-
browser -- just your terminal.
|
|
75
|
-
|
|
76
|
-
### CriticMarkup Syntax
|
|
77
|
-
|
|
78
|
-
| Syntax | Meaning |
|
|
79
|
-
|---|---|
|
|
80
|
-
| `{++text++}` | Insertion |
|
|
81
|
-
| `{--text--}` | Deletion |
|
|
82
|
-
| `{~~old~>new~~}` | Substitution |
|
|
83
|
-
| `{==text==}` | Highlight |
|
|
84
|
-
| `{>>text<<}` | Comment |
|
|
85
|
-
|
|
86
|
-
Full specification: http://criticmarkup.com/spec.php
|
|
87
|
-
|
|
88
|
-
## Agent Skill
|
|
89
|
-
|
|
90
|
-
diffuser ships with a skill that teaches AI agents how to use CriticMarkup
|
|
91
|
-
when editing your writing. Install it with the [skills CLI](https://skills.sh):
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npx skills add shakedlokits/diffuser
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Or view the skill content directly:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
diffuser skill
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
The skill instructs the agent to annotate files in-place using CriticMarkup
|
|
104
|
-
syntax, never deleting or replacing original text directly.
|
|
105
|
-
|
|
106
|
-
## Development
|
|
107
|
-
|
|
108
|
-
### Setup
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
git clone https://github.com/shakedlokits/diffuser.git
|
|
112
|
-
cd diffuser
|
|
113
|
-
uv sync
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Running
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
uv run diffuser view my-document.md
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Running Tests
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
uv run pytest
|
|
126
|
-
```
|
diffuser_cli-0.1.0/README.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
```
|
|
2
|
-
|
|
3
|
-
██████ ██ ████████ ████████ ██ ██ ▄█████ ████████ ██████
|
|
4
|
-
██ ██ ██ ██ ██ ██ ██ ▀▀▀▄▄▄ ██ ██ ██
|
|
5
|
-
██ ██ ██ ██████ ██████ ██ ██ █████▀ ██████ ██████
|
|
6
|
-
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██
|
|
7
|
-
██████ ██ ██ ██ ██████ ██████▀ ████████ ██ ██
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
CriticMarkup-aware markdown viewer for the terminal.
|
|
12
|
-
|
|
13
|
-
## Getting Started
|
|
14
|
-
|
|
15
|
-
### Installation
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pip install diffuser-cli
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Or with uv:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
uv tool install diffuser-cli
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Quick Example
|
|
28
|
-
|
|
29
|
-
Given a markdown file with CriticMarkup annotations:
|
|
30
|
-
|
|
31
|
-
```markdown
|
|
32
|
-
The system processed the data and {~~returned results to~>delivered results
|
|
33
|
-
back to~~} the user.{>>"Delivered back" is more active and specific.<<}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Render it in the terminal with color-coded annotations:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
diffuser view my-document.md
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Background & Rationale
|
|
43
|
-
|
|
44
|
-
When AI agents suggest changes to writing, they typically rewrite the whole
|
|
45
|
-
file. The original is gone. If you disagree with one sentence, tough luck --
|
|
46
|
-
you're diffing walls of prose in a terminal.
|
|
47
|
-
|
|
48
|
-
CriticMarkup solves this. It's a plain-text syntax for editorial annotations
|
|
49
|
-
that sits inside the document without destroying what was already there.
|
|
50
|
-
`{++add this++}`, `{--remove this--}`, `{~~old~>new~~}` -- five simple
|
|
51
|
-
marks that let an agent suggest changes while preserving every word of the
|
|
52
|
-
original.
|
|
53
|
-
|
|
54
|
-
What was missing was a way to view these annotations clearly from the
|
|
55
|
-
command line. Rich terminal rendering, color-coded by change type, without
|
|
56
|
-
leaving the shell. That's what diffuser does.
|
|
57
|
-
|
|
58
|
-
## How It Works
|
|
59
|
-
|
|
60
|
-
diffuser preprocesses CriticMarkup syntax into Rich markup, then delegates
|
|
61
|
-
all markdown rendering to the `rich` library. No custom HTML parser, no
|
|
62
|
-
browser -- just your terminal.
|
|
63
|
-
|
|
64
|
-
### CriticMarkup Syntax
|
|
65
|
-
|
|
66
|
-
| Syntax | Meaning |
|
|
67
|
-
|---|---|
|
|
68
|
-
| `{++text++}` | Insertion |
|
|
69
|
-
| `{--text--}` | Deletion |
|
|
70
|
-
| `{~~old~>new~~}` | Substitution |
|
|
71
|
-
| `{==text==}` | Highlight |
|
|
72
|
-
| `{>>text<<}` | Comment |
|
|
73
|
-
|
|
74
|
-
Full specification: http://criticmarkup.com/spec.php
|
|
75
|
-
|
|
76
|
-
## Agent Skill
|
|
77
|
-
|
|
78
|
-
diffuser ships with a skill that teaches AI agents how to use CriticMarkup
|
|
79
|
-
when editing your writing. Install it with the [skills CLI](https://skills.sh):
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npx skills add shakedlokits/diffuser
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Or view the skill content directly:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
diffuser skill
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
The skill instructs the agent to annotate files in-place using CriticMarkup
|
|
92
|
-
syntax, never deleting or replacing original text directly.
|
|
93
|
-
|
|
94
|
-
## Development
|
|
95
|
-
|
|
96
|
-
### Setup
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
git clone https://github.com/shakedlokits/diffuser.git
|
|
100
|
-
cd diffuser
|
|
101
|
-
uv sync
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Running
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
uv run diffuser view my-document.md
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Running Tests
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
uv run pytest
|
|
114
|
-
```
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"""diffuser -- CriticMarkup-aware markdown viewer for the terminal."""
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
import typer
|
|
6
|
-
|
|
7
|
-
from diffuser.parse import prepare
|
|
8
|
-
from diffuser.render import render
|
|
9
|
-
from diffuser.skill import get_skill_content
|
|
10
|
-
|
|
11
|
-
app = typer.Typer(
|
|
12
|
-
help="Render markdown with CriticMarkup annotations in the terminal.",
|
|
13
|
-
no_args_is_help=True,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@app.command()
|
|
18
|
-
def view(
|
|
19
|
-
file: Path = typer.Argument(..., help="Markdown file to render"),
|
|
20
|
-
) -> None:
|
|
21
|
-
"""Render a CriticMarkup-annotated markdown file in the terminal."""
|
|
22
|
-
if not file.exists():
|
|
23
|
-
typer.echo(f"Error: file not found: {file}", err=True)
|
|
24
|
-
raise typer.Exit(code=1)
|
|
25
|
-
|
|
26
|
-
text = file.read_text()
|
|
27
|
-
prepared = prepare(text)
|
|
28
|
-
render(prepared)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@app.command()
|
|
32
|
-
def skill() -> None:
|
|
33
|
-
"""Print the CriticMarkup agent skill (SKILL.md) to stdout."""
|
|
34
|
-
typer.echo(get_skill_content())
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def main() -> None:
|
|
38
|
-
app()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|