yaicli 0.5.4__py3-none-any.whl → 0.5.5__py3-none-any.whl
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.
- pyproject.toml +1 -1
- yaicli/cli.py +23 -14
- {yaicli-0.5.4.dist-info → yaicli-0.5.5.dist-info}/METADATA +2 -1
- {yaicli-0.5.4.dist-info → yaicli-0.5.5.dist-info}/RECORD +7 -7
- {yaicli-0.5.4.dist-info → yaicli-0.5.5.dist-info}/WHEEL +0 -0
- {yaicli-0.5.4.dist-info → yaicli-0.5.5.dist-info}/entry_points.txt +0 -0
- {yaicli-0.5.4.dist-info → yaicli-0.5.5.dist-info}/licenses/LICENSE +0 -0
pyproject.toml
CHANGED
yaicli/cli.py
CHANGED
@@ -242,17 +242,21 @@ class CLI:
|
|
242
242
|
# ------------------- Special commands -------------------
|
243
243
|
def _handle_special_commands(self, user_input: str) -> Union[bool, str]:
|
244
244
|
"""Handle special command return: True-continue loop, False-exit loop, str-non-special command"""
|
245
|
-
|
246
|
-
if
|
245
|
+
lower_input = user_input.lower().strip()
|
246
|
+
if lower_input in CMD_HELP:
|
247
|
+
# case-insensitive
|
247
248
|
self.print_help()
|
248
249
|
return True
|
249
|
-
if
|
250
|
+
if lower_input == CMD_EXIT:
|
251
|
+
# case-insensitive
|
250
252
|
return False
|
251
|
-
if
|
253
|
+
if lower_input == CMD_CLEAR and self.current_mode == CHAT_MODE:
|
254
|
+
# case-insensitive
|
252
255
|
self.chat.history.clear()
|
253
256
|
self.console.print("Chat history cleared", style="bold yellow")
|
254
257
|
return True
|
255
|
-
if
|
258
|
+
if lower_input == CMD_HISTORY:
|
259
|
+
# case-insensitive
|
256
260
|
if not self.chat.history:
|
257
261
|
self.console.print("History is empty.", style="yellow")
|
258
262
|
else:
|
@@ -269,15 +273,17 @@ class CLI:
|
|
269
273
|
return True
|
270
274
|
|
271
275
|
# Handle /save command - optional title parameter
|
272
|
-
if
|
273
|
-
|
276
|
+
if lower_input.startswith(CMD_SAVE_CHAT):
|
277
|
+
# Save chat with title from user raw input, case-sensitive
|
278
|
+
parts = user_input.split(maxsplit=1)
|
274
279
|
title = parts[1] if len(parts) > 1 else self.chat.title
|
275
280
|
self._save_chat(title)
|
276
281
|
return True
|
277
282
|
|
278
283
|
# Handle /load command - requires index parameter
|
279
|
-
if
|
280
|
-
|
284
|
+
if lower_input.startswith(CMD_LOAD_CHAT):
|
285
|
+
# Load chat by index from user raw input, case-sensitive
|
286
|
+
parts = user_input.split(maxsplit=1)
|
281
287
|
if len(parts) == 2 and parts[1].isdigit():
|
282
288
|
# Try to parse as an index first
|
283
289
|
self._load_chat_by_index(index=parts[1])
|
@@ -287,8 +293,9 @@ class CLI:
|
|
287
293
|
return True
|
288
294
|
|
289
295
|
# Handle /delete command - requires index parameter
|
290
|
-
if
|
291
|
-
|
296
|
+
if lower_input.startswith(CMD_DELETE_CHAT):
|
297
|
+
# Delete chat by index from user raw input, case-sensitive
|
298
|
+
parts = user_input.split(maxsplit=1)
|
292
299
|
if len(parts) == 2 and parts[1].isdigit():
|
293
300
|
self._delete_chat_by_index(index=parts[1])
|
294
301
|
else:
|
@@ -297,13 +304,15 @@ class CLI:
|
|
297
304
|
return True
|
298
305
|
|
299
306
|
# Handle /list command to list saved chats
|
300
|
-
if
|
307
|
+
if lower_input == CMD_LIST_CHATS:
|
308
|
+
# case-insensitive
|
301
309
|
self._list_chats()
|
302
310
|
return True
|
303
311
|
|
304
312
|
# Handle /mode command
|
305
|
-
if
|
306
|
-
|
313
|
+
if lower_input.startswith(CMD_MODE):
|
314
|
+
# Switch mode by lower user input, case-insensitive
|
315
|
+
parts = lower_input.split(maxsplit=1)
|
307
316
|
if len(parts) == 2 and parts[1] in [CHAT_MODE, EXEC_MODE]:
|
308
317
|
new_mode = parts[1]
|
309
318
|
if self.current_mode != new_mode:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: yaicli
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.5
|
4
4
|
Summary: A simple CLI tool to interact with LLM
|
5
5
|
Project-URL: Homepage, https://github.com/belingud/yaicli
|
6
6
|
Project-URL: Repository, https://github.com/belingud/yaicli
|
@@ -232,6 +232,7 @@ Description-Content-Type: text/markdown
|
|
232
232
|
<img src="artwork/logo.png" width="150" alt="YAICLI Logo" />
|
233
233
|
</p>
|
234
234
|
|
235
|
+
<a href="https://www.producthunt.com/posts/yaicli?embed=true&utm_source=badge-featured&utm_medium=badge&utm_source=badge-yaicli" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=965413&theme=neutral&t=1747386335651" alt="Yaicli - Yaicli: Your AI assistant in the command line. | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
235
236
|
|
236
237
|
[](https://pypi.org/project/yaicli/)
|
237
238
|

|
@@ -1,7 +1,7 @@
|
|
1
|
-
pyproject.toml,sha256=
|
1
|
+
pyproject.toml,sha256=bFPTKVIFeSvLyWCIEZPvU_jtlcuOyrAv55R0XDudNzM,1615
|
2
2
|
yaicli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
yaicli/chat.py,sha256=DeTmOeBPU-oiOAIaDj2h-auJor0GyVVhrViLYF6zGIM,13638
|
4
|
-
yaicli/cli.py,sha256=
|
4
|
+
yaicli/cli.py,sha256=1Flt0FgrKzbabjJpZJCcvnUjXaaLwyD2paRyMixEQV0,22985
|
5
5
|
yaicli/client.py,sha256=fKUDmn9s7tF9Q2wIB8WhbsjFYIpV0E29t_Vw0qVmVbI,16229
|
6
6
|
yaicli/config.py,sha256=_mp8P6zXyrdp4TzBfHraOCkjv5DMZMOwiEhQnFYWwZA,6321
|
7
7
|
yaicli/console.py,sha256=vARPJd-3lafutsQWrGntQVjLrYqaJD3qisN82pmuhjU,1973
|
@@ -17,8 +17,8 @@ yaicli/tools.py,sha256=d-5LXbEB-1Uq5VKSgwlAiNDVOGrHkku2DpmZoorq1zw,3098
|
|
17
17
|
yaicli/utils.py,sha256=bpo3Xhozpxsaci3FtEIKZ32l4ZdyWMsrHjYGX0tB4J4,4541
|
18
18
|
yaicli/functions/__init__.py,sha256=_FJooQ9GkijG8xLwuU0cr5GBrGnC9Nc6bnCeUjrsT0k,1271
|
19
19
|
yaicli/functions/buildin/execute_shell_command.py,sha256=unl1-F8p6QZajeHdA0u5UpURMJM0WhdWMUWCCCHVRcI,1320
|
20
|
-
yaicli-0.5.
|
21
|
-
yaicli-0.5.
|
22
|
-
yaicli-0.5.
|
23
|
-
yaicli-0.5.
|
24
|
-
yaicli-0.5.
|
20
|
+
yaicli-0.5.5.dist-info/METADATA,sha256=xP25HRcZiT53Wqr9w7d6gupEmMxuBQRuTzv8FcMdxwM,49274
|
21
|
+
yaicli-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
22
|
+
yaicli-0.5.5.dist-info/entry_points.txt,sha256=iYVyQP0PJIm9tQnlQheqT435kK_xdGoi5j9aswGV9hA,66
|
23
|
+
yaicli-0.5.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
24
|
+
yaicli-0.5.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|