ngpt 3.5.1__tar.gz → 3.5.3__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.
Files changed (58) hide show
  1. {ngpt-3.5.1 → ngpt-3.5.3}/PKG-INFO +6 -6
  2. {ngpt-3.5.1 → ngpt-3.5.3}/README.md +5 -5
  3. {ngpt-3.5.1 → ngpt-3.5.3}/docs/examples/basic.md +2 -0
  4. {ngpt-3.5.1 → ngpt-3.5.3}/docs/index.md +2 -0
  5. {ngpt-3.5.1 → ngpt-3.5.3}/docs/overview.md +2 -0
  6. {ngpt-3.5.1 → ngpt-3.5.3}/docs/usage/cli_config.md +2 -0
  7. {ngpt-3.5.1 → ngpt-3.5.3}/docs/usage/cli_usage.md +2 -0
  8. {ngpt-3.5.1 → ngpt-3.5.3}/docs/usage/gitcommsg.md +2 -0
  9. {ngpt-3.5.1 → ngpt-3.5.3}/docs/usage/web_search.md +2 -0
  10. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/chat.py +25 -2
  11. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/code.py +72 -3
  12. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/interactive.py +25 -3
  13. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/rewrite.py +25 -2
  14. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/shell.py +25 -2
  15. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/text.py +25 -2
  16. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/utils/web_search.py +2 -2
  17. ngpt-3.5.3/previews/ngpt-g.png +0 -0
  18. ngpt-3.5.3/previews/ngpt-i.png +0 -0
  19. ngpt-3.5.3/previews/ngpt-s-c.png +0 -0
  20. ngpt-3.5.3/previews/ngpt-sh-c-a.png +0 -0
  21. ngpt-3.5.3/previews/ngpt-w-self.png +0 -0
  22. ngpt-3.5.3/previews/ngpt-w.png +0 -0
  23. {ngpt-3.5.1 → ngpt-3.5.3}/pyproject.toml +1 -1
  24. {ngpt-3.5.1 → ngpt-3.5.3}/uv.lock +1 -1
  25. {ngpt-3.5.1 → ngpt-3.5.3}/wiki.md +4 -4
  26. {ngpt-3.5.1 → ngpt-3.5.3}/.github/workflows/aur-publish.yml +0 -0
  27. {ngpt-3.5.1 → ngpt-3.5.3}/.github/workflows/python-publish.yml +0 -0
  28. {ngpt-3.5.1 → ngpt-3.5.3}/.gitignore +0 -0
  29. {ngpt-3.5.1 → ngpt-3.5.3}/.python-version +0 -0
  30. {ngpt-3.5.1 → ngpt-3.5.3}/COMMIT_GUIDELINES.md +0 -0
  31. {ngpt-3.5.1 → ngpt-3.5.3}/CONTRIBUTING.md +0 -0
  32. {ngpt-3.5.1 → ngpt-3.5.3}/LICENSE +0 -0
  33. {ngpt-3.5.1 → ngpt-3.5.3}/PKGBUILD +0 -0
  34. {ngpt-3.5.1 → ngpt-3.5.3}/docs/CONTRIBUTING.md +0 -0
  35. {ngpt-3.5.1 → ngpt-3.5.3}/docs/LICENSE.md +0 -0
  36. {ngpt-3.5.1 → ngpt-3.5.3}/docs/_config.yml +0 -0
  37. {ngpt-3.5.1 → ngpt-3.5.3}/docs/_sass/custom/custom.scss +0 -0
  38. {ngpt-3.5.1 → ngpt-3.5.3}/docs/configuration.md +0 -0
  39. {ngpt-3.5.1 → ngpt-3.5.3}/docs/examples/advanced.md +0 -0
  40. {ngpt-3.5.1 → ngpt-3.5.3}/docs/examples.md +0 -0
  41. {ngpt-3.5.1 → ngpt-3.5.3}/docs/installation.md +0 -0
  42. {ngpt-3.5.1 → ngpt-3.5.3}/docs/usage.md +0 -0
  43. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/__init__.py +0 -0
  44. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/__main__.py +0 -0
  45. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/__init__.py +0 -0
  46. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/args.py +0 -0
  47. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/config_manager.py +0 -0
  48. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/formatters.py +0 -0
  49. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/main.py +0 -0
  50. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/__init__.py +0 -0
  51. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/modes/gitcommsg.py +0 -0
  52. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/renderers.py +0 -0
  53. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/cli/ui.py +0 -0
  54. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/client.py +0 -0
  55. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/utils/__init__.py +0 -0
  56. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/utils/cli_config.py +0 -0
  57. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/utils/config.py +0 -0
  58. {ngpt-3.5.1 → ngpt-3.5.3}/ngpt/utils/log.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 3.5.1
