yaicli 0.0.6__py3-none-any.whl → 0.0.8__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,240 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: yaicli
3
- Version: 0.0.6
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
-
49
- ### Install from PyPI
50
-
51
- ```bash
52
- # Install by pip
53
- pip install yaicli
54
-
55
- # Install by pipx
56
- pipx install yaicli
57
-
58
- # Install by uv
59
- uv tool install yaicli
60
- ```
61
-
62
- ### Install from Source
63
-
64
- ```bash
65
- git clone https://github.com/yourusername/yaicli.git
66
- cd yaicli
67
- pip install .
68
- ```
69
-
70
- ## Configuration
71
-
72
- 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.
73
-
74
- Just run `ai`, and it will create the config file for you. Then you can edit it to add your api key.
75
-
76
- ### Configuration File
77
-
78
- The default configuration file is located at `~/.config/yaicli/config.ini`. Look at the example below:
79
-
80
- ```ini
81
- [core]
82
- BASE_URL=https://api.openai.com/v1
83
- API_KEY=your_api_key_here
84
- MODEL=gpt-4o
85
-
86
- # auto detect shell and os
87
- SHELL_NAME=auto
88
- OS_NAME=auto
89
-
90
- # if you want to use custom completions path, you can set it here
91
- COMPLETION_PATH=/chat/completions
92
- # if you want to use custom answer path, you can set it here
93
- ANSWER_PATH=choices[0].message.content
94
-
95
- # true: streaming response
96
- # false: non-streaming response
97
- STREAM=true
98
- ```
99
-
100
- ### Configuration Options
101
-
102
- Below are the available configuration options and override environment variables:
103
-
104
- - **BASE_URL**: API endpoint URL (default: OpenAI API), env: AI_BASE_URL
105
- - **API_KEY**: Your API key for the LLM provider, env: AI_API_KEY
106
- - **MODEL**: The model to use (e.g., gpt-4o, gpt-3.5-turbo), default: gpt-4o, env: AI_MODEL
107
- - **SHELL_NAME**: Shell to use (auto for automatic detection), default: auto, env: AI_SHELL_NAME
108
- - **OS_NAME**: OS to use (auto for automatic detection), default: auto, env: AI_OS_NAME
109
- - **COMPLETION_PATH**: Path for completions endpoint, default: /chat/completions, env: AI_COMPLETION_PATH
110
- - **ANSWER_PATH**: Json path expression to extract answer from response, default: choices[0].message.content, env: AI_ANSWER_PATH
111
- - **STREAM**: Enable/disable streaming responses, default: true, env: AI_STREAM
112
-
113
- ## Usage
114
-
115
- ### Basic Usage
116
-
117
- ```bash
118
- # One-shot mode
119
- ai "What is the capital of France?"
120
-
121
- # Chat mode
122
- ai --chat
123
-
124
- # Shell command generation mode
125
- ai --shell "Create a backup of my Documents folder"
126
-
127
- # Verbose mode for debugging
128
- ai --verbose "Explain quantum computing"
129
- ```
130
-
131
- ### Command Line Options
132
-
133
- - `<PROMPT>`: Argument
134
- - `--verbose` or `-V`: Show verbose information
135
- - `--chat` or `-c`: Start in chat mode
136
- - `--shell` or `-s`: Generate and execute shell command
137
- - `--install-completion`: Install completion for the current shell
138
- - `--show-completion`: Show completion for the current shell, to copy it or customize the installation
139
- - `--help` or `-h`: Show this message and exit
140
-
141
- ```bash
142
- ai -h
143
-
144
- Usage: ai [OPTIONS] [PROMPT]
145
-
146
- yaicli. Your AI interface in cli.
147
-
148
- ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
149
- │ prompt [PROMPT] The prompt send to the LLM │
150
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
151
- ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
152
- │ --verbose -V Show verbose information │
153
- │ --chat -c Start in chat mode │
154
- │ --shell -s Generate and execute shell command │
155
- │ --install-completion Install completion for the current shell. │
156
- │ --show-completion Show completion for the current shell, to copy it or customize the installation. │
157
- │ --help -h Show this message and exit. │
158
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
159
-
160
-
161
- ```
162
-
163
- ### Interactive Mode
164
-
165
- In interactive mode (chat or shell), you can:
166
- - Type your queries and get responses
167
- - Use `Tab` to switch between Chat and Execute modes
168
- - Type 'exit' or 'quit' to exit
169
-
170
- ### Shell Command Generation
171
-
172
- In Execute mode:
173
- 1. Enter your request in natural language
174
- 2. YAICLI will generate an appropriate shell command
175
- 3. Review the command
176
- 4. Confirm to execute or reject
177
-
178
- ## Examples
179
-
180
- ### Chat Mode Example
181
-
182
- ```bash
183
- $ ai --chat
184
- 💬 > Tell me about the solar system
185
-
186
- Assistant:
187
- Certainly! Here’s a brief overview of the solar system:
188
-
189
- • Sun: The central star of the solar system, providing light and energy.
190
- • Planets:
191
- • Mercury: Closest to the Sun, smallest planet.
192
- • Venus: Second planet, known for its thick atmosphere and high surface temperature.
193
- • Earth: Third planet, the only known planet to support life.
194
- • Mars: Fourth planet, often called the "Red Planet" due to its reddish appearance.
195
- • Jupiter: Largest planet, a gas giant with many moons.
196
- • Saturn: Known for its prominent ring system, also a gas giant.
197
- • Uranus: An ice giant, known for its unique axial tilt.
198
- • Neptune: Another ice giant, known for its deep blue color.
199
- • Dwarf Planets:
200
- • Pluto: Once considered the ninth planet, now classified as
201
-
202
- 💬 >
203
- ```
204
-
205
- ### Execute Mode Example
206
-
207
- ```bash
208
- $ ai --shell "Find all PDF files in my Downloads folder"
209
-
210
- Generated command: find ~/Downloads -type f -name "*.pdf"
211
- Execute this command? [y/n]: y
212
-
213
- Executing command: find ~/Downloads -type f -name "*.pdf"
214
-
215
- /Users/username/Downloads/document1.pdf
216
- /Users/username/Downloads/report.pdf
217
- ...
218
- ```
219
-
220
- ## Technical Implementation
221
-
222
- YAICLI is built using several Python libraries:
223
-
224
- - **Typer**: Provides the command-line interface
225
- - **Rich**: Provides terminal content formatting and beautiful display
226
- - **prompt_toolkit**: Provides interactive command-line input experience
227
- - **requests**: Handles API requests
228
- - **jmespath**: Parses JSON responses
229
-
230
- ## Contributing
231
-
232
- Contributions of code, issue reports, or feature suggestions are welcome.
233
-
234
- ## License
235
-
236
- [Apache License 2.0](LICENSE)
237
-
238
- ---
239
-
240
- *YAICLI - Making your terminal smarter*
@@ -1,6 +0,0 @@
1
- yaicli.py,sha256=2MPLOWjziZ-35bntsP4S82o4bISgijirT0tPHPFAukc,22454
2
- yaicli-0.0.6.dist-info/METADATA,sha256=JwhjqM_qJ_pPzshEEzsetIfJA1FSDpKGbck7FWgBfZI,9416
3
- yaicli-0.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- yaicli-0.0.6.dist-info/entry_points.txt,sha256=gdduQwAuu_LeDqnDU81Fv3NPmD2tRQ1FffvolIP3S1Q,34
5
- yaicli-0.0.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
6
- yaicli-0.0.6.dist-info/RECORD,,
File without changes