janito 2.3.0__py3-none-any.whl → 2.4.0__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.
Files changed (150) hide show
  1. janito/__init__.py +6 -6
  2. janito/_version.py +57 -0
  3. janito/agent/setup_agent.py +92 -18
  4. janito/agent/templates/profiles/system_prompt_template_developer.txt.j2 +44 -0
  5. janito/cli/chat_mode/bindings.py +21 -2
  6. janito/cli/chat_mode/chat_entry.py +2 -3
  7. janito/cli/chat_mode/prompt_style.py +5 -0
  8. janito/cli/chat_mode/session.py +80 -94
  9. janito/cli/chat_mode/session_profile_select.py +80 -0
  10. janito/cli/chat_mode/shell/autocomplete.py +21 -21
  11. janito/cli/chat_mode/shell/commands/__init__.py +13 -7
  12. janito/cli/chat_mode/shell/commands/_priv_check.py +5 -0
  13. janito/cli/chat_mode/shell/commands/clear.py +12 -12
  14. janito/cli/chat_mode/shell/commands/conversation_restart.py +30 -0
  15. janito/cli/chat_mode/shell/commands/execute.py +42 -0
  16. janito/cli/chat_mode/shell/commands/help.py +6 -3
  17. janito/cli/chat_mode/shell/commands/model.py +28 -0
  18. janito/cli/chat_mode/shell/commands/multi.py +51 -51
  19. janito/cli/chat_mode/shell/commands/read.py +37 -0
  20. janito/cli/chat_mode/shell/commands/tools.py +45 -18
  21. janito/cli/chat_mode/shell/commands/write.py +37 -0
  22. janito/cli/chat_mode/shell/commands.bak.zip +0 -0
  23. janito/cli/chat_mode/shell/input_history.py +62 -62
  24. janito/cli/chat_mode/shell/session.bak.zip +0 -0
  25. janito/cli/chat_mode/toolbar.py +44 -27
  26. janito/cli/cli_commands/list_models.py +35 -35
  27. janito/cli/cli_commands/list_providers.py +9 -9
  28. janito/cli/cli_commands/list_tools.py +86 -53
  29. janito/cli/cli_commands/model_selection.py +50 -50
  30. janito/cli/cli_commands/set_api_key.py +19 -19
  31. janito/cli/cli_commands/show_config.py +51 -51
  32. janito/cli/cli_commands/show_system_prompt.py +105 -62
  33. janito/cli/config.py +5 -6
  34. janito/cli/core/__init__.py +4 -4
  35. janito/cli/core/event_logger.py +59 -59
  36. janito/cli/core/runner.py +25 -18
  37. janito/cli/core/setters.py +10 -1
  38. janito/cli/core/unsetters.py +54 -54
  39. janito/cli/main_cli.py +28 -5
  40. janito/cli/prompt_core.py +18 -2
  41. janito/cli/prompt_setup.py +56 -0
  42. janito/cli/single_shot_mode/__init__.py +6 -6
  43. janito/cli/single_shot_mode/handler.py +14 -73
  44. janito/cli/verbose_output.py +1 -1
  45. janito/config.py +5 -5
  46. janito/config_manager.py +13 -0
  47. janito/drivers/anthropic/driver.py +113 -113
  48. janito/drivers/dashscope.bak.zip +0 -0
  49. janito/drivers/openai/README.md +20 -0
  50. janito/drivers/openai_responses.bak.zip +0 -0
  51. janito/event_bus/event.py +2 -2
  52. janito/formatting_token.py +54 -54
  53. janito/i18n/__init__.py +35 -35
  54. janito/i18n/messages.py +23 -23
  55. janito/i18n/pt.py +46 -47
  56. janito/llm/README.md +23 -0
  57. janito/llm/__init__.py +5 -5
  58. janito/llm/agent.py +507 -443
  59. janito/llm/driver.py +8 -0
  60. janito/llm/driver_config_builder.py +34 -34
  61. janito/llm/driver_input.py +12 -12
  62. janito/llm/message_parts.py +60 -60
  63. janito/llm/model.py +38 -38
  64. janito/llm/provider.py +196 -196
  65. janito/provider_registry.py +8 -6
  66. janito/providers/anthropic/model_info.py +22 -22
  67. janito/providers/anthropic/provider.py +2 -0
  68. janito/providers/azure_openai/provider.py +3 -0
  69. janito/providers/dashscope.bak.zip +0 -0
  70. janito/providers/deepseek/__init__.py +1 -1
  71. janito/providers/deepseek/model_info.py +16 -16
  72. janito/providers/deepseek/provider.py +94 -91
  73. janito/providers/google/provider.py +3 -0
  74. janito/providers/mistralai/provider.py +3 -0
  75. janito/providers/openai/provider.py +4 -0
  76. janito/providers/registry.py +26 -26
  77. janito/shell.bak.zip +0 -0
  78. janito/tools/DOCSTRING_STANDARD.txt +33 -0
  79. janito/tools/README.md +3 -0
  80. janito/tools/__init__.py +20 -6
  81. janito/tools/adapters/__init__.py +1 -1
  82. janito/tools/adapters/local/__init__.py +65 -62
  83. janito/tools/adapters/local/adapter.py +18 -35
  84. janito/tools/adapters/local/ask_user.py +101 -102
  85. janito/tools/adapters/local/copy_file.py +84 -84
  86. janito/tools/adapters/local/create_directory.py +69 -69
  87. janito/tools/adapters/local/create_file.py +82 -82
  88. janito/tools/adapters/local/delete_text_in_file.py +2 -2
  89. janito/tools/adapters/local/fetch_url.py +97 -97
  90. janito/tools/adapters/local/find_files.py +139 -138
  91. janito/tools/adapters/local/get_file_outline/__init__.py +1 -1
  92. janito/tools/adapters/local/get_file_outline/core.py +117 -117
  93. janito/tools/adapters/local/get_file_outline/java_outline.py +40 -40
  94. janito/tools/adapters/local/get_file_outline/markdown_outline.py +14 -14
  95. janito/tools/adapters/local/get_file_outline/python_outline.py +303 -303
  96. janito/tools/adapters/local/get_file_outline/python_outline_v2.py +156 -156
  97. janito/tools/adapters/local/get_file_outline/search_outline.py +33 -33
  98. janito/tools/adapters/local/move_file.py +2 -2
  99. janito/tools/adapters/local/open_html_in_browser.py +2 -1
  100. janito/tools/adapters/local/open_url.py +2 -2
  101. janito/tools/adapters/local/python_code_run.py +166 -166
  102. janito/tools/adapters/local/python_command_run.py +164 -164
  103. janito/tools/adapters/local/python_file_run.py +163 -163
  104. janito/tools/adapters/local/remove_directory.py +2 -2
  105. janito/tools/adapters/local/remove_file.py +2 -2
  106. janito/tools/adapters/local/replace_text_in_file.py +2 -2
  107. janito/tools/adapters/local/run_bash_command.py +176 -176
  108. janito/tools/adapters/local/run_powershell_command.py +219 -219
  109. janito/tools/adapters/local/search_text/__init__.py +1 -1
  110. janito/tools/adapters/local/search_text/core.py +201 -201
  111. janito/tools/adapters/local/search_text/pattern_utils.py +73 -73
  112. janito/tools/adapters/local/search_text/traverse_directory.py +145 -145
  113. janito/tools/adapters/local/validate_file_syntax/__init__.py +1 -1
  114. janito/tools/adapters/local/validate_file_syntax/core.py +106 -106
  115. janito/tools/adapters/local/validate_file_syntax/css_validator.py +35 -35
  116. janito/tools/adapters/local/validate_file_syntax/html_validator.py +93 -93
  117. janito/tools/adapters/local/validate_file_syntax/js_validator.py +27 -27
  118. janito/tools/adapters/local/validate_file_syntax/json_validator.py +6 -6
  119. janito/tools/adapters/local/validate_file_syntax/markdown_validator.py +109 -109
  120. janito/tools/adapters/local/validate_file_syntax/ps1_validator.py +32 -32
  121. janito/tools/adapters/local/validate_file_syntax/python_validator.py +5 -5
  122. janito/tools/adapters/local/validate_file_syntax/xml_validator.py +11 -11
  123. janito/tools/adapters/local/validate_file_syntax/yaml_validator.py +6 -6
  124. janito/tools/adapters/local/view_file.py +168 -167
  125. janito/tools/inspect_registry.py +17 -17
  126. janito/tools/outline_file.bak.zip +0 -0
  127. janito/tools/permissions.py +45 -0
  128. janito/tools/permissions_parse.py +12 -0
  129. janito/tools/tool_base.py +118 -105
  130. janito/tools/tool_events.py +58 -58
  131. janito/tools/tool_run_exception.py +12 -12
  132. janito/tools/tool_use_tracker.py +81 -81
  133. janito/tools/tool_utils.py +43 -45
  134. janito/tools/tools_adapter.py +25 -20
  135. janito/tools/tools_schema.py +104 -104
  136. {janito-2.3.0.dist-info → janito-2.4.0.dist-info}/METADATA +425 -388
  137. janito-2.4.0.dist-info/RECORD +195 -0
  138. janito/agent/templates/profiles/system_prompt_template_base_pt.txt.j2 +0 -13
  139. janito/agent/templates/profiles/system_prompt_template_main.txt.j2 +0 -37
  140. janito/cli/chat_mode/shell/commands/edit.py +0 -25
  141. janito/cli/chat_mode/shell/commands/exec.py +0 -27
  142. janito/cli/chat_mode/shell/commands/termweb_log.py +0 -92
  143. janito/cli/termweb_starter.py +0 -122
  144. janito/termweb/app.py +0 -95
  145. janito/version.py +0 -4
  146. janito-2.3.0.dist-info/RECORD +0 -181
  147. {janito-2.3.0.dist-info → janito-2.4.0.dist-info}/WHEEL +0 -0
  148. {janito-2.3.0.dist-info → janito-2.4.0.dist-info}/entry_points.txt +0 -0
  149. {janito-2.3.0.dist-info → janito-2.4.0.dist-info}/licenses/LICENSE +0 -0
  150. {janito-2.3.0.dist-info → janito-2.4.0.dist-info}/top_level.txt +0 -0
