Skip to content

Commit 93a259f

Browse files
fix(#161)!: fixed broken pipe (#178)
fixes #161 BREAKING CHANGE: --input argument replaced by positional "content" argument. New usage: ``` nitrodigest <file/directory/string> ``` instead of ``` nitrodigest --input <file/directory> ``` Updated main.py file to support new positional argument and support input from pipe. Also I updated documentation and removed all --input argument occurances.
1 parent 0ada9de commit 93a259f

File tree

13 files changed

+139
-120
lines changed

13 files changed

+139
-120
lines changed

Projects/Nitrodigest/Docs/Contributing/Getting started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@ Make sure you are in the src directory and run command:
118118

119119
```bash
120120
mkdir summaries
121-
python run-nitrodigest-cli.py --input <file or directory you want to summarize> > summaries/summary.md
121+
python run-nitrodigest-cli.py <file or directory you want to summarize> > summaries/summary.md
122122
```

Projects/Nitrodigest/Docs/Getting Started/Quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Create a simple text file `example.txt` with some content (for instance, you can
1010
## 2. Run NitroDigest on the file
1111

1212
```bash
13-
nitrodigest --input example.txt
13+
nitrodigest example.txt
1414
```
1515

1616
This command will use the default settings to summarize `example.txt`. The tool will connect to the local Ollama model, generate a summary, and save the result.
@@ -30,7 +30,7 @@ When the process is done, you will see a summary in terminal.
3030
If you want to save the summary into a file, please use command like this:
3131

3232
```bash
33-
nitrodigest --input example.txt > summary.md
33+
nitrodigest example.txt > summary.md
3434
```
3535

3636
When the process is done, you can simply see the summary from file. Example:

Projects/Nitrodigest/Docs/Guides/Overriding Prompt Templates.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NitroDigest offers three ways to customize prompts, in order of priority:
2828
Use the `--prompt` argument to provide prompt content directly in the command line:
2929

3030
```bash
31-
=nitrodigest --input document.txt --prompt "Summarize this document focusing on action items and deadlines. Format the output as a bulleted list."=
31+
=nitrodigest document.txt --prompt "Summarize this document focusing on action items and deadlines. Format the output as a bulleted list."=
3232
```
3333

3434
### Advantages
@@ -46,21 +46,21 @@ Use the `--prompt` argument to provide prompt content directly in the command li
4646
### Example: Meeting Notes Focus
4747

4848
```bash
49-
nitrodigest --input meeting.txt --prompt "Extract and summarize the key decisions, action items, and deadlines from this meeting. Format as: DECISIONS: ..., ACTION ITEMS: ..., DEADLINES: ..."
49+
nitrodigest meeting.txt --prompt "Extract and summarize the key decisions, action items, and deadlines from this meeting. Format as: DECISIONS: ..., ACTION ITEMS: ..., DEADLINES: ..."
5050
```
5151

5252
### Example: Technical Documentation
5353

5454
```bash
55-
nitrodigest --input api-docs.md --prompt "Summarize this technical documentation highlighting: 1) Main purpose/functionality, 2) Key parameters and methods, 3) Usage examples, 4) Important limitations or considerations."
55+
nitrodigest api-docs.md --prompt "Summarize this technical documentation highlighting: 1) Main purpose/functionality, 2) Key parameters and methods, 3) Usage examples, 4) Important limitations or considerations."
5656
```
5757

5858
## Method 2: Prompt Template Files
5959

6060
For reusable prompts, create template files and reference them with `--prompt-file`:
6161

6262
```bash
63-
nitrodigest --input document.txt --prompt-file custom-prompt.txt
63+
nitrodigest document.txt --prompt-file custom-prompt.txt
6464
```
6565

6666
### Creating Prompt Template Files
@@ -125,13 +125,13 @@ Keep the summary academic but accessible, suitable for someone familiar with the
125125
126126
```bash
127127
# Use technical summary template
128-
nitrodigest --input api-documentation.md --prompt-file prompt_technical_summary.txt
128+
nitrodigest api-documentation.md --prompt-file prompt_technical_summary.txt
129129

130130
# Use meeting notes template
131-
nitrodigest --input team-meeting.txt --prompt-file prompt_meeting_notes.txt
131+
nitrodigest team-meeting.txt --prompt-file prompt_meeting_notes.txt
132132

133133
# Use research template
134-
nitrodigest --input research-paper.pdf --prompt-file prompt_research_paper.txt
134+
nitrodigest research-paper.pdf --prompt-file prompt_research_paper.txt
135135
```
136136
137137
### Template File Best Practices
@@ -153,21 +153,21 @@ One powerful technique is to run Nitrodigest two times on the same set of data.
153153
#### First Pass - Extract Content
154154
155155
```bash
156-
nitrodigest --input document.pdf --prompt "Summarize the key points, findings, and important information from this document. Focus on capturing all essential content. Return a bullet lists" > raw-summary.md
156+
nitrodigest document.pdf --prompt "Summarize the key points, findings, and important information from this document. Focus on capturing all essential content. Return a bullet lists" > raw-summary.md
157157
```
158158
159159
#### Second Pass - Format Refinement
160160
161161
```bash
162-
nitrodigest --input raw-summary.md --prompt "Forrmat this summary into a bullet list that have heading + paragraph" > final-summary.md
162+
nitrodigest raw-summary.md --prompt "Forrmat this summary into a bullet list that have heading + paragraph" > final-summary.md
163163
```
164164
165165
#### Single Command
166166
167167
You can chain both passes in one command using shell piping:
168168
169169
```bash
170-
nitrodigest --input document.pdf --prompt "Summarize key points and findings" | nitrodigest --input /dev/stdin --prompt "Reformat this content with clear headings, bullet points, and professional structure" > formatted-summary.md
170+
nitrodigest example.txt --prompt "Summarize key points and findings" | nitrodigest --prompt "Reformat this content with clear headings, bullet points, and professional structure" > formatted-summary.md
171171
```
172172
173173
### Directory Processing with Custom Prompts
@@ -176,7 +176,7 @@ Apply the same custom prompt to all files in a directory:
176176
177177
```bash
178178
# Summarize all meeting notes with consistent format
179-
nitrodigest --input meeting-notes-folder/ --prompt-file meeting-template.txt > all-meetings-summary.md
179+
nitrodigest meeting-notes-folder/ --prompt-file meeting-template.txt > all-meetings-summary.md
180180
```
181181
182182
### Prompt Optimization Tips

Projects/Nitrodigest/Docs/Guides/Summarizing All Files in a Directory.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide shows you how to process multiple files at once by pointing NitroDige
88
The simplest way to process all supported files in a directory is:
99

1010
```bash
11-
nitrodigest --input /path/to/directory
11+
nitrodigest /path/to/directory
1212
```
1313

1414
This command will:
@@ -47,7 +47,7 @@ documents/
4747
Running:
4848

4949
```bash
50-
nitrodigest --input documents/
50+
nitrodigest documents/
5151
```
5252

5353
Will process `meeting-notes.txt`, `project-report.md`, `data-analysis.csv`, `webpage.html`, and `subdirectory/more-notes.txt`. The `image.jpg` file will be skipped since it's not a supported text format.
@@ -59,7 +59,7 @@ Will process `meeting-notes.txt`, `project-report.md`, `data-analysis.csv`, `web
5959
By default, all summaries are displayed in your terminal one after another:
6060

6161
```bash
62-
nitrodigest --input documents/
62+
nitrodigest documents/
6363
```
6464

6565
You'll see processing messages and formatted summaries for each file:
@@ -92,7 +92,7 @@ Directory processing complete: 4 of 4 files processed successfully
9292
To collect all summaries in a single file:
9393

9494
```bash
95-
nitrodigest --input documents/ > all_summaries.md
95+
nitrodigest documents/ > all_summaries.md
9696
```
9797

9898
This creates a comprehensive document with all summaries combined, making it easy to review everything at once.
@@ -102,7 +102,7 @@ This creates a comprehensive document with all summaries combined, making it eas
102102
To add directory summaries to an existing summary collection:
103103

104104
```bash
105-
nitrodigest --input new_documents/ >> existing_summaries.md
105+
nitrodigest new_documents/ >> existing_summaries.md
106106
```
107107

108108
## Working with Different Directory Sizes
@@ -112,7 +112,7 @@ nitrodigest --input new_documents/ >> existing_summaries.md
112112
For directories with just a few files, processing is straightforward and fast:
113113

114114
```bash
115-
nitrodigest --input my_notes/
115+
nitrodigest my_notes/
116116
```
117117

118118
## Directory Processing Behavior
@@ -146,31 +146,31 @@ Files are processed in the order they're discovered by the file system, which ty
146146
Process a folder of research papers or articles:
147147

148148
```bash
149-
nitrodigest --input research_papers/ > research_summary.md
149+
nitrodigest research_papers/ > research_summary.md
150150
```
151151

152152
### Project Documentation
153153

154154
Summarize all documentation in a project:
155155

156156
```bash
157-
nitrodigest --input project_docs/ > project_overview.md
157+
nitrodigest project_docs/ > project_overview.md
158158
```
159159

160160
### Email Archive
161161

162162
Process exported email files:
163163

164164
```bash
165-
nitrodigest --input email_exports/ > email_summaries.md
165+
nitrodigest email_exports/ > email_summaries.md
166166
```
167167

168168
### Meeting Notes Collection
169169

170170
Summarize a month's worth of meeting notes:
171171

172172
```bash
173-
nitrodigest --input meeting_notes_march/ > march_meetings_summary.md
173+
nitrodigest meeting_notes_march/ > march_meetings_summary.md
174174
```
175175

176176
## Tips and Best Practices
@@ -192,7 +192,7 @@ documents/
192192
If you want to process only recent files, consider organizing them by date first, then process specific subdirectories:
193193

194194
```bash
195-
nitrodigest --input documents/2025-may/
195+
nitrodigest documents/2025-may/
196196
```
197197

198198
### Preview Before Processing
@@ -225,15 +225,15 @@ Directory processing complete: 0 of 0 files processed successfully
225225
Use a different model for the entire directory:
226226

227227
```bash
228-
nitrodigest --input documents/ --model llama2 > llama2_summaries.md
228+
nitrodigest documents/ --model llama2 > llama2_summaries.md
229229
```
230230

231231
### Custom Prompts for Specialized Content
232232

233233
If your directory contains specialized content, use a custom prompt:
234234

235235
```bash
236-
nitrodigest --input technical_docs/ --prompt "Summarize this technical document focusing on implementation details and requirements" > tech_summaries.md
236+
nitrodigest technical_docs/ --prompt "Summarize this technical document focusing on implementation details and requirements" > tech_summaries.md
237237
```
238238

239239
## Next Steps

Projects/Nitrodigest/Docs/Guides/Summarizing a Single File.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide covers how to process individual files with NitroDigest in detail. Wh
88
The fundamental command for processing a single file is:
99

1010
```bash
11-
nitrodigest --input <filename>
11+
nitrodigest <filename>
1212
```
1313

1414
This command will:
@@ -25,30 +25,30 @@ NitroDigest can process various text-based file formats:
2525
### Plain Text Files
2626

2727
```bash
28-
nitrodigest --input document.txt
29-
nitrodigest --input notes.log
30-
nitrodigest --input readme.rst
28+
nitrodigest document.txt
29+
nitrodigest notes.log
30+
nitrodigest readme.rst
3131
```
3232

3333
### Markdown Files
3434

3535
```bash
36-
nitrodigest --input article.md
37-
nitrodigest --input documentation.markdown
36+
nitrodigest article.md
37+
nitrodigest documentation.markdown
3838
```
3939

4040
### Web Content
4141

4242
```bash
43-
nitrodigest --input webpage.html
44-
nitrodigest --input email.htm
43+
nitrodigest webpage.html
44+
nitrodigest email.htm
4545
```
4646

4747
### Structured Data
4848

4949
```bash
50-
nitrodigest --input data.json
51-
nitrodigest --input report.csv
50+
nitrodigest data.json
51+
nitrodigest report.csv
5252
```
5353

5454
**Note:** when you process files like HTML that can contain many HTML tags, please try to extract text from the HTML before you run NitroDigest. It will increase quality of the summary and decrease processing time.
@@ -60,7 +60,7 @@ nitrodigest --input report.csv
6060
By default, NitroDigest displays the summary directly in your terminal:
6161

6262
```bash
63-
nitrodigest --input newsletter.txt
63+
nitrodigest newsletter.txt
6464
```
6565

6666
You'll see processing messages followed by the formatted summary:
@@ -88,7 +88,7 @@ tokens: 189
8888
To save the summary to a file instead of displaying it in the terminal:
8989

9090
```bash
91-
nitrodigest --input example.txt > example_summary.md
91+
nitrodigest example.txt > example_summary.md
9292
```
9393

9494
You can then view the saved summary:
@@ -102,13 +102,13 @@ cat example_summary.md
102102
To add summaries to an existing file:
103103

104104
```bash
105-
nitrodigest --input example.txt >> all_summaries.md
105+
nitrodigest example.txt >> all_summaries.md
106106
```
107107

108108
A nice example for this approach is a case when you want to add a summary to the same file, that you summarize:
109109

110110
```bash
111-
nitrodigest --input example2.txt >> example2.txt
111+
nitrodigest example2.txt >> example2.txt
112112
```
113113

114114
## Working with Different File Sizes
@@ -118,7 +118,7 @@ nitrodigest --input example2.txt >> example2.txt
118118
For files under 1000 words, processing is typically fast and straightforward:
119119

120120
```bash
121-
nitrodigest --input email.txt
121+
nitrodigest email.txt
122122
```
123123

124124
### Large Files
@@ -147,7 +147,7 @@ Generating summary for csv_docs.md...
147147
### File Not Found
148148

149149
```bash
150-
nitrodigest --input nonexistent.txt
150+
nitrodigest nonexistent.txt
151151
# Error: Input path 'nonexistent.txt' does not exist
152152
```
153153

@@ -156,7 +156,7 @@ nitrodigest --input nonexistent.txt
156156
### Unsupported File Format
157157

158158
```bash
159-
nitrodigest --input image.jpg
159+
nitrodigest image.jpg
160160
# Error processing file 'image.jpg': 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
161161

162162
```
@@ -176,7 +176,7 @@ If processing very large files takes too long:
176176
**File Naming:** Use descriptive filenames to make your summaries more organized:
177177

178178
```bash
179-
nitrodigest --input "2025-05-26_project_update.md" > "2025-05-26_project_summary.md"
179+
nitrodigest "2025-05-26_project_update.md" > "2025-05-26_project_summary.md"
180180
```
181181

182182
**Batch Similar Files:** If you have multiple related files, consider using batch processing instead.

Projects/Nitrodigest/Docs/Guides/Understanding the Output Format.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ After the YAML frontmatter, the actual summary content follows. The format depen
7171
### Single File Processing
7272

7373
```bash
74-
nitrodigest --input document.txt
74+
nitrodigest document.txt
7575
```
7676

7777
**Output:**
@@ -97,7 +97,7 @@ tokens: 156
9797
When processing multiple files, each file gets its own complete output block:
9898
9999
```bash
100-
nitrodigest --input documents/
100+
nitrodigest documents/
101101
```
102102

103103
**Output:**
@@ -139,19 +139,19 @@ tokens: 287
139139
**Single Summary:**
140140
141141
```bash
142-
nitrodigest --input document.txt > summary.md
142+
nitrodigest document.txt > summary.md
143143
```
144144

145145
**Multiple Summaries:**
146146

147147
```bash
148-
nitrodigest --input documents/ > all-summaries.md
148+
nitrodigest documents/ > all-summaries.md
149149
```
150150

151151
**Appending to Existing File:**
152152

153153
```bash
154-
nitrodigest --input new-document.txt >> existing-summaries.md
154+
nitrodigest new-document.txt >> existing-summaries.md
155155
```
156156

157157
## Custom Output Formats

0 commit comments

Comments
 (0)