janito 3.10.0__py3-none-any.whl → 3.11.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.
- janito/README.md +191 -191
- janito/_version.py +55 -55
- janito/cli/cli_commands/list_drivers.py +162 -162
- janito/cli/console.py +3 -3
- janito/cli/prompt_core.py +336 -301
- janito/cli/rich_terminal_reporter.py +2 -4
- janito/docs/GETTING_STARTED.md +189 -189
- janito/plugins/discovery.py +289 -289
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/METADATA +5 -4
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/RECORD +14 -15
- janito/mkdocs.yml +0 -40
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/WHEEL +0 -0
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/entry_points.txt +0 -0
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/licenses/LICENSE +0 -0
- {janito-3.10.0.dist-info → janito-3.11.1.dist-info}/top_level.txt +0 -0
@@ -160,11 +160,9 @@ class RichTerminalReporter(EventHandlerBase):
|
|
160
160
|
self.console.print(msg)
|
161
161
|
self.console.file.flush()
|
162
162
|
elif subtype == ReportSubtype.STDOUT:
|
163
|
-
|
164
|
-
self.console.file.flush()
|
163
|
+
print(msg)
|
165
164
|
elif subtype == ReportSubtype.STDERR:
|
166
|
-
|
167
|
-
self.console.file.flush()
|
165
|
+
print(msg, file=sys.stderr)
|
168
166
|
else:
|
169
167
|
self.console.print(msg)
|
170
168
|
self.console.file.flush()
|
janito/docs/GETTING_STARTED.md
CHANGED
@@ -1,190 +1,190 @@
|
|
1
|
-
# Getting Started with Janito
|
2
|
-
|
3
|
-
This guide will help you set up Janito CLI quickly and start using it with your preferred AI provider.
|
4
|
-
|
5
|
-
## Quick Setup (2 minutes)
|
6
|
-
|
7
|
-
### 1. Install Janito
|
8
|
-
```bash
|
9
|
-
pip install janito
|
10
|
-
```
|
11
|
-
|
12
|
-
### 2. Choose Your Provider
|
13
|
-
|
14
|
-
Janito supports multiple AI providers. Choose one to get started:
|
15
|
-
|
16
|
-
**Moonshot (Recommended for Chinese users)**
|
17
|
-
1. Go to [Moonshot AI Platform](https://platform.moonshot.cn/)
|
18
|
-
2. Sign up for an account
|
19
|
-
3. Navigate to API Keys section
|
20
|
-
4. Create a new API key
|
21
|
-
|
22
|
-
**OpenAI**
|
23
|
-
1. Go to [OpenAI Platform](https://platform.openai.com/)
|
24
|
-
2. Sign up and add payment method
|
25
|
-
3. Create an API key
|
26
|
-
|
27
|
-
**IBM WatsonX**
|
28
|
-
1. Go to [IBM Cloud](https://cloud.ibm.com/)
|
29
|
-
2. Create a WatsonX AI service
|
30
|
-
3. Get your API key and project ID
|
31
|
-
|
32
|
-
### 3. Configure Janito
|
33
|
-
|
34
|
-
**Moonshot Setup:**
|
35
|
-
```bash
|
36
|
-
# Set Moonshot as your default provider
|
37
|
-
janito --set-api-key YOUR_API_KEY -p moonshot
|
38
|
-
|
39
|
-
# Verify it's working
|
40
|
-
janito "Hello, can you introduce yourself?"
|
41
|
-
```
|
42
|
-
|
43
|
-
**OpenAI Setup:**
|
44
|
-
```bash
|
45
|
-
# Set OpenAI as your default provider
|
46
|
-
janito --set-api-key YOUR_OPENAI_API_KEY -p openai
|
47
|
-
|
48
|
-
# Verify it's working
|
49
|
-
janito "Hello, can you introduce yourself?"
|
50
|
-
```
|
51
|
-
|
52
|
-
**IBM WatsonX Setup:**
|
53
|
-
```bash
|
54
|
-
# Set IBM WatsonX as your default provider
|
55
|
-
janito --set-api-key YOUR_WATSONX_API_KEY -p ibm
|
56
|
-
janito --set-config ibm project_id YOUR_PROJECT_ID
|
57
|
-
|
58
|
-
# Verify it's working
|
59
|
-
janito "Hello, can you introduce yourself?"
|
60
|
-
```
|
61
|
-
|
62
|
-
## Your First Commands
|
63
|
-
|
64
|
-
### Basic Usage
|
65
|
-
```bash
|
66
|
-
# Simple prompt
|
67
|
-
janito "Create a Python script to calculate fibonacci numbers"
|
68
|
-
|
69
|
-
# With specific model
|
70
|
-
janito -m kimi-k1-8k "Explain machine learning in simple terms"
|
71
|
-
|
72
|
-
# Interactive chat mode
|
73
|
-
janito --chat
|
74
|
-
```
|
75
|
-
|
76
|
-
### Working with Files
|
77
|
-
```bash
|
78
|
-
# Analyze a file
|
79
|
-
janito "Analyze the performance of my_app.py" < my_app.py
|
80
|
-
|
81
|
-
# Generate code in a specific directory
|
82
|
-
janito -W ./my_project "Create a REST API with FastAPI"
|
83
|
-
```
|
84
|
-
|
85
|
-
## Configuration Options
|
86
|
-
|
87
|
-
### Set as Default Provider
|
88
|
-
```bash
|
89
|
-
# Make your chosen provider the permanent default
|
90
|
-
janito --set provider=moonshot # or openai, ibm, etc.
|
91
|
-
janito --set model=kimi-k1-8k # or gpt-5, ibm/granite-3-8b-instruct, etc.
|
92
|
-
```
|
93
|
-
|
94
|
-
### Environment Variables
|
95
|
-
You can also use environment variables:
|
96
|
-
|
97
|
-
**Moonshot:**
|
98
|
-
```bash
|
99
|
-
export MOONSHOT_API_KEY=your_key_here
|
100
|
-
export JANITO_PROVIDER=moonshot
|
101
|
-
export JANITO_MODEL=kimi-k1-8k
|
102
|
-
```
|
103
|
-
|
104
|
-
**OpenAI:**
|
105
|
-
```bash
|
106
|
-
export OPENAI_API_KEY=your_key_here
|
107
|
-
export JANITO_PROVIDER=openai
|
108
|
-
export JANITO_MODEL=gpt-5
|
109
|
-
```
|
110
|
-
|
111
|
-
**IBM WatsonX:**
|
112
|
-
```bash
|
113
|
-
export WATSONX_API_KEY=your_key_here
|
114
|
-
export WATSONX_PROJECT_ID=your_project_id
|
115
|
-
export WATSONX_SPACE_ID=your_space_id # optional
|
116
|
-
export JANITO_PROVIDER=ibm
|
117
|
-
export JANITO_MODEL=ibm/granite-3-3-8b-instruct
|
118
|
-
```
|
119
|
-
|
120
|
-
## Available Models by Provider
|
121
|
-
|
122
|
-
### Moonshot Models
|
123
|
-
- **kimi-k1-8k**: Fast responses, good for general tasks
|
124
|
-
- **kimi-k1-32k**: Better for longer contexts
|
125
|
-
- **kimi-k1-128k**: Best for very long documents
|
126
|
-
- **kimi-k2-turbo-preview**: Latest model with enhanced capabilities
|
127
|
-
- **kimi-k2-turbo-preview**: Turbo version of the advanced reasoning model
|
128
|
-
|
129
|
-
### OpenAI Models
|
130
|
-
- **gpt-5**: Latest GPT model with advanced capabilities
|
131
|
-
- **gpt-4.1**: High-performance model for complex tasks
|
132
|
-
- **gpt-4o**: Optimized for speed and cost
|
133
|
-
- **o3-mini**: Reasoning-focused model
|
134
|
-
|
135
|
-
### IBM WatsonX Models
|
136
|
-
- **ibm/granite-3-3-8b-instruct**: IBM's latest Granite 3.3 8B Instruct model (default)
|
137
|
-
- **ibm/granite-3-8b-instruct**: IBM's Granite 3 8B Instruct model
|
138
|
-
- **meta-llama/llama-3-3-70b-instruct**: Meta Llama 3.3 70B hosted on WatsonX
|
139
|
-
- **meta-llama/llama-3-1-70b-instruct**: Meta Llama 3.1 70B hosted on WatsonX
|
140
|
-
- **mistralai/mistral-large-2407**: Latest Mistral Large model hosted on WatsonX
|
141
|
-
|
142
|
-
## Next Steps
|
143
|
-
|
144
|
-
1. **Explore tools**: Run `janito --list-tools` to see available tools
|
145
|
-
2. **Try chat mode**: Run `janito --chat` for interactive sessions
|
146
|
-
3. **Check examples**: Look at the main README.md for more usage examples
|
147
|
-
4. **Join community**: Get help and share tips with other users
|
148
|
-
|
149
|
-
## Troubleshooting
|
150
|
-
|
151
|
-
### Common Issues
|
152
|
-
|
153
|
-
**"Provider not found" error**
|
154
|
-
```bash
|
155
|
-
# Check available providers
|
156
|
-
janito --list-providers
|
157
|
-
|
158
|
-
# Re-register your provider
|
159
|
-
janito --set-api-key YOUR_KEY -p YOUR_PROVIDER
|
160
|
-
```
|
161
|
-
|
162
|
-
**"Model not available" error**
|
163
|
-
```bash
|
164
|
-
# List available models for your provider
|
165
|
-
janito -p YOUR_PROVIDER --list-models
|
166
|
-
```
|
167
|
-
|
168
|
-
**API key issues**
|
169
|
-
```bash
|
170
|
-
# Check current configuration
|
171
|
-
janito --show-config
|
172
|
-
|
173
|
-
# Reset API key
|
174
|
-
janito --set-api-key NEW_KEY -p YOUR_PROVIDER
|
175
|
-
```
|
176
|
-
|
177
|
-
**IBM WatsonX specific issues**
|
178
|
-
```bash
|
179
|
-
# Check if project ID is set
|
180
|
-
janito --show-config
|
181
|
-
|
182
|
-
# Set project ID if missing
|
183
|
-
janito --set-config ibm project_id YOUR_PROJECT_ID
|
184
|
-
```
|
185
|
-
|
186
|
-
### Getting Help
|
187
|
-
|
188
|
-
- Check the main README.md for comprehensive documentation
|
189
|
-
- Use `janito --help` for command-line options
|
1
|
+
# Getting Started with Janito
|
2
|
+
|
3
|
+
This guide will help you set up Janito CLI quickly and start using it with your preferred AI provider.
|
4
|
+
|
5
|
+
## Quick Setup (2 minutes)
|
6
|
+
|
7
|
+
### 1. Install Janito
|
8
|
+
```bash
|
9
|
+
uv pip install janito
|
10
|
+
```
|
11
|
+
|
12
|
+
### 2. Choose Your Provider
|
13
|
+
|
14
|
+
Janito supports multiple AI providers. Choose one to get started:
|
15
|
+
|
16
|
+
**Moonshot (Recommended for Chinese users)**
|
17
|
+
1. Go to [Moonshot AI Platform](https://platform.moonshot.cn/)
|
18
|
+
2. Sign up for an account
|
19
|
+
3. Navigate to API Keys section
|
20
|
+
4. Create a new API key
|
21
|
+
|
22
|
+
**OpenAI**
|
23
|
+
1. Go to [OpenAI Platform](https://platform.openai.com/)
|
24
|
+
2. Sign up and add payment method
|
25
|
+
3. Create an API key
|
26
|
+
|
27
|
+
**IBM WatsonX**
|
28
|
+
1. Go to [IBM Cloud](https://cloud.ibm.com/)
|
29
|
+
2. Create a WatsonX AI service
|
30
|
+
3. Get your API key and project ID
|
31
|
+
|
32
|
+
### 3. Configure Janito
|
33
|
+
|
34
|
+
**Moonshot Setup:**
|
35
|
+
```bash
|
36
|
+
# Set Moonshot as your default provider
|
37
|
+
janito --set-api-key YOUR_API_KEY -p moonshot
|
38
|
+
|
39
|
+
# Verify it's working
|
40
|
+
janito "Hello, can you introduce yourself?"
|
41
|
+
```
|
42
|
+
|
43
|
+
**OpenAI Setup:**
|
44
|
+
```bash
|
45
|
+
# Set OpenAI as your default provider
|
46
|
+
janito --set-api-key YOUR_OPENAI_API_KEY -p openai
|
47
|
+
|
48
|
+
# Verify it's working
|
49
|
+
janito "Hello, can you introduce yourself?"
|
50
|
+
```
|
51
|
+
|
52
|
+
**IBM WatsonX Setup:**
|
53
|
+
```bash
|
54
|
+
# Set IBM WatsonX as your default provider
|
55
|
+
janito --set-api-key YOUR_WATSONX_API_KEY -p ibm
|
56
|
+
janito --set-config ibm project_id YOUR_PROJECT_ID
|
57
|
+
|
58
|
+
# Verify it's working
|
59
|
+
janito "Hello, can you introduce yourself?"
|
60
|
+
```
|
61
|
+
|
62
|
+
## Your First Commands
|
63
|
+
|
64
|
+
### Basic Usage
|
65
|
+
```bash
|
66
|
+
# Simple prompt
|
67
|
+
janito "Create a Python script to calculate fibonacci numbers"
|
68
|
+
|
69
|
+
# With specific model
|
70
|
+
janito -m kimi-k1-8k "Explain machine learning in simple terms"
|
71
|
+
|
72
|
+
# Interactive chat mode
|
73
|
+
janito --chat
|
74
|
+
```
|
75
|
+
|
76
|
+
### Working with Files
|
77
|
+
```bash
|
78
|
+
# Analyze a file
|
79
|
+
janito "Analyze the performance of my_app.py" < my_app.py
|
80
|
+
|
81
|
+
# Generate code in a specific directory
|
82
|
+
janito -W ./my_project "Create a REST API with FastAPI"
|
83
|
+
```
|
84
|
+
|
85
|
+
## Configuration Options
|
86
|
+
|
87
|
+
### Set as Default Provider
|
88
|
+
```bash
|
89
|
+
# Make your chosen provider the permanent default
|
90
|
+
janito --set provider=moonshot # or openai, ibm, etc.
|
91
|
+
janito --set model=kimi-k1-8k # or gpt-5, ibm/granite-3-8b-instruct, etc.
|
92
|
+
```
|
93
|
+
|
94
|
+
### Environment Variables
|
95
|
+
You can also use environment variables:
|
96
|
+
|
97
|
+
**Moonshot:**
|
98
|
+
```bash
|
99
|
+
export MOONSHOT_API_KEY=your_key_here
|
100
|
+
export JANITO_PROVIDER=moonshot
|
101
|
+
export JANITO_MODEL=kimi-k1-8k
|
102
|
+
```
|
103
|
+
|
104
|
+
**OpenAI:**
|
105
|
+
```bash
|
106
|
+
export OPENAI_API_KEY=your_key_here
|
107
|
+
export JANITO_PROVIDER=openai
|
108
|
+
export JANITO_MODEL=gpt-5
|
109
|
+
```
|
110
|
+
|
111
|
+
**IBM WatsonX:**
|
112
|
+
```bash
|
113
|
+
export WATSONX_API_KEY=your_key_here
|
114
|
+
export WATSONX_PROJECT_ID=your_project_id
|
115
|
+
export WATSONX_SPACE_ID=your_space_id # optional
|
116
|
+
export JANITO_PROVIDER=ibm
|
117
|
+
export JANITO_MODEL=ibm/granite-3-3-8b-instruct
|
118
|
+
```
|
119
|
+
|
120
|
+
## Available Models by Provider
|
121
|
+
|
122
|
+
### Moonshot Models
|
123
|
+
- **kimi-k1-8k**: Fast responses, good for general tasks
|
124
|
+
- **kimi-k1-32k**: Better for longer contexts
|
125
|
+
- **kimi-k1-128k**: Best for very long documents
|
126
|
+
- **kimi-k2-turbo-preview**: Latest model with enhanced capabilities
|
127
|
+
- **kimi-k2-turbo-preview**: Turbo version of the advanced reasoning model
|
128
|
+
|
129
|
+
### OpenAI Models
|
130
|
+
- **gpt-5**: Latest GPT model with advanced capabilities
|
131
|
+
- **gpt-4.1**: High-performance model for complex tasks
|
132
|
+
- **gpt-4o**: Optimized for speed and cost
|
133
|
+
- **o3-mini**: Reasoning-focused model
|
134
|
+
|
135
|
+
### IBM WatsonX Models
|
136
|
+
- **ibm/granite-3-3-8b-instruct**: IBM's latest Granite 3.3 8B Instruct model (default)
|
137
|
+
- **ibm/granite-3-8b-instruct**: IBM's Granite 3 8B Instruct model
|
138
|
+
- **meta-llama/llama-3-3-70b-instruct**: Meta Llama 3.3 70B hosted on WatsonX
|
139
|
+
- **meta-llama/llama-3-1-70b-instruct**: Meta Llama 3.1 70B hosted on WatsonX
|
140
|
+
- **mistralai/mistral-large-2407**: Latest Mistral Large model hosted on WatsonX
|
141
|
+
|
142
|
+
## Next Steps
|
143
|
+
|
144
|
+
1. **Explore tools**: Run `janito --list-tools` to see available tools
|
145
|
+
2. **Try chat mode**: Run `janito --chat` for interactive sessions
|
146
|
+
3. **Check examples**: Look at the main README.md for more usage examples
|
147
|
+
4. **Join community**: Get help and share tips with other users
|
148
|
+
|
149
|
+
## Troubleshooting
|
150
|
+
|
151
|
+
### Common Issues
|
152
|
+
|
153
|
+
**"Provider not found" error**
|
154
|
+
```bash
|
155
|
+
# Check available providers
|
156
|
+
janito --list-providers
|
157
|
+
|
158
|
+
# Re-register your provider
|
159
|
+
janito --set-api-key YOUR_KEY -p YOUR_PROVIDER
|
160
|
+
```
|
161
|
+
|
162
|
+
**"Model not available" error**
|
163
|
+
```bash
|
164
|
+
# List available models for your provider
|
165
|
+
janito -p YOUR_PROVIDER --list-models
|
166
|
+
```
|
167
|
+
|
168
|
+
**API key issues**
|
169
|
+
```bash
|
170
|
+
# Check current configuration
|
171
|
+
janito --show-config
|
172
|
+
|
173
|
+
# Reset API key
|
174
|
+
janito --set-api-key NEW_KEY -p YOUR_PROVIDER
|
175
|
+
```
|
176
|
+
|
177
|
+
**IBM WatsonX specific issues**
|
178
|
+
```bash
|
179
|
+
# Check if project ID is set
|
180
|
+
janito --show-config
|
181
|
+
|
182
|
+
# Set project ID if missing
|
183
|
+
janito --set-config ibm project_id YOUR_PROJECT_ID
|
184
|
+
```
|
185
|
+
|
186
|
+
### Getting Help
|
187
|
+
|
188
|
+
- Check the main README.md for comprehensive documentation
|
189
|
+
- Use `janito --help` for command-line options
|
190
190
|
- Visit our GitHub repository for issues and discussions
|