diffuser-cli 0.1.0__tar.gz → 0.1.2__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.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffuser-cli
3
+ Version: 0.1.2
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
+ ## Agent Skill
73
+
74
+ If you want to use an agent to help you with writing, there's a skill to
75
+ guide it on how to use CriticMarkup when suggesting changes:
76
+
77
+ ```bash
78
+ npx skills add shakedlokits/diffuser
79
+ ```
80
+
81
+ ## Development
82
+
83
+ ### Setup
84
+
85
+ ```bash
86
+ git clone https://github.com/shakedlokits/diffuser.git
87
+ cd diffuser
88
+ uv sync
89
+ ```
90
+
91
+ ### Running
92
+
93
+ ```bash
94
+ uv run diffuser view my-document.md
95
+ ```
96
+
97
+ ### Running Tests
98
+
99
+ ```bash
100
+ uv run pytest
101
+ ```
102
+
103
+ ### Releasing
104
+
105
+ ```bash
106
+ git tag v0.1.0
107
+ git push origin v0.1.0
108
+ ```
109
+
110
+ ## Credits
111
+
112
+ CriticMarkup was created by [Fletcher Penney](https://fletcherpenney.net/)
113
+ and [Gabe Weatherhead](http://macdrifter.com). Full specification at
114
+ [criticmarkup.com](http://criticmarkup.com/spec.php).
@@ -0,0 +1,102 @@
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
+ ## Agent Skill
61
+
62
+ If you want to use an agent to help you with writing, there's a skill to
63
+ guide it on how to use CriticMarkup when suggesting changes:
64
+
65
+ ```bash
66
+ npx skills add shakedlokits/diffuser
67
+ ```
68
+
69
+ ## Development
70
+
71
+ ### Setup
72
+
73
+ ```bash
74
+ git clone https://github.com/shakedlokits/diffuser.git
75
+ cd diffuser
76
+ uv sync
77
+ ```
78
+
79
+ ### Running
80
+
81
+ ```bash
82
+ uv run diffuser view my-document.md
83
+ ```
84
+
85
+ ### Running Tests
86
+
87
+ ```bash
88
+ uv run pytest
89
+ ```
90
+
91
+ ### Releasing
92
+
93
+ ```bash
94
+ git tag v0.1.0
95
+ git push origin v0.1.0
96
+ ```
97
+
98
+ ## Credits
99
+
100
+ CriticMarkup was created by [Fletcher Penney](https://fletcherpenney.net/)
101
+ and [Gabe Weatherhead](http://macdrifter.com). Full specification at
102
+ [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-aware markdown viewer for the terminal"
4
+ description = "CriticMarkup viewer for the terminal"
5
5
  readme = "README.md"
6
6
  authors = [
7
- { name = "shaked-lokits", email = "shakedl@salt.security" }
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.0'
22
- __version_tuple__ = version_tuple = (0, 1, 0)
21
+ __version__ = version = '0.1.2'
22
+ __version_tuple__ = version_tuple = (0, 1, 2)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -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
- ```
@@ -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