termchat-client 0.2.0__tar.gz → 0.2.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.
- {termchat_client-0.2.0/termchat_client.egg-info → termchat_client-0.2.2}/PKG-INFO +26 -6
- {termchat_client-0.2.0 → termchat_client-0.2.2}/README.md +25 -5
- {termchat_client-0.2.0 → termchat_client-0.2.2}/pyproject.toml +2 -1
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/__init__.py +2 -1
- termchat_client-0.2.2/termchat/__pycache__/__init__.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/__main__.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/ai.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/cli.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/client.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/config.cpython-313.pyc +0 -0
- termchat_client-0.2.2/termchat/__pycache__/viewer.cpython-313.pyc +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/cli.py +3 -17
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/config.py +6 -4
- {termchat_client-0.2.0 → termchat_client-0.2.2/termchat_client.egg-info}/PKG-INFO +26 -6
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/SOURCES.txt +7 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/tests/test_config.py +12 -1
- {termchat_client-0.2.0 → termchat_client-0.2.2}/LICENSE +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/MANIFEST.in +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/setup.cfg +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/__main__.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/ai.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/client.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat/viewer.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/dependency_links.txt +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/entry_points.txt +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/requires.txt +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/top_level.txt +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/tests/test_ai.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/tests/test_cli.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/tests/test_server.py +0 -0
- {termchat_client-0.2.0 → termchat_client-0.2.2}/tests/test_viewer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: termchat-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Lightweight, non-intrusive terminal chat client connecting to an online chat server with real-time text, images, and AI assistant.
|
|
5
5
|
Author-email: TermChat Team <info@termchat.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -102,21 +102,41 @@ pip install termchat-client
|
|
|
102
102
|
|
|
103
103
|
---
|
|
104
104
|
|
|
105
|
+
## 🚀 Quickstart (Zero-Config)
|
|
106
|
+
|
|
107
|
+
Because the client comes pre-configured with the live server hosted in Singapore (`https://termchat-live.onrender.com`), you can chat immediately:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install --upgrade termchat-client
|
|
111
|
+
termchat
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or ask the free AI assistant right away:
|
|
115
|
+
```bash
|
|
116
|
+
termchat ai "What is the difference between a process and a thread?"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
105
121
|
## 🚀 Terminal Client Usage
|
|
106
122
|
|
|
107
123
|
### 1. Run via CLI
|
|
108
124
|
```bash
|
|
109
|
-
termchat --
|
|
125
|
+
termchat --name Alice
|
|
126
|
+
```
|
|
127
|
+
Or specify a custom server if self-hosting:
|
|
128
|
+
```bash
|
|
129
|
+
termchat --server https://termchat-live.onrender.com --name Alice
|
|
110
130
|
```
|
|
111
131
|
Or via Python module:
|
|
112
132
|
```bash
|
|
113
|
-
python -m termchat --
|
|
133
|
+
python -m termchat --name Alice
|
|
114
134
|
```
|
|
115
135
|
|
|
116
|
-
### 2. Save Your
|
|
117
|
-
Save your online server URL so you never need to type
|
|
136
|
+
### 2. Save Your Preferences Once
|
|
137
|
+
Save your online server URL or default name so you never need to type them again:
|
|
118
138
|
```bash
|
|
119
|
-
termchat --set-server https://
|
|
139
|
+
termchat --set-server https://termchat-live.onrender.com
|
|
120
140
|
termchat --set-name Alice
|
|
121
141
|
```
|
|
122
142
|
Once saved, simply run:
|
|
@@ -60,21 +60,41 @@ pip install termchat-client
|
|
|
60
60
|
|
|
61
61
|
---
|
|
62
62
|
|
|
63
|
+
## 🚀 Quickstart (Zero-Config)
|
|
64
|
+
|
|
65
|
+
Because the client comes pre-configured with the live server hosted in Singapore (`https://termchat-live.onrender.com`), you can chat immediately:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install --upgrade termchat-client
|
|
69
|
+
termchat
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or ask the free AI assistant right away:
|
|
73
|
+
```bash
|
|
74
|
+
termchat ai "What is the difference between a process and a thread?"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
63
79
|
## 🚀 Terminal Client Usage
|
|
64
80
|
|
|
65
81
|
### 1. Run via CLI
|
|
66
82
|
```bash
|
|
67
|
-
termchat --
|
|
83
|
+
termchat --name Alice
|
|
84
|
+
```
|
|
85
|
+
Or specify a custom server if self-hosting:
|
|
86
|
+
```bash
|
|
87
|
+
termchat --server https://termchat-live.onrender.com --name Alice
|
|
68
88
|
```
|
|
69
89
|
Or via Python module:
|
|
70
90
|
```bash
|
|
71
|
-
python -m termchat --
|
|
91
|
+
python -m termchat --name Alice
|
|
72
92
|
```
|
|
73
93
|
|
|
74
|
-
### 2. Save Your
|
|
75
|
-
Save your online server URL so you never need to type
|
|
94
|
+
### 2. Save Your Preferences Once
|
|
95
|
+
Save your online server URL or default name so you never need to type them again:
|
|
76
96
|
```bash
|
|
77
|
-
termchat --set-server https://
|
|
97
|
+
termchat --set-server https://termchat-live.onrender.com
|
|
78
98
|
termchat --set-name Alice
|
|
79
99
|
```
|
|
80
100
|
Once saved, simply run:
|
|
@@ -4,7 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "termchat-client"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
|
+
|
|
8
9
|
description = "Lightweight, non-intrusive terminal chat client connecting to an online chat server with real-time text, images, and AI assistant."
|
|
9
10
|
|
|
10
11
|
readme = "README.md"
|
|
@@ -3,7 +3,8 @@ termchat - Lightweight, non-intrusive terminal chat client with AI Assistant.
|
|
|
3
3
|
Connects standard terminal input to your online Render/cloud server and receives text, images & AI responses.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
__version__ = "0.2.
|
|
6
|
+
__version__ = "0.2.2"
|
|
7
|
+
|
|
7
8
|
__author__ = "TermChat Contributors"
|
|
8
9
|
__license__ = "MIT"
|
|
9
10
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -10,6 +10,7 @@ from termchat import __version__
|
|
|
10
10
|
from termchat.ai import query_llm
|
|
11
11
|
from termchat.client import start
|
|
12
12
|
from termchat.config import (
|
|
13
|
+
DEFAULT_FALLBACK_SERVER,
|
|
13
14
|
get_saved_ai_key,
|
|
14
15
|
get_saved_server_url,
|
|
15
16
|
get_saved_username,
|
|
@@ -97,23 +98,8 @@ def main():
|
|
|
97
98
|
sys.exit(0)
|
|
98
99
|
|
|
99
100
|
|
|
100
|
-
# Determine server URL
|
|
101
|
-
server_url = args.server or get_saved_server_url()
|
|
102
|
-
if not server_url:
|
|
103
|
-
print("Welcome to termchat!")
|
|
104
|
-
try:
|
|
105
|
-
val = input("Enter your online chat server URL (e.g. https://my-app.onrender.com): ").strip()
|
|
106
|
-
except (KeyboardInterrupt, EOFError):
|
|
107
|
-
print("\nAborted.")
|
|
108
|
-
sys.exit(0)
|
|
109
|
-
|
|
110
|
-
if not val:
|
|
111
|
-
print("Error: A server URL is required.")
|
|
112
|
-
sys.exit(1)
|
|
113
|
-
|
|
114
|
-
set_saved_server_url(val)
|
|
115
|
-
server_url = val
|
|
116
|
-
print(f"Server saved to ~/.termchat.json. Next time you can just type 'termchat'!\n")
|
|
101
|
+
# Determine server URL (defaults directly to live Singapore Render server)
|
|
102
|
+
server_url = (args.server or get_saved_server_url() or DEFAULT_FALLBACK_SERVER).strip()
|
|
117
103
|
|
|
118
104
|
# Determine username
|
|
119
105
|
username = args.name or get_saved_username()
|
|
@@ -10,7 +10,8 @@ from pathlib import Path
|
|
|
10
10
|
from typing import Dict, Optional
|
|
11
11
|
|
|
12
12
|
CONFIG_FILE = Path.home() / ".termchat.json"
|
|
13
|
-
DEFAULT_FALLBACK_SERVER = "
|
|
13
|
+
DEFAULT_FALLBACK_SERVER = "https://termchat-live.onrender.com"
|
|
14
|
+
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def load_config() -> Dict[str, str]:
|
|
@@ -33,8 +34,8 @@ def save_config(config: Dict[str, str]):
|
|
|
33
34
|
print(f"[Warning] Could not save config file: {e}")
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
def get_saved_server_url() ->
|
|
37
|
-
"""Retrieves server URL from ENV, config file, or
|
|
37
|
+
def get_saved_server_url() -> str:
|
|
38
|
+
"""Retrieves server URL from ENV, config file, or falls back to DEFAULT_FALLBACK_SERVER."""
|
|
38
39
|
# 1. Environment variable takes highest priority
|
|
39
40
|
env_url = os.environ.get("TERMCHAT_SERVER")
|
|
40
41
|
if env_url:
|
|
@@ -45,7 +46,8 @@ def get_saved_server_url() -> Optional[str]:
|
|
|
45
46
|
if "server" in cfg and cfg["server"]:
|
|
46
47
|
return cfg["server"].strip()
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
# 3. Default to public online Render server (Singapore)
|
|
50
|
+
return DEFAULT_FALLBACK_SERVER
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
def set_saved_server_url(url: str):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: termchat-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Lightweight, non-intrusive terminal chat client connecting to an online chat server with real-time text, images, and AI assistant.
|
|
5
5
|
Author-email: TermChat Team <info@termchat.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -102,21 +102,41 @@ pip install termchat-client
|
|
|
102
102
|
|
|
103
103
|
---
|
|
104
104
|
|
|
105
|
+
## 🚀 Quickstart (Zero-Config)
|
|
106
|
+
|
|
107
|
+
Because the client comes pre-configured with the live server hosted in Singapore (`https://termchat-live.onrender.com`), you can chat immediately:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install --upgrade termchat-client
|
|
111
|
+
termchat
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or ask the free AI assistant right away:
|
|
115
|
+
```bash
|
|
116
|
+
termchat ai "What is the difference between a process and a thread?"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
105
121
|
## 🚀 Terminal Client Usage
|
|
106
122
|
|
|
107
123
|
### 1. Run via CLI
|
|
108
124
|
```bash
|
|
109
|
-
termchat --
|
|
125
|
+
termchat --name Alice
|
|
126
|
+
```
|
|
127
|
+
Or specify a custom server if self-hosting:
|
|
128
|
+
```bash
|
|
129
|
+
termchat --server https://termchat-live.onrender.com --name Alice
|
|
110
130
|
```
|
|
111
131
|
Or via Python module:
|
|
112
132
|
```bash
|
|
113
|
-
python -m termchat --
|
|
133
|
+
python -m termchat --name Alice
|
|
114
134
|
```
|
|
115
135
|
|
|
116
|
-
### 2. Save Your
|
|
117
|
-
Save your online server URL so you never need to type
|
|
136
|
+
### 2. Save Your Preferences Once
|
|
137
|
+
Save your online server URL or default name so you never need to type them again:
|
|
118
138
|
```bash
|
|
119
|
-
termchat --set-server https://
|
|
139
|
+
termchat --set-server https://termchat-live.onrender.com
|
|
120
140
|
termchat --set-name Alice
|
|
121
141
|
```
|
|
122
142
|
Once saved, simply run:
|
|
@@ -9,6 +9,13 @@ termchat/cli.py
|
|
|
9
9
|
termchat/client.py
|
|
10
10
|
termchat/config.py
|
|
11
11
|
termchat/viewer.py
|
|
12
|
+
termchat/__pycache__/__init__.cpython-313.pyc
|
|
13
|
+
termchat/__pycache__/__main__.cpython-313.pyc
|
|
14
|
+
termchat/__pycache__/ai.cpython-313.pyc
|
|
15
|
+
termchat/__pycache__/cli.cpython-313.pyc
|
|
16
|
+
termchat/__pycache__/client.cpython-313.pyc
|
|
17
|
+
termchat/__pycache__/config.cpython-313.pyc
|
|
18
|
+
termchat/__pycache__/viewer.cpython-313.pyc
|
|
12
19
|
termchat_client.egg-info/PKG-INFO
|
|
13
20
|
termchat_client.egg-info/SOURCES.txt
|
|
14
21
|
termchat_client.egg-info/dependency_links.txt
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
from termchat.config import
|
|
1
|
+
from termchat.config import (
|
|
2
|
+
DEFAULT_FALLBACK_SERVER,
|
|
3
|
+
get_saved_server_url,
|
|
4
|
+
normalize_urls,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_get_saved_server_url_default(monkeypatch):
|
|
9
|
+
monkeypatch.delenv("TERMCHAT_SERVER", raising=False)
|
|
10
|
+
monkeypatch.setattr("termchat.config.load_config", lambda: {})
|
|
11
|
+
assert get_saved_server_url() == DEFAULT_FALLBACK_SERVER
|
|
12
|
+
assert "termchat-live.onrender.com" in get_saved_server_url()
|
|
2
13
|
|
|
3
14
|
|
|
4
15
|
def test_normalize_urls_https():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{termchat_client-0.2.0 → termchat_client-0.2.2}/termchat_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|