3
+ Version: 3.5.3
4
4
  Summary: Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -45,16 +45,16 @@ Description-Content-Type: text/markdown
45
45
  </p>
46
46
 
47
47
  <p align="center">
48
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
49
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
50
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
51
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
48
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
49
+ <a href="https://nazdridoy.github.io/ngpt/installation/#windows"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
50
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
51
+ <a href="https://nazdridoy.github.io/ngpt/installation/#android-termux"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
52
52
  </p>
53
53
 
54
54
  🤖 nGPT: A Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands. Fast, lightweight, and designed for both casual users and developers.
55
55
 
56
56
 
57
- ![2025-04-23_16-18-01](https://github.com/user-attachments/assets/b8e58926-5165-4352-b48b-9f4a982da86e)
57
+ ![ngpt-i](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-i.png)
58
58
 
59
59
 
60
60
  ## Features
@@ -8,16 +8,16 @@
8
8
  </p>
9
9
 
10
10
  <p align="center">
11
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
12
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
13
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
14
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
11
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
12
+ <a href="https://nazdridoy.github.io/ngpt/installation/#windows"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
13
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
14
+ <a href="https://nazdridoy.github.io/ngpt/installation/#android-termux"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
15
15
  </p>
16
16
 
17
17
  🤖 nGPT: A Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands. Fast, lightweight, and designed for both casual users and developers.
18
18
 
19
19
 
20
- ![2025-04-23_16-18-01](https://github.com/user-attachments/assets/b8e58926-5165-4352-b48b-9f4a982da86e)
20
+ ![ngpt-i](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-i.png)
21
21
 
22
22
 
23
23
  ## Features
@@ -10,6 +10,8 @@ permalink: /examples/basic/
10
10
 
11
11
  This page provides practical examples of common nGPT usage patterns. These examples demonstrate the basic capabilities and how to use the most frequent commands.
12
12
 
13
+ ![ngpt-s-c](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-s-c.png)
14
+
13
15
  ## Chat Examples
14
16
 
15
17
  ### Simple Question and Answer
@@ -26,6 +26,8 @@ Welcome to the nGPT documentation. This guide will help you get started with nGP
26
26
  - [License](LICENSE.md)
27
27
 
28
28
 
29
+ ![ngpt-i](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-i.png)
30
+
29
31
  ## What is nGPT?
30
32
 
31
33
  nGPT is a versatile command-line tool designed to interact with AI language models through various APIs. It provides a seamless interface for generating text, code, shell commands, and more, all from your terminal.
@@ -11,6 +11,8 @@ permalink: /overview/
11
11
 
12
12
  nGPT is a Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands. Fast, lightweight, and designed for both casual users and developers.
13
13
 
14
+ ![ngpt-w-self](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-w-self.png)
15
+
14
16
  ## Key Features
15
17
 
16
18
  - **Versatile**: Powerful and easy-to-use CLI tool for various AI tasks
@@ -10,6 +10,8 @@ permalink: /usage/cli_config/
10
10
 
11
11
  nGPT offers a CLI configuration system that allows you to set persistent default values for command-line options. This guide explains how to use and manage CLI configurations.
12
12
 
13
+ ![ngpt-sh-c-a](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-sh-c-a.png)
14
+
13
15
  ## Overview
14
16
 
15
17
  The CLI configuration system is separate from your API configuration (which stores API keys, base URLs, and models). Instead, it stores your preferred default values for CLI parameters like `temperature`, `language`, or `renderer`.
@@ -10,6 +10,8 @@ permalink: /usage/cli_usage/
10
10
 
11
11
  This guide provides comprehensive documentation on how to use nGPT as a command-line interface (CLI) tool.
12
12
 
13
+ ![ngpt-s-c](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-s-c.png)
14
+
13
15
  ## Basic Usage
14
16
 
15
17
  The most basic way to use nGPT from the command line is to provide a prompt:
@@ -10,6 +10,8 @@ permalink: /usage/gitcommsg/
10
10
 
11
11
  nGPT offers a powerful feature for automatically generating conventional, detailed commit messages from git diffs. This guide explains how to use and customize this functionality.
12
12
 
13
+ ![ngpt-g](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-g.png)
14
+
13
15
  ## Overview
14
16
 
15
17
  The git commit message generation feature (`-g` or `--gitcommsg` flag) analyzes your staged changes (or a provided diff file) and generates a comprehensive commit message following the [Conventional Commits](https://www.conventionalcommits.org/) format.
@@ -15,6 +15,8 @@ nGPT includes a powerful web search capability that enhances your prompts with r
15
15
  - Providing context for questions about current events
16
16
  - Fact-checking and verification
17
17
 
18
+ ![ngpt-w](https://raw.githubusercontent.com/nazdridoy/ngpt/main/previews/ngpt-w.png)
19
+
18
20
  ## Using Web Search
19
21
 
20
22
  To enable web search in nGPT, use the `--web-search` or `--web` flag:
@@ -59,8 +59,31 @@ def chat_mode(client, args, logger=None):
59
59
  if args.web_search:
60
60
  try:
61
61
  original_prompt = prompt
62
- prompt = enhance_prompt_with_web_search(prompt, logger=logger)
63
- print("Enhanced input with web search results.")
62
+
63
+ # Start spinner for web search
64
+ stop_spinner = threading.Event()
65
+ spinner_thread = threading.Thread(
66
+ target=spinner,
67
+ args=("Searching the web for information...",),
68
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
69
+ )
70
+ spinner_thread.daemon = True
71
+ spinner_thread.start()
72
+
73
+ try:
74
+ prompt = enhance_prompt_with_web_search(prompt, logger=logger)
75
+ # Stop the spinner
76
+ stop_spinner.set()
77
+ spinner_thread.join()
78
+ # Clear the spinner line completely
79
+ sys.stdout.write("\r" + " " * 100 + "\r")
80
+ sys.stdout.flush()
81
+ print("Enhanced input with web search results.")
82
+ except Exception as e:
83
+ # Stop the spinner before re-raising
84
+ stop_spinner.set()
85
+ spinner_thread.join()
86
+ raise e
64
87
 
65
88
  # Log the enhanced prompt if logging is enabled
66
89
  if logger:
@@ -4,6 +4,29 @@ from ..ui import spinner
4
4
  from ...utils import enhance_prompt_with_web_search
5
5
  import sys
6
6
  import threading
7
+ import platform
8
+
9
+ def get_terminal_input():
10
+ """Get input from terminal in a cross-platform way, even when stdin is redirected."""
11
+ if platform.system() == 'Windows':
12
+ # Windows-specific solution
13
+ try:
14
+ import msvcrt
15
+ sys.stdout.flush()
16
+ # Wait for a keypress
17
+ char = msvcrt.getch().decode('utf-8').lower()
18
+ print(char) # Echo the character
19
+ return char
20
+ except ImportError:
21
+ # Fallback if msvcrt is not available
22
+ return None
23
+ else:
24
+ # Unix-like systems (Linux, macOS)
25
+ try:
26
+ with open('/dev/tty', 'r') as tty:
27
+ return tty.readline().strip().lower()
28
+ except (IOError, OSError):
29
+ return None
7
30
 
8
31
  # System prompt for code generation with markdown formatting
9
32
  CODE_SYSTEM_PROMPT_MARKDOWN = """Your Role: Provide only code as output without any description with proper markdown formatting.
@@ -105,8 +128,31 @@ def code_mode(client, args, logger=None):
105
128
  if args.web_search:
106
129
  try:
107
130
  original_prompt = prompt
108
- prompt = enhance_prompt_with_web_search(prompt, logger=logger, disable_citations=True)
109
- print("Enhanced input with web search results.")
131
+
132
+ # Start spinner for web search
133
+ stop_spinner = threading.Event()
134
+ spinner_thread = threading.Thread(
135
+ target=spinner,
136
+ args=("Searching the web for information...",),
137
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
138
+ )
139
+ spinner_thread.daemon = True
140
+ spinner_thread.start()
141
+
142
+ try:
143
+ prompt = enhance_prompt_with_web_search(prompt, logger=logger, disable_citations=True)
144
+ # Stop the spinner
145
+ stop_spinner.set()
146
+ spinner_thread.join()
147
+ # Clear the spinner line completely
148
+ sys.stdout.write("\r" + " " * 100 + "\r")
149
+ sys.stdout.flush()
150
+ print("Enhanced input with web search results.")
151
+ except Exception as e:
152
+ # Stop the spinner before re-raising
153
+ stop_spinner.set()
154
+ spinner_thread.join()
155
+ raise e
110
156
 
111
157
  # Log the enhanced prompt if logging is enabled
112
158
  if logger:
@@ -275,4 +321,27 @@ def code_mode(client, args, logger=None):
275
321
  prettify_markdown(generated_code, args.renderer)
276
322
  else:
277
323
  # Should only happen if --no-stream was used without prettify
278
- print(f"\nGenerated code:\n{generated_code}")
324
+ print(f"\nGenerated code:\n{generated_code}")
325
+
326
+ # Offer to copy to clipboard if not in a redirected output
327
+ if generated_code and not args.no_stream and sys.stdout.isatty():
328
+ try:
329
+ # Make sure to flush output before asking for input
330
+ # Make the prompt more visible with colors and formatting
331
+ clipboard_prompt = f"{COLORS['cyan']}{COLORS['bold']}Copy to clipboard? (y/n){COLORS['reset']} "
332
+ print(clipboard_prompt, end="")
333
+ sys.stdout.flush()
334
+
335
+ # Cross-platform terminal input
336
+ answer = get_terminal_input()
337
+
338
+ if answer == 'y':
339
+ try:
340
+ import pyperclip
341
+ pyperclip.copy(generated_code)
342
+ print(f"{COLORS['green']}Copied to clipboard.{COLORS['reset']}")
343
+ except ImportError:
344
+ print(f"{COLORS['yellow']}pyperclip not installed. Try: pip install \"ngpt[clipboard]\" {COLORS['reset']}")
345
+
346
+ except (KeyboardInterrupt, EOFError):
347
+ pass
@@ -6,6 +6,7 @@ import sys
6
6
  import time
7
7
  from ..formatters import COLORS
8
8
  from ..renderers import prettify_markdown, prettify_streaming_markdown
9
+ from ..ui import spinner
9
10
  from ...utils import enhance_prompt_with_web_search
10
11
 
11
12
  # Optional imports for enhanced UI
@@ -198,9 +199,30 @@ def interactive_chat_session(client, web_search=False, no_stream=False, temperat
198
199
  enhanced_prompt = user_input
199
200
  if web_search:
200
201
  try:
201
- print(f"{COLORS['cyan']}Searching the web...{COLORS['reset']}")
202
- enhanced_prompt = enhance_prompt_with_web_search(user_input, logger=logger)
203
- print(f"{COLORS['green']}Enhanced input with web search results.{COLORS['reset']}")
202
+ # Start spinner for web search
203
+ stop_spinner = threading.Event()
204
+ spinner_thread = threading.Thread(
205
+ target=spinner,
206
+ args=("Searching the web for information...",),
207
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
208
+ )
209
+ spinner_thread.daemon = True
210
+ spinner_thread.start()
211
+
212
+ try:
213
+ enhanced_prompt = enhance_prompt_with_web_search(user_input, logger=logger)
214
+ # Stop the spinner
215
+ stop_spinner.set()
216
+ spinner_thread.join()
217
+ # Clear the spinner line completely
218
+ sys.stdout.write("\r" + " " * shutil.get_terminal_size().columns + "\r")
219
+ sys.stdout.flush()
220
+ print(f"{COLORS['green']}Enhanced input with web search results.{COLORS['reset']}")
221
+ except Exception as e:
222
+ # Stop the spinner before re-raising
223
+ stop_spinner.set()
224
+ spinner_thread.join()
225
+ raise e
204
226
 
205
227
  # Update the user message in conversation with enhanced prompt
206
228
  for i in range(len(conversation) - 1, -1, -1):
@@ -130,8 +130,31 @@ def rewrite_mode(client, args, logger=None):
130
130
  if args.web_search:
131
131
  try:
132
132
  original_text = input_text
133
- input_text = enhance_prompt_with_web_search(input_text, logger=logger)
134
- print("Enhanced input with web search results.")
133
+
134
+ # Start spinner for web search
135
+ stop_spinner = threading.Event()
136
+ spinner_thread = threading.Thread(
137
+ target=spinner,
138
+ args=("Searching the web for information...",),
139
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
140
+ )
141
+ spinner_thread.daemon = True
142
+ spinner_thread.start()
143
+
144
+ try:
145
+ input_text = enhance_prompt_with_web_search(input_text, logger=logger)
146
+ # Stop the spinner
147
+ stop_spinner.set()
148
+ spinner_thread.join()
149
+ # Clear the spinner line completely
150
+ sys.stdout.write("\r" + " " * 100 + "\r")
151
+ sys.stdout.flush()
152
+ print("Enhanced input with web search results.")
153
+ except Exception as e:
154
+ # Stop the spinner before re-raising
155
+ stop_spinner.set()
156
+ spinner_thread.join()
157
+ raise e
135
158
 
136
159
  # Log the enhanced input if logging is enabled
137
160
  if logger:
@@ -60,8 +60,31 @@ def shell_mode(client, args, logger=None):
60
60
  if args.web_search:
61
61
  try:
62
62
  original_prompt = prompt
63
- prompt = enhance_prompt_with_web_search(prompt, logger=logger, disable_citations=True)
64
- print("Enhanced input with web search results.")
63
+
64
+ # Start spinner for web search
65
+ stop_spinner = threading.Event()
66
+ spinner_thread = threading.Thread(
67
+ target=spinner,
68
+ args=("Searching the web for information...",),
69
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
70
+ )
71
+ spinner_thread.daemon = True
72
+ spinner_thread.start()
73
+
74
+ try:
75
+ prompt = enhance_prompt_with_web_search(prompt, logger=logger, disable_citations=True)
76
+ # Stop the spinner
77
+ stop_spinner.set()
78
+ spinner_thread.join()
79
+ # Clear the spinner line completely
80
+ sys.stdout.write("\r" + " " * 100 + "\r")
81
+ sys.stdout.flush()
82
+ print("Enhanced input with web search results.")
83
+ except Exception as e:
84
+ # Stop the spinner before re-raising
85
+ stop_spinner.set()
86
+ spinner_thread.join()
87
+ raise e
65
88
 
66
89
  # Log the enhanced prompt if logging is enabled
67
90
  if logger:
@@ -30,8 +30,31 @@ def text_mode(client, args, logger=None):
30
30
  if args.web_search:
31
31
  try:
32
32
  original_prompt = prompt
33
- prompt = enhance_prompt_with_web_search(prompt, logger=logger)
34
- print("Enhanced input with web search results.")
33
+
34
+ # Start spinner for web search
35
+ stop_spinner = threading.Event()
36
+ spinner_thread = threading.Thread(
37
+ target=spinner,
38
+ args=("Searching the web for information...",),
39
+ kwargs={"stop_event": stop_spinner, "color": COLORS['cyan']}
40
+ )
41
+ spinner_thread.daemon = True
42
+ spinner_thread.start()
43
+
44
+ try:
45
+ prompt = enhance_prompt_with_web_search(prompt, logger=logger)
46
+ # Stop the spinner
47
+ stop_spinner.set()
48
+ spinner_thread.join()
49
+ # Clear the spinner line completely
50
+ sys.stdout.write("\r" + " " * 100 + "\r")
51
+ sys.stdout.flush()
52
+ print("Enhanced input with web search results.")
53
+ except Exception as e:
54
+ # Stop the spinner before re-raising
55
+ stop_spinner.set()
56
+ spinner_thread.join()
57
+ raise e
35
58
 
36
59
  # Log the enhanced prompt if logging is enabled
37
60
  if logger:
@@ -31,10 +31,10 @@ def get_logger():
31
31
  if _logger is not None:
32
32
  return _logger
33
33
  else:
34
- # Default logging to stderr if no logger provided, but only for errors
34
+ # Default logging behavior - suppress all messages to console
35
35
  class DefaultLogger:
36
36
  def info(self, msg): pass # Suppress INFO messages
37
- def error(self, msg): print(f"ERROR: {msg}", file=sys.stderr)
37
+ def error(self, msg): pass # Suppress ERROR messages instead of printing to stderr
38
38
  def warning(self, msg): pass # Suppress WARNING messages
39
39
  def debug(self, msg): pass
40
40
  return DefaultLogger()
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ngpt"
3
- version = "3.5.1"
3
+ version = "3.5.3"
4
4
  description = "Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands."
5
5
  authors = [
6
6
  {name = "nazDridoy", email = "nazdridoy399@gmail.com"},
@@ -148,7 +148,7 @@ wheels = [
148
148
 
149
149
  [[package]]
150
150
  name = "ngpt"
151
- version = "3.5.1"
151
+ version = "3.5.3"
152
152
  source = { editable = "." }
153
153
  dependencies = [
154
154
  { name = "beautifulsoup4" },
@@ -93,8 +93,8 @@ ngpt -i
93
93
  </p>
94
94
 
95
95
  <p align="center">
96
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
97
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
98
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
99
- <a href="https://nazdridoy.github.io/ngpt/installation/"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
96
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/Linux-support-blue?logo=linux" alt="Linux"></a>
97
+ <a href="https://nazdridoy.github.io/ngpt/installation/#windows"><img src="https://img.shields.io/badge/Windows-support-blue?logo=windows" alt="Windows"></a>
98
+ <a href="https://nazdridoy.github.io/ngpt/installation/#linuxmacos"><img src="https://img.shields.io/badge/macOS-support-blue?logo=apple" alt="macOS"></a>
99
+ <a href="https://nazdridoy.github.io/ngpt/installation/#android-termux"><img src="https://img.shields.io/badge/Android-Termux-blue?logo=android" alt="Android"></a>
100
100
  </p>
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes