janito 2.3.0__py3-none-any.whl → 2.3.1__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 (93) hide show
  1. janito/__init__.py +6 -6
  2. janito/cli/chat_mode/shell/autocomplete.py +21 -21
  3. janito/cli/chat_mode/shell/commands/clear.py +12 -12
  4. janito/cli/chat_mode/shell/commands/multi.py +51 -51
  5. janito/cli/chat_mode/shell/input_history.py +62 -62
  6. janito/cli/cli_commands/list_models.py +35 -35
  7. janito/cli/cli_commands/list_providers.py +9 -9
  8. janito/cli/cli_commands/list_tools.py +53 -53
  9. janito/cli/cli_commands/model_selection.py +50 -50
  10. janito/cli/cli_commands/model_utils.py +95 -95
  11. janito/cli/cli_commands/set_api_key.py +19 -19
  12. janito/cli/cli_commands/show_config.py +51 -51
  13. janito/cli/cli_commands/show_system_prompt.py +62 -62
  14. janito/cli/core/__init__.py +4 -4
  15. janito/cli/core/event_logger.py +59 -59
  16. janito/cli/core/getters.py +33 -33
  17. janito/cli/core/unsetters.py +54 -54
  18. janito/cli/single_shot_mode/__init__.py +6 -6
  19. janito/config.py +5 -5
  20. janito/config_manager.py +112 -112
  21. janito/drivers/anthropic/driver.py +113 -113
  22. janito/formatting_token.py +54 -54
  23. janito/i18n/__init__.py +35 -35
  24. janito/i18n/messages.py +23 -23
  25. janito/i18n/pt.py +47 -47
  26. janito/llm/__init__.py +5 -5
  27. janito/llm/agent.py +443 -443
  28. janito/llm/auth.py +63 -63
  29. janito/llm/driver_config_builder.py +34 -34
  30. janito/llm/driver_input.py +12 -12
  31. janito/llm/message_parts.py +60 -60
  32. janito/llm/model.py +38 -38
  33. janito/llm/provider.py +196 -196
  34. janito/provider_registry.py +176 -176
  35. janito/providers/anthropic/model_info.py +22 -22
  36. janito/providers/anthropic/provider.py +2 -0
  37. janito/providers/azure_openai/model_info.py +16 -16
  38. janito/providers/azure_openai/provider.py +3 -0
  39. janito/providers/deepseek/__init__.py +1 -1
  40. janito/providers/deepseek/model_info.py +16 -16
  41. janito/providers/deepseek/provider.py +94 -91
  42. janito/providers/google/provider.py +3 -0
  43. janito/providers/mistralai/provider.py +3 -0
  44. janito/providers/openai/provider.py +4 -0
  45. janito/tools/adapters/__init__.py +1 -1
  46. janito/tools/adapters/local/ask_user.py +102 -102
  47. janito/tools/adapters/local/copy_file.py +84 -84
  48. janito/tools/adapters/local/create_directory.py +69 -69
  49. janito/tools/adapters/local/create_file.py +82 -82
  50. janito/tools/adapters/local/fetch_url.py +97 -97
  51. janito/tools/adapters/local/find_files.py +138 -138
  52. janito/tools/adapters/local/get_file_outline/__init__.py +1 -1
  53. janito/tools/adapters/local/get_file_outline/core.py +117 -117
  54. janito/tools/adapters/local/get_file_outline/java_outline.py +40 -40
  55. janito/tools/adapters/local/get_file_outline/markdown_outline.py +14 -14
  56. janito/tools/adapters/local/get_file_outline/python_outline.py +303 -303
  57. janito/tools/adapters/local/get_file_outline/python_outline_v2.py +156 -156
  58. janito/tools/adapters/local/get_file_outline/search_outline.py +33 -33
  59. janito/tools/adapters/local/python_code_run.py +166 -166
  60. janito/tools/adapters/local/python_command_run.py +164 -164
  61. janito/tools/adapters/local/python_file_run.py +163 -163
  62. janito/tools/adapters/local/run_bash_command.py +176 -176
  63. janito/tools/adapters/local/run_powershell_command.py +219 -219
  64. janito/tools/adapters/local/search_text/__init__.py +1 -1
  65. janito/tools/adapters/local/search_text/core.py +201 -201
  66. janito/tools/adapters/local/search_text/pattern_utils.py +73 -73
  67. janito/tools/adapters/local/search_text/traverse_directory.py +145 -145
  68. janito/tools/adapters/local/validate_file_syntax/__init__.py +1 -1
  69. janito/tools/adapters/local/validate_file_syntax/core.py +106 -106
  70. janito/tools/adapters/local/validate_file_syntax/css_validator.py +35 -35
  71. janito/tools/adapters/local/validate_file_syntax/html_validator.py +93 -93
  72. janito/tools/adapters/local/validate_file_syntax/js_validator.py +27 -27
  73. janito/tools/adapters/local/validate_file_syntax/json_validator.py +6 -6
  74. janito/tools/adapters/local/validate_file_syntax/markdown_validator.py +109 -109
  75. janito/tools/adapters/local/validate_file_syntax/ps1_validator.py +32 -32
  76. janito/tools/adapters/local/validate_file_syntax/python_validator.py +5 -5
  77. janito/tools/adapters/local/validate_file_syntax/xml_validator.py +11 -11
  78. janito/tools/adapters/local/validate_file_syntax/yaml_validator.py +6 -6
  79. janito/tools/adapters/local/view_file.py +167 -167
  80. janito/tools/inspect_registry.py +17 -17
  81. janito/tools/tool_base.py +105 -105
  82. janito/tools/tool_events.py +58 -58
  83. janito/tools/tool_run_exception.py +12 -12
  84. janito/tools/tool_use_tracker.py +81 -81
  85. janito/tools/tool_utils.py +45 -45
  86. janito/tools/tools_schema.py +104 -104
  87. janito/version.py +4 -4
  88. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/METADATA +390 -388
  89. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/RECORD +93 -93
  90. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/WHEEL +0 -0
  91. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/entry_points.txt +0 -0
  92. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/licenses/LICENSE +0 -0
  93. {janito-2.3.0.dist-info → janito-2.3.1.dist-info}/top_level.txt +0 -0
