ngpt 3.5.2__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.2 → ngpt-3.5.3}/PKG-INFO +2 -2
  2. {ngpt-3.5.2 → ngpt-3.5.3}/README.md +1 -1
  3. {ngpt-3.5.2 → ngpt-3.5.3}/docs/examples/basic.md +2 -0
  4. {ngpt-3.5.2 → ngpt-3.5.3}/docs/index.md +2 -0
  5. {ngpt-3.5.2 → ngpt-3.5.3}/docs/overview.md +2 -0
  6. {ngpt-3.5.2 → ngpt-3.5.3}/docs/usage/cli_config.md +2 -0
  7. {ngpt-3.5.2 → ngpt-3.5.3}/docs/usage/cli_usage.md +2 -0
  8. {ngpt-3.5.2 → ngpt-3.5.3}/docs/usage/gitcommsg.md +2 -0
  9. {ngpt-3.5.2 → ngpt-3.5.3}/docs/usage/web_search.md +2 -0
  10. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/code.py +47 -1
  11. ngpt-3.5.3/previews/ngpt-g.png +0 -0
  12. ngpt-3.5.3/previews/ngpt-i.png +0 -0
  13. ngpt-3.5.3/previews/ngpt-s-c.png +0 -0
  14. ngpt-3.5.3/previews/ngpt-sh-c-a.png +0 -0
  15. ngpt-3.5.3/previews/ngpt-w-self.png +0 -0
  16. ngpt-3.5.3/previews/ngpt-w.png +0 -0
  17. {ngpt-3.5.2 → ngpt-3.5.3}/pyproject.toml +1 -1
  18. {ngpt-3.5.2 → ngpt-3.5.3}/uv.lock +1 -1
  19. {ngpt-3.5.2 → ngpt-3.5.3}/.github/workflows/aur-publish.yml +0 -0
  20. {ngpt-3.5.2 → ngpt-3.5.3}/.github/workflows/python-publish.yml +0 -0
  21. {ngpt-3.5.2 → ngpt-3.5.3}/.gitignore +0 -0
  22. {ngpt-3.5.2 → ngpt-3.5.3}/.python-version +0 -0
  23. {ngpt-3.5.2 → ngpt-3.5.3}/COMMIT_GUIDELINES.md +0 -0
  24. {ngpt-3.5.2 → ngpt-3.5.3}/CONTRIBUTING.md +0 -0
  25. {ngpt-3.5.2 → ngpt-3.5.3}/LICENSE +0 -0
  26. {ngpt-3.5.2 → ngpt-3.5.3}/PKGBUILD +0 -0
  27. {ngpt-3.5.2 → ngpt-3.5.3}/docs/CONTRIBUTING.md +0 -0
  28. {ngpt-3.5.2 → ngpt-3.5.3}/docs/LICENSE.md +0 -0
  29. {ngpt-3.5.2 → ngpt-3.5.3}/docs/_config.yml +0 -0
  30. {ngpt-3.5.2 → ngpt-3.5.3}/docs/_sass/custom/custom.scss +0 -0
  31. {ngpt-3.5.2 → ngpt-3.5.3}/docs/configuration.md +0 -0
  32. {ngpt-3.5.2 → ngpt-3.5.3}/docs/examples/advanced.md +0 -0
  33. {ngpt-3.5.2 → ngpt-3.5.3}/docs/examples.md +0 -0
  34. {ngpt-3.5.2 → ngpt-3.5.3}/docs/installation.md +0 -0
  35. {ngpt-3.5.2 → ngpt-3.5.3}/docs/usage.md +0 -0
  36. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/__init__.py +0 -0
  37. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/__main__.py +0 -0
  38. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/__init__.py +0 -0
  39. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/args.py +0 -0
  40. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/config_manager.py +0 -0
  41. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/formatters.py +0 -0
  42. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/main.py +0 -0
  43. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/__init__.py +0 -0
  44. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/chat.py +0 -0
  45. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/gitcommsg.py +0 -0
  46. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/interactive.py +0 -0
  47. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/rewrite.py +0 -0
  48. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/shell.py +0 -0
  49. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/modes/text.py +0 -0
  50. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/renderers.py +0 -0
  51. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/cli/ui.py +0 -0
  52. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/client.py +0 -0
  53. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/utils/__init__.py +0 -0
  54. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/utils/cli_config.py +0 -0
  55. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/utils/config.py +0 -0
  56. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/utils/log.py +0 -0
  57. {ngpt-3.5.2 → ngpt-3.5.3}/ngpt/utils/web_search.py +0 -0
  58. {ngpt-3.5.2 → ngpt-3.5.3}/wiki.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 3.5.2
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
@@ -54,7 +54,7 @@ Description-Content-Type: text/markdown
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
@@ -17,7 +17,7 @@
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:
@@ -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.
@@ -298,4 +321,27 @@ def code_mode(client, args, logger=None):
298
321
  prettify_markdown(generated_code, args.renderer)
299
322
  else:
300
323
  # Should only happen if --no-stream was used without prettify
301
- 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
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.2"
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.2"
151
+ version = "3.5.3"
152
152
  source = { editable = "." }
153
153
  dependencies = [
154
154
  { name = "beautifulsoup4" },
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes