yaicli 0.0.5__py3-none-any.whl → 0.0.7__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.
@@ -1,244 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: yaicli
3
- Version: 0.0.5
4
- Summary: A simple CLI tool to interact with LLM
5
- License-File: LICENSE
6
- Requires-Python: >=3.9
7
- Requires-Dist: distro>=1.9.0
8
- Requires-Dist: jmespath>=1.0.1
9
- Requires-Dist: prompt-toolkit>=3.0.50
10
- Requires-Dist: requests>=2.32.3
11
- Requires-Dist: rich>=13.9.4
12
- Requires-Dist: typer>=0.15.2
13
- Description-Content-Type: text/markdown
14
-
15
- # YAICLI - Your AI Command Line Interface
16
-
17
- YAICLI is a powerful command-line AI assistant tool that enables you to interact with Large Language Models (LLMs) through your terminal. It offers multiple operation modes for everyday conversations, generating and executing shell commands, and one-shot quick queries.
18
-
19
- ## Features
20
-
21
- - **Multiple Operation Modes**:
22
- - **Chat Mode (💬)**: Interactive conversation with the AI assistant
23
- - **Execute Mode (🚀)**: Generate and execute shell commands specific to your OS and shell
24
- - **Temp Mode**: Quick queries without entering interactive mode
25
-
26
- - **Smart Environment Detection**:
27
- - Automatically detects your operating system and shell
28
- - Customizes responses and commands for your specific environment
29
-
30
- - **Rich Terminal Interface**:
31
- - Markdown rendering for formatted responses
32
- - Streaming responses for real-time feedback
33
- - Color-coded output for better readability
34
-
35
- - **Configurable**:
36
- - Customizable API endpoints
37
- - Support for different LLM providers
38
- - Adjustable response parameters
39
-
40
- - **Keyboard Shortcuts**:
41
- - Tab to switch between Chat and Execute modes
42
-
43
- ## Installation
44
-
45
- ### Prerequisites
46
-
47
- - Python 3.9 or higher
48
- - pip (Python package manager)
49
-
50
- ### Install from PyPI
51
-
52
- ```bash
53
- # Install by pip
54
- pip install yaicli
55
-
56
- # Install by pipx
57
- pipx install yaicli
58
-
59
- # Install by uv
60
- uv tool install yaicli
61
- ```
62
-
63
- ### Install from Source
64
-
65
- ```bash
66
- git clone https://github.com/yourusername/yaicli.git
67
- cd yaicli
68
- pip install .
69
- ```
70
-
71
- ## Configuration
72
-
73
- On first run, YAICLI will create a default configuration file at `~/.config/yaicli/config.ini`. You'll need to edit this file to add your API key and customize other settings.
74
-
75
- Just run `ai`, and it will create the config file for you. Then you can edit it to add your api key.
76
-
77
- ### Configuration File
78
-
79
- ```ini
80
- [core]
81
- BASE_URL=https://api.openai.com/v1
82
- API_KEY=your_api_key_here
83
- MODEL=gpt-4o
84
-
85
- # default run mode, default: temp
86
- # chat: interactive chat mode
87
- # exec: shell command generation mode
88
- # temp: one-shot mode
89
- DEFAULT_MODE=temp
90
-
91
- # auto detect shell and os
92
- SHELL_NAME=auto
93
- OS_NAME=auto
94
-
95
- # if you want to use custom completions path, you can set it here
96
- COMPLETION_PATH=/chat/completions
97
- # if you want to use custom answer path, you can set it here
98
- ANSWER_PATH=choices[0].message.content
99
-
100
- # true: streaming response
101
- # false: non-streaming response
102
- STREAM=true
103
- ```
104
-
105
- ### Configuration Options
106
-
107
- - **BASE_URL**: API endpoint URL (default: OpenAI API)
108
- - **API_KEY**: Your API key for the LLM provider
109
- - **MODEL**: The model to use (e.g., gpt-4o, gpt-3.5-turbo), default: gpt-4o
110
- - **DEFAULT_MODE**: Default operation mode (chat, exec, or temp), default: temp
111
- - **SHELL_NAME**: Shell to use (auto for automatic detection), default: auto
112
- - **OS_NAME**: OS to use (auto for automatic detection), default: auto
113
- - **COMPLETION_PATH**: Path for completions endpoint, default: /chat/completions
114
- - **ANSWER_PATH**: Json path expression to extract answer from response, default: choices[0].message.content
115
- - **STREAM**: Enable/disable streaming responses
116
-
117
- ## Usage
118
-
119
- ### Basic Usage
120
-
121
- ```bash
122
- # One-shot mode
123
- ai "What is the capital of France?"
124
-
125
- # Chat mode
126
- ai --chat
127
-
128
- # Shell command generation mode
129
- ai --shell "Create a backup of my Documents folder"
130
-
131
- # Verbose mode for debugging
132
- ai --verbose "Explain quantum computing"
133
- ```
134
-
135
- ### Command Line Options
136
-
137
- - `<PROMPT>`: Argument
138
- - `--verbose` or `-V`: Show verbose information
139
- - `--chat` or `-c`: Start in chat mode
140
- - `--shell` or `-s`: Generate and execute shell command
141
- - `--install-completion`: Install completion for the current shell
142
- - `--show-completion`: Show completion for the current shell, to copy it or customize the installation
143
- - `--help` or `-h`: Show this message and exit
144
-
145
- ```bash
146
- ai -h
147
-
148
- Usage: ai [OPTIONS] [PROMPT]
149
-
150
- yaicli. Your AI interface in cli.
151
-
152
- ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
153
- │ prompt [PROMPT] The prompt send to the LLM │
154
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
155
- ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
156
- │ --verbose -V Show verbose information │
157
- │ --chat -c Start in chat mode │
158
- │ --shell -s Generate and execute shell command │
159
- │ --install-completion Install completion for the current shell. │
160
- │ --show-completion Show completion for the current shell, to copy it or customize the installation. │
161
- │ --help -h Show this message and exit. │
162
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
163
-
164
-
165
- ```
166
-
167
- ### Interactive Mode
168
-
169
- In interactive mode (chat or shell), you can:
170
- - Type your queries and get responses
171
- - Use `Tab` to switch between Chat and Execute modes
172
- - Type 'exit' or 'quit' to exit
173
-
174
- ### Shell Command Generation
175
-
176
- In Execute mode:
177
- 1. Enter your request in natural language
178
- 2. YAICLI will generate an appropriate shell command
179
- 3. Review the command
180
- 4. Confirm to execute or reject
181
-
182
- ## Examples
183
-
184
- ### Chat Mode Example
185
-
186
- ```bash
187
- $ ai --chat
188
- 💬 > Tell me about the solar system
189
-
190
- Assistant:
191
- Certainly! Here’s a brief overview of the solar system:
192
-
193
- • Sun: The central star of the solar system, providing light and energy.
194
- • Planets:
195
- • Mercury: Closest to the Sun, smallest planet.
196
- • Venus: Second planet, known for its thick atmosphere and high surface temperature.
197
- • Earth: Third planet, the only known planet to support life.
198
- • Mars: Fourth planet, often called the "Red Planet" due to its reddish appearance.
199
- • Jupiter: Largest planet, a gas giant with many moons.
200
- • Saturn: Known for its prominent ring system, also a gas giant.
201
- • Uranus: An ice giant, known for its unique axial tilt.
202
- • Neptune: Another ice giant, known for its deep blue color.
203
- • Dwarf Planets:
204
- • Pluto: Once considered the ninth planet, now classified as
205
-
206
- 💬 >
207
- ```
208
-
209
- ### Execute Mode Example
210
-
211
- ```bash
212
- $ ai --shell "Find all PDF files in my Downloads folder"
213
-
214
- Generated command: find ~/Downloads -type f -name "*.pdf"
215
- Execute this command? [y/n]: y
216
-
217
- Executing command: find ~/Downloads -type f -name "*.pdf"
218
-
219
- /Users/username/Downloads/document1.pdf
220
- /Users/username/Downloads/report.pdf
221
- ...
222
- ```
223
-
224
- ## Technical Implementation
225
-
226
- YAICLI is built using several Python libraries:
227
-
228
- - **Typer**: Provides the command-line interface
229
- - **Rich**: Provides terminal content formatting and beautiful display
230
- - **prompt_toolkit**: Provides interactive command-line input experience
231
- - **requests**: Handles API requests
232
- - **jmespath**: Parses JSON responses
233
-
234
- ## Contributing
235
-
236
- Contributions of code, issue reports, or feature suggestions are welcome.
237
-
238
- ## License
239
-
240
- [Apache License 2.0](LICENSE)
241
-
242
- ---
243
-
244
- *YAICLI - Making your terminal smarter*
@@ -1,6 +0,0 @@
1
- yaicli.py,sha256=5yHKni6bIB2k6xzDAcdr-Xk7KNS7_QKmS9XcN1n9Nrk,21497
2
- yaicli-0.0.5.dist-info/METADATA,sha256=Bx7PwYYH9J99pZIcrkgWhVE8hP3tiB6WGXZgjSw0qi4,9319
3
- yaicli-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- yaicli-0.0.5.dist-info/entry_points.txt,sha256=gdduQwAuu_LeDqnDU81Fv3NPmD2tRQ1FffvolIP3S1Q,34
5
- yaicli-0.0.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
6
- yaicli-0.0.5.dist-info/RECORD,,
File without changes