@@ -1,388 +1,390 @@
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.3.1
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: openai
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: openai; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Janito
32
+
33
+ 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.
34
+
35
+ ## Features
36
+
37
+ - 🔑 Manage API keys and provider configurations
38
+ - 🤖 Interact with multiple LLM providers (OpenAI, Google Gemini, Mistral, DeepSeek, and more)
39
+ - 🛠️ List and use a variety of registered tools
40
+ - 📝 Submit prompts and receive responses directly from the CLI
41
+ - 📋 List available models for each provider
42
+ - 🧩 Extensible architecture for adding new providers and tools
43
+ - 🎛️ Rich terminal output and event logging
44
+
45
+ ### Advanced and Architectural Features
46
+
47
+ - **Event-driven architecture**: Modular, decoupled system using a custom EventBus for extensibility and integration.
48
+ - 🧑‍💻 **Tool registry & dynamic tool execution**: Register new tools easily, execute them by name or call from automation pipelines.
49
+ - 🤖 **LLM Agent automation**: Supports agent-like workflows with the ability to chain tools or make decisions during LLM conversations.
50
+ - 🏗️ **Extensible provider management**: Add, configure, or switch between LLM providers and their models on the fly.
51
+ - 🧰 **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.
52
+ - 📝 **Comprehensive event & history reporting**: Detailed logs of prompts, events, tool usage, and responses for traceability and audit.
53
+ - 🖥️ **Enhanced terminal UI**: Colorful, informative real-time outputs and logs to improve productivity and insight during LLM usage.
54
+
55
+ ## Installation
56
+
57
+ Janito is a Python package. Since this is a development version, you can install it directly from GitHub:
58
+
59
+ ```bash
60
+ pip install git+https://github.com/janito-dev/janito.git
61
+ ```
62
+
63
+ ### First launch and quick setup
64
+
65
+ Janito integrates with external LLM providers (list below), and most of them require a subscription to get an API_KEY.
66
+
67
+ > [!NOTE]
68
+ > 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).
69
+
70
+ > [!NOTE]
71
+ > [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.
72
+
73
+ For a quick usage you can:
74
+
75
+ 1. once you get the API_KEY from your favourite LLM provider, setup the API_KEY in Janito
76
+
77
+ ```bash
78
+ janito --set-api-key API_KEY -p PROVIDER
79
+ ```
80
+
81
+ 2. then run janito from command line with the specific LLM provider of your choice
82
+
83
+ ```bash
84
+ janito -p PROVIDER "Hello, who are you? How can you help me in my tasks?"
85
+ ```
86
+
87
+ 3. or you can run janito in interactive mode without the trailing argument
88
+
89
+ ```bash
90
+ janito -p PROVIDER
91
+ ```
92
+
93
+ 4. if you want to setup a specific provider for any further interactions you can use:
94
+
95
+ ```bash
96
+ janito -set provider=PROVIDER
97
+ ```
98
+
99
+ > [!WARNING]
100
+ > Currently the supported providers are: `openai`, `google`, `azure_openai`. You can get more details with `janito --list-providers`.
101
+
102
+ 5. for more advanced setup, continue reading.
103
+
104
+
105
+ ## Usage
106
+
107
+ After installation, use the `janito` command in your terminal.
108
+
109
+ 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.
110
+
111
+ ### Basic Commands
112
+
113
+ - **Set API Key for a Provider (requires -p PROVIDER)**
114
+ ```bash
115
+ janito --set-api-key API_KEY -p PROVIDER
116
+ ```
117
+ > **Note:** The `-p PROVIDER` argument is required when setting an API key. For example:
118
+ > ```bash
119
+ > janito --set-api-key sk-xxxxxxx -p openai
120
+ > ```
121
+
122
+ - **Set the Provider (durable)**
123
+ ```bash
124
+ janito --set provider=provider_name
125
+ ```
126
+
127
+ - **List Supported Providers**
128
+ ```bash
129
+ janito --list-providers
130
+ ```
131
+
132
+ - **List Registered Tools**
133
+ ```bash
134
+ janito --list-tools
135
+ ```
136
+
137
+ - **List Models for a Provider**
138
+ ```bash
139
+ janito -p PROVIDER --list-models
140
+ ```
141
+
142
+ - **Submit a Prompt**
143
+ ```bash
144
+ janito "What is the capital of France?"
145
+ ```
146
+
147
+ - **Start Interactive Chat Shell**
148
+ ```bash
149
+ janito
150
+ ```
151
+
152
+ ### Advanced Options
153
+
154
+ - **Enable Inline Web File Viewer for Clickable Links**
155
+
156
+ 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:
157
+
158
+ ```bash
159
+ janito -w
160
+ ```
161
+
162
+ 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.
163
+
164
+ > **Tip:** Use with the interactive shell for the best experience with clickable file links.
165
+
166
+
167
+ - **Enable Execution Tools (Code/Shell Execution)**
168
+
169
+ 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:
170
+
171
+ ```bash
172
+ janito -x "Run this code: print('Hello, world!')"
173
+ ```
174
+ > **Warning:** Enabling execution tools allows running arbitrary code or shell commands. Only use `--exec` if you trust your prompt and environment.
175
+
176
+ - **Set a System Prompt**
177
+ ```bash
178
+ janito -s path/to/system_prompt.txt "Your prompt here"
179
+ ```
180
+
181
+ - **Select Model and Provider Temporarily**
182
+ ```bash
183
+ janito -p openai -m gpt-3.5-turbo "Your prompt here"
184
+ janito -p google -m gemini-2.5-flash "Your prompt here"
185
+ ```
186
+
187
+ - **Set Provider-Specific Config (for the selected provider)**
188
+ ```bash
189
+ # syntax: janito --set PROVIDER.KEY=VALUE
190
+ # example: set the default model for openai provider
191
+ janito --set openai.model=gpt-4o
192
+
193
+ ```
194
+ > **Note:** Use `--set PROVIDER.key=value` for provider-specific settings (e.g., `openai.max_tokens`, `openai.base_url`).
195
+
196
+ - **Enable Event Logging**
197
+ ```bash
198
+ janito -e "Your prompt here"
199
+ ```
200
+
201
+ ## 🌟 CLI Options Reference
202
+
203
+ ### Core CLI Options
204
+ | Option | Description |
205
+ |------------------------|-----------------------------------------------------------------------------|
206
+ | `-w`, `--web` | Enable the builtin lightweight web file viewer for clickable file links (termweb). |
207
+ | `--version` | Show program version |
208
+ | `--list-tools` | List all registered tools |
209
+ | `--list-providers` | List all supported LLM providers |
210
+ | `-l`, `--list-models` | List models for current/selected provider |
211
+ | `--set-api-key` | Set API key for a provider. **Requires** `-p PROVIDER` to specify the provider. |
212
+ | `--set provider=name` | Set the current LLM provider (e.g., `janito --set provider=openai`) |
213
+ | `--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`) |
214
+ | `-s`, `--system` | Set a system prompt (e.g., `janito -s path/to/system_prompt.txt "Your prompt here"`) |
215
+ | `-r`, `--role` | Set the role for the agent (overrides config) (e.g., `janito -r "assistant" "Your prompt here"`) |
216
+ | `-p`, `--provider` | Select LLM provider (overrides config) (e.g., `janito -p openai "Your prompt here"`) |
217
+ | `-m`, `--model` | Select model for the provider (e.g., `janito -m gpt-3.5-turbo "Your prompt here"`) |
218
+ | `-v`, `--verbose` | Print extra information before answering |
219
+ | `-R`, `--raw` | Print raw JSON response from API |
220
+ | `-e`, `--event-log` | Log events to console as they occur |
221
+ | `"user_prompt"` | Prompt to submit for the non interactive mode (e.g. `janito "What is the capital of France?"`) |
222
+
223
+ ### 🧩 Extended Chat Mode Commands
224
+ Once inside the interactive chat mode, you can use these slash commands:
225
+
226
+ #### 📲 Basic Interaction
227
+ | Command | Description |
228
+ |-------------------|----------------------------------------------|
229
+ | `/exit` or `exit` | Exit chat mode |
230
+ | `/help` | Show available commands |
231
+ | `/multi` | Activate multiline input mode |
232
+ | `/clear` | Clear the terminal screen |
233
+ | `/history` | Show input history |
234
+ | `/view` | Print current conversation history |
235
+ | `/track` | Show tool usage history |
236
+
237
+ #### 💬 Conversation Management
238
+ | Command | Description |
239
+ |---------------------|----------------------------------------------|
240
+ | `/restart` | Start a new conversation (reset context) |
241
+ | `/prompt` | Show the current system prompt |
242
+ | `/role <description>` | Change the system role |
243
+ | `/lang [code]` | Change interface language (e.g., `/lang en`) |
244
+
245
+ #### 🛠️ Tool & Provider Interaction
246
+ | Command | Description |
247
+ |----------------------|----------------------------------------------|
248
+ | `/tools` | List available tools |
249
+ | `/termweb-status` | Show status of termweb server |
250
+ | `/termweb-logs` | Show last lines of termweb logs |
251
+ | `/livelogs` | Show live updates from server log file |
252
+ | `/edit <filename>` | Open file in browser-based editor |
253
+
254
+ #### 📊 Output Control
255
+ | Command | Description |
256
+ |---------------------|----------------------------------------------|
257
+ | `/verbose` | Show current verbose mode status |
258
+ | `/verbose [on|off]` | Set verbose mode |
259
+
260
+ ## Extending Janito
261
+
262
+ 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.
263
+
264
+ ## Supported Providers
265
+
266
+ - OpenAI
267
+ - OpenAI over Azure
268
+ - Google Gemini
269
+ - DeepSeek
270
+
271
+ See [docs/supported-providers-models.md](docs/supported-providers-models.md) for more details.
272
+
273
+ ## Contributing
274
+
275
+ Contributions are welcome! Please see the `CONTRIBUTING.md` (if available) or open an issue to get started.
276
+
277
+ ## License
278
+
279
+ This project is licensed under the terms of the MIT license.
280
+
281
+ For more information, see the documentation in the `docs/` directory or run `janito --help`.
282
+
283
+ ---
284
+
285
+ # Support
286
+
287
+
288
+ ## 📖 Detailed Documentation
289
+
290
+ Full and up-to-date documentation is available at: https://janito-dev.github.io/janito/
291
+
292
+ ---
293
+
294
+
295
+ ## FAQ: Setting API Keys
296
+
297
+ - [Multiple API_KEY setup](#faq-multiple-api-key)
298
+ - [Use a specific model](#faq-use-specific-model)
299
+ - [Fetch the availale LLM providers](#faq-fetch-providers)
300
+ - [Fetch the availale models](#faq-fetch-models)
301
+
302
+
303
+ <a id="faq-multiple-api-key"></a>
304
+ ### Multiple API_KEY setup
305
+
306
+ To set an API key for a provider, you **must** specify both the API key and the provider name:
307
+
308
+ ```bash
309
+ janito --set-api-key YOUR_API_KEY -p PROVIDER_NAME
310
+ ```
311
+
312
+ You can have an API_KEY for each LLM provider
313
+
314
+ ```bash
315
+ janito --set-api-key API_KEY_1 -p PROVIDER_1
316
+ janito --set-api-key API_KEY_2 -p PROVIDER_2
317
+ ```
318
+
319
+ Then you can easily use one provider or the other without changing the API_KEY
320
+
321
+ ```bash
322
+ janito -p PROVIDER_1 "What provider do you use?"
323
+ janito -p PROVIDER_2 "What provider do you use?"
324
+ ```
325
+
326
+ If you omit the `-p PROVIDER_NAME` argument, Janito will show an error and not set the key.
327
+
328
+ <a id="faq-use-specific-model"></a>
329
+ ### Use a specific model
330
+
331
+ To use a specific model, you can use the `-m` option in the follwing way:
332
+
333
+ ```bash
334
+ janito -m gpt-4.1-nano -p openai "What model do you use?"
335
+ ```
336
+
337
+ Or you can use the durable `--set` option:
338
+
339
+ ```bash
340
+ janito --set provider=openai
341
+ janito --set model=gpt-4.1-nano
342
+ janito "What model do you use?"
343
+ ```
344
+
345
+ <a id="faq-fetch-providers"></a>
346
+ ### Fetch the availale LLM providers
347
+
348
+ You can list all the LLM providers available using:
349
+
350
+ ```bash
351
+ janito --list-providers
352
+ ```
353
+
354
+ <a id="faq-fetch-models"></a>
355
+ ### Fetch the availale models
356
+
357
+ Each LLM provider has its own models, the best way to check what are the available models is usign the following commands:
358
+
359
+ ```bash
360
+ janito -p openai --list-models
361
+ janito -p google --list-models
362
+ janito -p azure_openai --list-models
363
+ janito -p deepseek --list-models
364
+ ```
365
+
366
+
367
+ ## Ask Me Anything
368
+
369
+ <div align="center">
370
+ <a href="https://github.com/janito-dev/janito" title="Ask Me Anything">
371
+ <img width="250" src="docs/imgs/ama.png" alt="Ask Me Anything">
372
+ </a>
373
+ </div
374
+
375
+ When the FAQ are not enough, you can contact the contributors of the project by direct questions
376
+
377
+ <p align="center">
378
+ <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>
379
+ </p>
380
+
381
+ #### Guidelines
382
+
383
+ - :mag: Ensure your question hasn't already been answered.
384
+ - :memo: Use a succinct title and description.
385
+ - :bug: Bugs & feature requests should be opened on the relevant issue tracker.
386
+ - :signal_strength: Support questions are better asked on Stack Overflow.
387
+ - :blush: Be nice, civil and polite.
388
+ - :heart_eyes: If you include at least one emoji in your question, the feedback will probably come faster.
389
+ - [Read more AMAs](https://github.com/sindresorhus/amas)
390
+ - [What's an AMA?](https://en.wikipedia.org/wiki/R/IAmA)