@@ -1,388 +1,425 @@
1
- Metadata-Version: 2.4
2
- Name: janito
3
- Version: 2.3.0
4
- Summary: A new Python package called janito.
5
- Author-email: João Pinto <lamego.pinto@gmail.com>
6
- Project-URL: Homepage, https://github.com/janito-dev/janito
7
- Requires-Python: >=3.7
8
- Description-Content-Type: text/markdown
9
- License-File: LICENSE
10
- Requires-Dist: attrs==25.3.0
11
- Requires-Dist: rich==14.0.0
12
- Requires-Dist: pathspec==0.12.1
13
- Requires-Dist: setuptools>=61.0
14
- Requires-Dist: pyyaml>=6.0
15
- Requires-Dist: jinja2>=3.0.0
16
- Requires-Dist: prompt_toolkit>=3.0.51
17
- Requires-Dist: lxml>=5.4.0
18
- Requires-Dist: requests>=2.32.4
19
- Requires-Dist: bs4>=0.0.2
20
- Provides-Extra: dev
21
- Requires-Dist: pytest; extra == "dev"
22
- Requires-Dist: pre-commit; extra == "dev"
23
- Requires-Dist: ruff==0.11.9; extra == "dev"
24
- Requires-Dist: detect-secrets==1.4.0; extra == "dev"
25
- Requires-Dist: codespell==2.4.1; extra == "dev"
26
- Requires-Dist: black; extra == "dev"
27
- Dynamic: license-file
28
-
29
- # Janito
30
-
31
- Janito is a command-line interface (CLI) tool for managing and interacting with Large Language Model (LLM) providers. It enables you to configure API keys, select providers and models, and submit prompts to various LLMs from your terminal. Janito is designed for extensibility, supporting multiple providers and a wide range of tools for automation and productivity.
32
-
33
- ## Features
34
-
35
- - 🔑 Manage API keys and provider configurations
36
- - 🤖 Interact with multiple LLM providers (OpenAI, Google Gemini, Mistral, DeepSeek, and more)
37
- - 🛠️ List and use a variety of registered tools
38
- - 📝 Submit prompts and receive responses directly from the CLI
39
- - 📋 List available models for each provider
40
- - 🧩 Extensible architecture for adding new providers and tools
41
- - 🎛️ Rich terminal output and event logging
42
-
43
- ### Advanced and Architectural Features
44
-
45
- - ⚡ **Event-driven architecture**: Modular, decoupled system using a custom EventBus for extensibility and integration.
46
- - 🧑‍💻 **Tool registry & dynamic tool execution**: Register new tools easily, execute them by name or call from automation pipelines.
47
- - 🤖 **LLM Agent automation**: Supports agent-like workflows with the ability to chain tools or make decisions during LLM conversations.
48
- - 🏗️ **Extensible provider management**: Add, configure, or switch between LLM providers and their models on the fly.
49
- - 🧰 **Rich tool ecosystem**: Includes file operations, local/remote script and command execution, text processing, and internet access (fetching URLs), all reusable by LLM or user.
50
- - 📝 **Comprehensive event & history reporting**: Detailed logs of prompts, events, tool usage, and responses for traceability and audit.
51
- - 🖥️ **Enhanced terminal UI**: Colorful, informative real-time outputs and logs to improve productivity and insight during LLM usage.
52
-
53
- ## Installation
54
-
55
- Janito is a Python package. Since this is a development version, you can install it directly from GitHub:
56
-
57
- ```bash
58
- pip install git+https://github.com/janito-dev/janito.git
59
- ```
60
-
61
- ### First launch and quick setup
62
-
63
- Janito integrates with external LLM providers (list below), and most of them require a subscription to get an API_KEY.
64
-
65
- > [!NOTE]
66
- > Today, on June the 26th 2025, Google has a free tier subscription for its Gemini-2.5-flash model. Despite the limitation of the model and of the rate limit of the free tier, it can be used for testing janito. The API_KEY for Gemini is available [here](https://aistudio.google.com/app/apikey).
67
-
68
- > [!NOTE]
69
- > [Here](https://github.com/cheahjs/free-llm-api-resources/blob/main/README.md) a list of various services that provide free access or credits towards API-based LLM usage. Note that not all of them are supported by Janito, yet.
70
-
71
- For a quick usage you can:
72
-
73
- 1. once you get the API_KEY from your favourite LLM provider, setup the API_KEY in Janito
74
-
75
- ```bash
76
- janito --set-api-key API_KEY -p PROVIDER
77
- ```
78
-
79
- 2. then run janito from command line with the specific LLM provider of your choice
80
-
81
- ```bash
82
- janito -p PROVIDER "Hello, who are you? How can you help me in my tasks?"
83
- ```
84
-
85
- 3. or you can run janito in interactive mode without the trailing argument
86
-
87
- ```bash
88
- janito -p PROVIDER
89
- ```
90
-
91
- 4. if you want to setup a specific provider for any further interactions you can use:
92
-
93
- ```bash
94
- janito -set provider=PROVIDER
95
- ```
96
-
97
- > [!WARNING]
98
- > Currently the supported providers are: `openai`, `google`, `azure_openai`. You can get more details with `janito --list-providers`.
99
-
100
- 5. for more advanced setup, continue reading.
101
-
102
-
103
- ## Usage
104
-
105
- After installation, use the `janito` command in your terminal.
106
-
107
- Janito has configuration options, like `--set api-key API_KEY` and `--set provider=PROVIDER`, that create durable configurations and single shoot options, like `-p PROVIDER` and `-m MODEL`, that are active for the single run of the command or session.
108
-
109
- ### Basic Commands
110
-
111
- - **Set API Key for a Provider (requires -p PROVIDER)**
112
- ```bash
113
- janito --set-api-key API_KEY -p PROVIDER
114
- ```
115
- > **Note:** The `-p PROVIDER` argument is required when setting an API key. For example:
116
- > ```bash
117
- > janito --set-api-key sk-xxxxxxx -p openai
118
- > ```
119
-
120
- - **Set the Provider (durable)**
121
- ```bash
122
- janito --set provider=provider_name
123
- ```
124
-
125
- - **List Supported Providers**
126
- ```bash
127
- janito --list-providers
128
- ```
129
-
130
- - **List Registered Tools**
131
- ```bash
132
- janito --list-tools
133
- ```
134
-
135
- - **List Models for a Provider**
136
- ```bash
137
- janito -p PROVIDER --list-models
138
- ```
139
-
140
- - **Submit a Prompt**
141
- ```bash
142
- janito "What is the capital of France?"
143
- ```
144
-
145
- - **Start Interactive Chat Shell**
146
- ```bash
147
- janito
148
- ```
149
-
150
- ### Advanced Options
151
-
152
- - **Enable Inline Web File Viewer for Clickable Links**
153
-
154
- By default, Janito can open referenced files in a browser-based viewer when you click on file links in supported terminals. To enable this feature for your session, use the `-w` or `--web` flag:
155
-
156
- ```bash
157
- janito -w
158
- ```
159
-
160
- This starts the lightweight web file viewer (termweb) in the background, allowing you to inspect files referenced in responses directly in your browser. Combine with interactive mode or prompts as needed.
161
-
162
- > **Tip:** Use with the interactive shell for the best experience with clickable file links.
163
-
164
-
165
- - **Enable Execution Tools (Code/Shell Execution)**
166
-
167
- By default, tools that can execute code or shell commands are **disabled** for safety. To enable these tools (such as code execution, shell commands, etc.), use the `--exec` or `-x` flag:
168
-
169
- ```bash
170
- janito -x "Run this code: print('Hello, world!')"
171
- ```
172
- > **Warning:** Enabling execution tools allows running arbitrary code or shell commands. Only use `--exec` if you trust your prompt and environment.
173
-
174
- - **Set a System Prompt**
175
- ```bash
176
- janito -s path/to/system_prompt.txt "Your prompt here"
177
- ```
178
-
179
- - **Select Model and Provider Temporarily**
180
- ```bash
181
- janito -p openai -m gpt-3.5-turbo "Your prompt here"
182
- janito -p google -m gemini-2.5-flash "Your prompt here"
183
- ```
184
-
185
- - **Set Provider-Specific Config (for the selected provider)**
186
- ```bash
187
- # syntax: janito --set PROVIDER.KEY=VALUE
188
- # example: set the default model for openai provider
189
- janito --set openai.model=gpt-4o
190
-
191
- ```
192
- > **Note:** Use `--set PROVIDER.key=value` for provider-specific settings (e.g., `openai.max_tokens`, `openai.base_url`).
193
-
194
- - **Enable Event Logging**
195
- ```bash
196
- janito -e "Your prompt here"
197
- ```
198
-
199
- ## 🌟 CLI Options Reference
200
-
201
- ### Core CLI Options
202
- | Option | Description |
203
- |------------------------|-----------------------------------------------------------------------------|
204
- | `-w`, `--web` | Enable the builtin lightweight web file viewer for clickable file links (termweb). |
205
- | `--version` | Show program version |
206
- | `--list-tools` | List all registered tools |
207
- | `--list-providers` | List all supported LLM providers |
208
- | `-l`, `--list-models` | List models for current/selected provider |
209
- | `--set-api-key` | Set API key for a provider. **Requires** `-p PROVIDER` to specify the provider. |
210
- | `--set provider=name` | Set the current LLM provider (e.g., `janito --set provider=openai`) |
211
- | `--set PROVIDER.model=MODEL` or `--set model=MODEL` | Set the default model for the current/selected provider, or globally. (e.g., `janito --set openai.model=gpt-3.5-turbo`) |
212
- | `-s`, `--system` | Set a system prompt (e.g., `janito -s path/to/system_prompt.txt "Your prompt here"`) |
213
- | `-r`, `--role` | Set the role for the agent (overrides config) (e.g., `janito -r "assistant" "Your prompt here"`) |
214
- | `-p`, `--provider` | Select LLM provider (overrides config) (e.g., `janito -p openai "Your prompt here"`) |
215
- | `-m`, `--model` | Select model for the provider (e.g., `janito -m gpt-3.5-turbo "Your prompt here"`) |
216
- | `-v`, `--verbose` | Print extra information before answering |
217
- | `-R`, `--raw` | Print raw JSON response from API |
218
- | `-e`, `--event-log` | Log events to console as they occur |
219
- | `"user_prompt"` | Prompt to submit for the non interactive mode (e.g. `janito "What is the capital of France?"`) |
220
-
221
- ### 🧩 Extended Chat Mode Commands
222
- Once inside the interactive chat mode, you can use these slash commands:
223
-
224
- #### 📲 Basic Interaction
225
- | Command | Description |
226
- |-------------------|----------------------------------------------|
227
- | `/exit` or `exit` | Exit chat mode |
228
- | `/help` | Show available commands |
229
- | `/multi` | Activate multiline input mode |
230
- | `/clear` | Clear the terminal screen |
231
- | `/history` | Show input history |
232
- | `/view` | Print current conversation history |
233
- | `/track` | Show tool usage history |
234
-
235
- #### 💬 Conversation Management
236
- | Command | Description |
237
- |---------------------|----------------------------------------------|
238
- | `/restart` | Start a new conversation (reset context) |
239
- | `/prompt` | Show the current system prompt |
240
- | `/role <description>` | Change the system role |
241
- | `/lang [code]` | Change interface language (e.g., `/lang en`) |
242
-
243
- #### 🛠️ Tool & Provider Interaction
244
- | Command | Description |
245
- |----------------------|----------------------------------------------|
246
- | `/tools` | List available tools |
247
- | `/termweb-status` | Show status of termweb server |
248
- | `/termweb-logs` | Show last lines of termweb logs |
249
- | `/livelogs` | Show live updates from server log file |
250
- | `/edit <filename>` | Open file in browser-based editor |
251
-
252
- #### 📊 Output Control
253
- | Command | Description |
254
- |---------------------|----------------------------------------------|
255
- | `/verbose` | Show current verbose mode status |
256
- | `/verbose [on|off]` | Set verbose mode |
257
-
258
- ## Extending Janito
259
-
260
- Janito is built to be extensible. You can add new LLM providers or tools by implementing new modules in the `janito/providers` or `janito/tools` directories, respectively. See the source code and developer documentation for more details.
261
-
262
- ## Supported Providers
263
-
264
- - OpenAI
265
- - OpenAI over Azure
266
- - Google Gemini
267
- - DeepSeek
268
-
269
- See [docs/supported-providers-models.md](docs/supported-providers-models.md) for more details.
270
-
271
- ## Contributing
272
-
273
- Contributions are welcome! Please see the `CONTRIBUTING.md` (if available) or open an issue to get started.
274
-
275
- ## License
276
-
277
- This project is licensed under the terms of the MIT license.
278
-
279
- For more information, see the documentation in the `docs/` directory or run `janito --help`.
280
-
281
- ---
282
-
283
- # Support
284
-
285
-
286
- ## 📖 Detailed Documentation
287
-
288
- Full and up-to-date documentation is available at: https://janito-dev.github.io/janito/
289
-
290
- ---
291
-
292
-
293
- ## FAQ: Setting API Keys
294
-
295
- - [Multiple API_KEY setup](#faq-multiple-api-key)
296
- - [Use a specific model](#faq-use-specific-model)
297
- - [Fetch the availale LLM providers](#faq-fetch-providers)
298
- - [Fetch the availale models](#faq-fetch-models)
299
-
300
-
301
- <a id="faq-multiple-api-key"></a>
302
- ### Multiple API_KEY setup
303
-
304
- To set an API key for a provider, you **must** specify both the API key and the provider name:
305
-
306
- ```bash
307
- janito --set-api-key YOUR_API_KEY -p PROVIDER_NAME
308
- ```
309
-
310
- You can have an API_KEY for each LLM provider
311
-
312
- ```bash
313
- janito --set-api-key API_KEY_1 -p PROVIDER_1
314
- janito --set-api-key API_KEY_2 -p PROVIDER_2
315
- ```
316
-
317
- Then you can easily use one provider or the other without changing the API_KEY
318
-
319
- ```bash
320
- janito -p PROVIDER_1 "What provider do you use?"
321
- janito -p PROVIDER_2 "What provider do you use?"
322
- ```
323
-
324
- If you omit the `-p PROVIDER_NAME` argument, Janito will show an error and not set the key.
325
-
326
- <a id="faq-use-specific-model"></a>
327
- ### Use a specific model
328
-
329
- To use a specific model, you can use the `-m` option in the follwing way:
330
-
331
- ```bash
332
- janito -m gpt-4.1-nano -p openai "What model do you use?"
333
- ```
334
-
335
- Or you can use the durable `--set` option:
336
-
337
- ```bash
338
- janito --set provider=openai
339
- janito --set model=gpt-4.1-nano
340
- janito "What model do you use?"
341
- ```
342
-
343
- <a id="faq-fetch-providers"></a>
344
- ### Fetch the availale LLM providers
345
-
346
- You can list all the LLM providers available using:
347
-
348
- ```bash
349
- janito --list-providers
350
- ```
351
-
352
- <a id="faq-fetch-models"></a>
353
- ### Fetch the availale models
354
-
355
- Each LLM provider has its own models, the best way to check what are the available models is usign the following commands:
356
-
357
- ```bash
358
- janito -p openai --list-models
359
- janito -p google --list-models
360
- janito -p azure_openai --list-models
361
- janito -p deepseek --list-models
362
- ```
363
-
364
-
365
- ## Ask Me Anything
366
-
367
- <div align="center">
368
- <a href="https://github.com/janito-dev/janito" title="Ask Me Anything">
369
- <img width="250" src="docs/imgs/ama.png" alt="Ask Me Anything">
370
- </a>
371
- </div
372
-
373
- When the FAQ are not enough, you can contact the contributors of the project by direct questions
374
-
375
- <p align="center">
376
- <kbd><a href="../../issues/new?labels=question">Ask a question</a></kbd> <kbd><a href="../../issues?q=is%3Aissue+is%3Aclosed+label%3Aquestion">Read questions</a></kbd>
377
- </p>
378
-
379
- #### Guidelines
380
-
381
- - :mag: Ensure your question hasn't already been answered.
382
- - :memo: Use a succinct title and description.
383
- - :bug: Bugs & feature requests should be opened on the relevant issue tracker.
384
- - :signal_strength: Support questions are better asked on Stack Overflow.
385
- - :blush: Be nice, civil and polite.
386
- - :heart_eyes: If you include at least one emoji in your question, the feedback will probably come faster.
387
- - [Read more AMAs](https://github.com/sindresorhus/amas)
388
- - [What's an AMA?](https://en.wikipedia.org/wiki/R/IAmA)
1
+ Metadata-Version: 2.4
2
+ Name: janito
3
+ Version: 2.4.0
4
+ Summary: A new Python package called janito.
5
+ Author-email: João Pinto <lamego.pinto@gmail.com>
6
+ Project-URL: Homepage, https://github.com/janito-dev/janito
7
+ Requires-Python: >=3.7
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: attrs==25.3.0
11
+ Requires-Dist: rich==14.0.0
12
+ Requires-Dist: pathspec==0.12.1
13
+ Requires-Dist: setuptools>=61.0
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: jinja2>=3.0.0
16
+ Requires-Dist: prompt_toolkit>=3.0.51
17
+ Requires-Dist: lxml>=5.4.0
18
+ Requires-Dist: requests>=2.32.4
19
+ Requires-Dist: bs4>=0.0.2
20
+ Requires-Dist: questionary>=2.0.1
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: pre-commit; extra == "dev"
24
+ Requires-Dist: ruff==0.11.9; extra == "dev"
25
+ Requires-Dist: detect-secrets==1.4.0; extra == "dev"
26
+ Requires-Dist: codespell==2.4.1; extra == "dev"
27
+ Requires-Dist: black; extra == "dev"
28
+ Requires-Dist: questionary>=2.0.1; extra == "dev"
29
+ Requires-Dist: setuptools_scm>=8.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # Janito
33
+
34
+ Janito is a command-line interface (CLI) tool for managing and interacting with Large Language Model (LLM) providers. It enables you to configure API keys, select providers and models, and submit prompts to various LLMs from your terminal. Janito is designed for extensibility, supporting multiple providers and a wide range of tools for automation and productivity.
35
+
36
+ ## Features
37
+
38
+ - 🔑 Manage API keys and provider configurations
39
+ - 🤖 Interact with multiple LLM providers (OpenAI, Google Gemini, Mistral, DeepSeek, and more)
40
+ - 🛠️ List and use a variety of registered tools
41
+ - 📝 Submit prompts and receive responses directly from the CLI
42
+ - 📋 List available models for each provider
43
+ - 🧩 Extensible architecture for adding new providers and tools
44
+ - 🎛️ Rich terminal output and event logging
45
+
46
+ ### Advanced and Architectural Features
47
+
48
+ - **Event-driven architecture**: Modular, decoupled system using a custom EventBus for extensibility and integration.
49
+ - 🧑‍💻 **Tool registry & dynamic tool execution**: Register new tools easily, execute them by name or call from automation pipelines.
50
+ - 🤖 **LLM Agent automation**: Supports agent-like workflows with the ability to chain tools or make decisions during LLM conversations.
51
+ - 🏗️ **Extensible provider management**: Add, configure, or switch between LLM providers and their models on the fly.
52
+ - 🧰 **Rich tool ecosystem**: Includes file operations, local/remote script and command execution, text processing, and internet access (fetching URLs), all reusable by LLM or user.
53
+ - 📝 **Comprehensive event & history reporting**: Detailed logs of prompts, events, tool usage, and responses for traceability and audit.
54
+ - 🖥️ **Enhanced terminal UI**: Colorful, informative real-time outputs and logs to improve productivity and insight during LLM usage.
55
+
56
+ ## Installation
57
+
58
+ Janito is a Python package. Since this is a development version, you can install it directly from GitHub:
59
+
60
+ ```bash
61
+ pip install git+https://github.com/janito-dev/janito.git
62
+ ```
63
+
64
+ ### First launch and quick setup
65
+
66
+ Janito integrates with external LLM providers (list below), and most of them require a subscription to get an API_KEY.
67
+
68
+ > [!NOTE]
69
+ > Today, on June the 26th 2025, Google has a free tier subscription for its Gemini-2.5-flash model. Despite the limitation of the model and of the rate limit of the free tier, it can be used for testing janito. The API_KEY for Gemini is available [here](https://aistudio.google.com/app/apikey).
70
+
71
+ > [!NOTE]
72
+ > [Here](https://github.com/cheahjs/free-llm-api-resources/blob/main/README.md) a list of various services that provide free access or credits towards API-based LLM usage. Note that not all of them are supported by Janito, yet.
73
+
74
+ For a quick usage you can:
75
+
76
+ 1. once you get the API_KEY from your favourite LLM provider, setup the API_KEY in Janito
77
+
78
+ ```bash
79
+ janito --set-api-key API_KEY -p PROVIDER
80
+ ```
81
+
82
+ 2. then run janito from command line with the specific LLM provider of your choice
83
+
84
+ ```bash
85
+ janito -p PROVIDER "Hello, who are you? How can you help me in my tasks?"
86
+ ```
87
+
88
+ 3. or you can run janito in interactive mode without the trailing argument
89
+
90
+ ```bash
91
+ janito -p PROVIDER
92
+ ```
93
+
94
+ 4. if you want to setup a specific provider for any further interactions you can use:
95
+
96
+ ```bash
97
+ janito -set provider=PROVIDER
98
+ ```
99
+
100
+ > [!WARNING]
101
+ > Currently the supported providers are: `openai`, `google`, `azure_openai`. You can get more details with `janito --list-providers`.
102
+
103
+ 5. for more advanced setup, continue reading.
104
+
105
+
106
+ ## Usage
107
+
108
+ After installation, use the `janito` command in your terminal.
109
+
110
+ Janito supports both general-purpose and specialized assistance through the use of **profiles**. Profiles allow you to select a specific system prompt template and behavior for the agent, enabling workflows tailored to different roles or tasks (e.g., developer, writer, data analyst), or to use Janito as a generic AI assistant.
111
+
112
+ ### Profiles: General-Purpose and Specialized Assistance
113
+
114
+ - By default, Janito acts as a general-purpose assistant.
115
+ - You can select a specialized profile using the `--profile` option:
116
+ ```bash
117
+ janito --profile developer "Refactor this code for better readability."
118
+ janito --profile writer "Draft a blog post about AI in healthcare."
119
+ ```
120
+ - Profiles change the system prompt and agent behavior to suit the selected role or workflow.
121
+ - To see available profiles or customize them, refer to the documentation or the `agent/templates/profiles/` directory.
122
+
123
+ > **Tip:** Use `--profile` for targeted workflows, or omit it for a general-purpose assistant.
124
+
125
+ Janito has configuration options, like `--set api-key API_KEY` and `--set provider=PROVIDER`, that create durable configurations and single shoot options, like `-p PROVIDER` and `-m MODEL`, that are active for the single run of the command or session.
126
+
127
+ ### Basic Commands
128
+
129
+ - **Set API Key for a Provider (requires -p PROVIDER)**
130
+ ```bash
131
+ janito --set-api-key API_KEY -p PROVIDER
132
+ ```
133
+ > **Note:** The `-p PROVIDER` argument is required when setting an API key. For example:
134
+ > ```bash
135
+ > janito --set-api-key sk-xxxxxxx -p openai
136
+ > ```
137
+
138
+ - **Set the Provider (durable)**
139
+ ```bash
140
+ janito --set provider=provider_name
141
+ ```
142
+
143
+ - **List Supported Providers**
144
+ ```bash
145
+ janito --list-providers
146
+ ```
147
+
148
+ - **List Registered Tools**
149
+ ```bash
150
+ janito --list-tools
151
+ ```
152
+
153
+ - **List Models for a Provider**
154
+ ```bash
155
+ janito -p PROVIDER --list-models
156
+ ```
157
+
158
+ - **Submit a Prompt**
159
+ ```bash
160
+ janito "What is the capital of France?"
161
+ ```
162
+
163
+ - **Start Interactive Chat Shell**
164
+ ```bash
165
+ janito
166
+ ```
167
+
168
+ ### Advanced Options
169
+
170
+ - **Enable Inline Web File Viewer for Clickable Links**
171
+
172
+ By default, Janito can open referenced files in a browser-based viewer when you click on file links in supported terminals. To enable this feature for your session, use the `--web` flag:
173
+
174
+ ```bash
175
+ janito --web
176
+ ```
177
+
178
+ This starts the lightweight web file viewer () in the background, allowing you to inspect files referenced in responses directly in your browser. Combine with interactive mode or prompts as needed.
179
+
180
+ > **Tip:** Use with the interactive shell for the best experience with clickable file links.
181
+
182
+
183
+ - **Enable Execution Tools (Code/Shell Execution)**
184
+
185
+ By default, **all tool privileges (read, write, execute)** are disabled for safety. This means Janito starts with no permissions to run tools that read, write, or execute code/shell commands unless you explicitly enable them.
186
+
187
+ - To enable **read** tools (e.g., file reading, searching): add `-r` or `--read`
188
+ - To enable **write** tools (e.g., file editing): add `-w` or `--write`
189
+ - To enable **execution** tools (code/shell execution): add `-x` or `--exec`
190
+
191
+ You can combine these flags as needed. For example, to enable both read and write tools:
192
+
193
+ ```bash
194
+ janito -r -w "Read and update this file: ..."
195
+ ```
196
+
197
+ To enable all permissions (read, write, execute):
198
+
199
+ ```bash
200
+ janito -r -w -x "Run this code: print('Hello, world!')"
201
+ ```
202
+
203
+ > **Warning:** Enabling execution tools allows running arbitrary code or shell commands. Only use `--exec` if you trust your prompt and environment.
204
+
205
+ - **Set a System Prompt**
206
+ ```bash
207
+ janito -s path/to/system_prompt.txt "Your prompt here"
208
+ ```
209
+
210
+ - **Select Model and Provider Temporarily**
211
+ ```bash
212
+ janito -p openai -m gpt-3.5-turbo "Your prompt here"
213
+ janito -p google -m gemini-2.5-flash "Your prompt here"
214
+ ```
215
+
216
+ - **Set Provider-Specific Config (for the selected provider)**
217
+ ```bash
218
+ # syntax: janito --set PROVIDER.KEY=VALUE
219
+ # example: set the default model for openai provider
220
+ janito --set openai.model=gpt-4o
221
+
222
+ ```
223
+ > **Note:** Use `--set PROVIDER.key=value` for provider-specific settings (e.g., `openai.max_tokens`, `openai.base_url`).
224
+
225
+ - **Enable Event Logging**
226
+ ```bash
227
+ janito -e "Your prompt here"
228
+ ```
229
+
230
+ ## 🌟 CLI Options Reference
231
+
232
+ ### Core CLI Options
233
+ | Option | Description |
234
+ |------------------------|-----------------------------------------------------------------------------|
235
+ | `--web` | Enable the builtin lightweight web file viewer for clickable file links (). |
236
+ | `--version` | Show program version |
237
+ | `--list-tools` | List all registered tools |
238
+ | `--list-providers` | List all supported LLM providers |
239
+ | `-l`, `--list-models` | List models for current/selected provider |
240
+ | `--set-api-key` | Set API key for a provider. **Requires** `-p PROVIDER` to specify the provider. |
241
+ | `--set provider=name` | Set the current LLM provider (e.g., `janito --set provider=openai`) |
242
+ | `--set PROVIDER.model=MODEL` or `--set model=MODEL` | Set the default model for the current/selected provider, or globally. (e.g., `janito --set openai.model=gpt-3.5-turbo`) |
243
+ | `-s`, `--system` | Set a system prompt (e.g., `janito -s path/to/system_prompt.txt "Your prompt here"`) |
244
+
245
+ | `-p`, `--provider` | Select LLM provider (overrides config) (e.g., `janito -p openai "Your prompt here"`) |
246
+ | `-m`, `--model` | Select model for the provider (e.g., `janito -m gpt-3.5-turbo "Your prompt here"`) |
247
+ | `-v`, `--verbose` | Print extra information before answering |
248
+ | `-R`, `--raw` | Print raw JSON response from API |
249
+ | `-e`, `--event-log` | Log events to console as they occur |
250
+ | `"user_prompt"` | Prompt to submit for the non interactive mode (e.g. `janito "What is the capital of France?"`) |
251
+
252
+ ### 🧩 Extended Chat Mode Commands
253
+ Once inside the interactive chat mode, you can use these slash commands:
254
+
255
+ #### 📲 Basic Interaction
256
+ | Command | Description |
257
+ |-------------------|----------------------------------------------|
258
+ | `/exit` or `exit` | Exit chat mode |
259
+ | `/help` | Show available commands |
260
+ | `/multi` | Activate multiline input mode |
261
+ | `/clear` | Clear the terminal screen |
262
+ | `/history` | Show input history |
263
+ | `/view` | Print current conversation history |
264
+ | `/track` | Show tool usage history |
265
+
266
+ #### 💬 Conversation Management
267
+ | Command | Description |
268
+ |---------------------|----------------------------------------------|
269
+ | `/restart` | Start a new conversation (reset context) |
270
+ | `/prompt` | Show the current system prompt |
271
+ | `/role <description>` | Change the system role |
272
+ | `/lang [code]` | Change interface language (e.g., `/lang en`) |
273
+
274
+ #### 🛠️ Tool & Provider Interaction
275
+ | Command | Description |
276
+ |----------------------|----------------------------------------------|
277
+ | `/tools` | List available tools |
278
+ | `/-status` | Show status of server |
279
+ | `/-logs` | Show last lines of logs |
280
+ | `/livelogs` | Show live updates from server log file |
281
+ | `/edit <filename>` | Open file in browser-based editor |
282
+
283
+ #### 📊 Output Control
284
+ | Command | Description |
285
+ |---------------------|----------------------------------------------|
286
+ | `/verbose` | Show current verbose mode status |
287
+ | `/verbose [on|off]` | Set verbose mode |
288
+
289
+ ## Extending Janito
290
+
291
+ Janito is built to be extensible. You can add new LLM providers or tools by implementing new modules in the `janito/providers` or `janito/tools` directories, respectively. See the source code and developer documentation for more details.
292
+
293
+ ## Supported Providers
294
+
295
+ - OpenAI
296
+ - OpenAI over Azure
297
+ - Google Gemini
298
+ - DeepSeek
299
+
300
+ See [docs/supported-providers-models.md](docs/supported-providers-models.md) for more details.
301
+
302
+ ## Contributing
303
+
304
+ Contributions are welcome! Please see the `CONTRIBUTING.md` (if available) or open an issue to get started.
305
+
306
+ ---
307
+
308
+ ## Developer Documentation
309
+
310
+ For developer-specific setup, versioning, and contribution guidelines, see [README-dev.md](./README-dev.md).
311
+
312
+ ## License
313
+
314
+ This project is licensed under the terms of the MIT license.
315
+
316
+ For more information, see the documentation in the `docs/` directory or run `janito --help`.
317
+
318
+ ---
319
+
320
+ # Support
321
+
322
+
323
+ ## 📖 Detailed Documentation
324
+
325
+ Full and up-to-date documentation is available at: https://janito-dev.github.io/janito/
326
+
327
+ ---
328
+
329
+
330
+ ## FAQ: Setting API Keys
331
+
332
+ - [Multiple API_KEY setup](#faq-multiple-api-key)
333
+ - [Use a specific model](#faq-use-specific-model)
334
+ - [Fetch the availale LLM providers](#faq-fetch-providers)
335
+ - [Fetch the availale models](#faq-fetch-models)
336
+
337
+
338
+ <a id="faq-multiple-api-key"></a>
339
+ ### Multiple API_KEY setup
340
+
341
+ To set an API key for a provider, you **must** specify both the API key and the provider name:
342
+
343
+ ```bash
344
+ janito --set-api-key YOUR_API_KEY -p PROVIDER_NAME
345
+ ```
346
+
347
+ You can have an API_KEY for each LLM provider
348
+
349
+ ```bash
350
+ janito --set-api-key API_KEY_1 -p PROVIDER_1
351
+ janito --set-api-key API_KEY_2 -p PROVIDER_2
352
+ ```
353
+
354
+ Then you can easily use one provider or the other without changing the API_KEY
355
+
356
+ ```bash
357
+ janito -p PROVIDER_1 "What provider do you use?"
358
+ janito -p PROVIDER_2 "What provider do you use?"
359
+ ```
360
+
361
+ If you omit the `-p PROVIDER_NAME` argument, Janito will show an error and not set the key.
362
+
363
+ <a id="faq-use-specific-model"></a>
364
+ ### Use a specific model
365
+
366
+ To use a specific model, you can use the `-m` option in the follwing way:
367
+
368
+ ```bash
369
+ janito -m gpt-4.1-nano -p openai "What model do you use?"
370
+ ```
371
+
372
+ Or you can use the durable `--set` option:
373
+
374
+ ```bash
375
+ janito --set provider=openai
376
+ janito --set model=gpt-4.1-nano
377
+ janito "What model do you use?"
378
+ ```
379
+
380
+ <a id="faq-fetch-providers"></a>
381
+ ### Fetch the availale LLM providers
382
+
383
+ You can list all the LLM providers available using:
384
+
385
+ ```bash
386
+ janito --list-providers
387
+ ```
388
+
389
+ <a id="faq-fetch-models"></a>
390
+ ### Fetch the availale models
391
+
392
+ Each LLM provider has its own models, the best way to check what are the available models is usign the following commands:
393
+
394
+ ```bash
395
+ janito -p openai --list-models
396
+ janito -p google --list-models
397
+ janito -p azure_openai --list-models
398
+ janito -p deepseek --list-models
399
+ ```
400
+
401
+
402
+ ## Ask Me Anything
403
+
404
+ <div align="center">
405
+ <a href="https://github.com/janito-dev/janito" title="Ask Me Anything">
406
+ <img width="250" src="docs/imgs/ama.png" alt="Ask Me Anything">
407
+ </a>
408
+ </div
409
+
410
+ When the FAQ are not enough, you can contact the contributors of the project by direct questions
411
+
412
+ <p align="center">
413
+ <kbd><a href="../../issues/new?labels=question">Ask a question</a></kbd> <kbd><a href="../../issues?q=is%3Aissue+is%3Aclosed+label%3Aquestion">Read questions</a></kbd>
414
+ </p>
415
+
416
+ #### Guidelines
417
+
418
+ - :mag: Ensure your question hasn't already been answered.
419
+ - :memo: Use a succinct title and description.
420
+ - :bug: Bugs & feature requests should be opened on the relevant issue tracker.
421
+ - :signal_strength: Support questions are better asked on Stack Overflow.
422
+ - :blush: Be nice, civil and polite.
423
+ - :heart_eyes: If you include at least one emoji in your question, the feedback will probably come faster.
424
+ - [Read more AMAs](https://github.com/sindresorhus/amas)
425
+ - [What's an AMA?](https://en.wikipedia.org/wiki/R/IAmA)