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
janito/README.md
CHANGED
@@ -1,192 +1,192 @@
|
|
1
|
-
# Janito CLI
|
2
|
-
|
3
|
-
A powerful command-line tool for running LLM-powered workflows with built-in tool execution capabilities.
|
4
|
-
|
5
|
-
## Quick Start
|
6
|
-
|
7
|
-
### Installation
|
8
|
-
|
9
|
-
```bash
|
10
|
-
pip install janito
|
11
|
-
```
|
12
|
-
|
13
|
-
### First-Time Setup
|
14
|
-
|
15
|
-
1. **Get your API key**: Sign up at [Moonshot AI](https://platform.moonshot.cn/) and get your API key
|
16
|
-
2. **Set your API key**:
|
17
|
-
```bash
|
18
|
-
janito --set-api-key YOUR_MOONSHOT_API_KEY -p moonshot
|
19
|
-
```
|
20
|
-
|
21
|
-
### Basic Usage
|
22
|
-
|
23
|
-
**Moonshot (Recommended - Default Provider)**
|
24
|
-
```bash
|
25
|
-
# Using the default provider (moonshot) and model
|
26
|
-
janito "Create a Python script that reads a CSV file"
|
27
|
-
|
28
|
-
# Using a specific Moonshot model
|
29
|
-
janito -m kimi-k1-8k "Explain quantum computing"
|
30
|
-
```
|
31
|
-
|
32
|
-
**Other Providers**
|
33
|
-
```bash
|
34
|
-
# OpenAI
|
35
|
-
janito -p openai -m gpt-4 "Write a React component"
|
36
|
-
|
37
|
-
# Anthropic
|
38
|
-
janito -p anthropic -m claude-3-5-sonnet-20241022 "Analyze this code"
|
39
|
-
|
40
|
-
# Google
|
41
|
-
janito -p google -m gemini-2.0-flash-exp "Generate unit tests"
|
42
|
-
```
|
43
|
-
|
44
|
-
### Interactive Chat Mode
|
45
|
-
|
46
|
-
Start an interactive session (default mode):
|
47
|
-
```bash
|
48
|
-
janito
|
49
|
-
```
|
50
|
-
|
51
|
-
Or explicitly:
|
52
|
-
```bash
|
53
|
-
janito --chat
|
54
|
-
```
|
55
|
-
|
56
|
-
In chat mode, you can:
|
57
|
-
|
58
|
-
- Have multi-turn conversations
|
59
|
-
- Execute code and commands
|
60
|
-
- Read and write files
|
61
|
-
- Use built-in tools
|
62
|
-
|
63
|
-
### Available Commands
|
64
|
-
|
65
|
-
- `janito --list-providers` - List all supported providers
|
66
|
-
- `janito --list-models` - List all available models
|
67
|
-
- `janito --list-tools` - List available tools
|
68
|
-
- `janito --show-config` - Show current configuration
|
69
|
-
|
70
|
-
### Configuration
|
71
|
-
|
72
|
-
Set default provider and model:
|
73
|
-
```bash
|
74
|
-
janito --set provider=moonshot
|
75
|
-
janito --set model=kimi-k1-8k
|
76
|
-
```
|
77
|
-
|
78
|
-
## Providers
|
79
|
-
|
80
|
-
### Moonshot (Recommended)
|
81
|
-
|
82
|
-
- **Models**: kimi-k1-8k, kimi-k1-32k, kimi-k1-128k, kimi-k2-turbo-preview
|
83
|
-
- **Strengths**: Excellent Chinese/English support, competitive pricing, fast responses
|
84
|
-
- **Setup**: Get API key from [Moonshot AI Platform](https://platform.moonshot.cn/)
|
85
|
-
|
86
|
-
### OpenAI
|
87
|
-
|
88
|
-
- **Models**: gpt-5, gpt-4.1, gpt-4o, gpt-4-turbo, gpt-3.5-turbo
|
89
|
-
- **Setup**: Get API key from [OpenAI Platform](https://platform.openai.com/)
|
90
|
-
|
91
|
-
### Anthropic
|
92
|
-
|
93
|
-
- **Models**: claude-3-7-sonnet-20250219, claude-3-5-sonnet-20241022, claude-3-opus-20250514
|
94
|
-
- **Setup**: Get API key from [Anthropic Console](https://console.anthropic.com/)
|
95
|
-
|
96
|
-
### IBM WatsonX
|
97
|
-
|
98
|
-
- **Models**: ibm/granite-3-8b-instruct, ibm/granite-3-2b-instruct, meta-llama/llama-3-1-8b-instruct, meta-llama/llama-3-1-70b-instruct, mistralai/mistral-large
|
99
|
-
- **Strengths**: Enterprise-grade AI, IBM Granite models, hosted Llama and Mistral models
|
100
|
-
- **Setup**: Get API key and project ID from [IBM Cloud](https://cloud.ibm.com/)
|
101
|
-
|
102
|
-
### Google
|
103
|
-
|
104
|
-
- **Models**: gemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-lite-preview-06-17
|
105
|
-
- **Setup**: Get API key from [Google AI Studio](https://makersuite.google.com/)
|
106
|
-
|
107
|
-
## Advanced Features
|
108
|
-
|
109
|
-
### Tool Usage
|
110
|
-
|
111
|
-
Janito includes powerful built-in tools for:
|
112
|
-
|
113
|
-
- File operations (read, write, search)
|
114
|
-
- Code execution
|
115
|
-
- Web scraping
|
116
|
-
- System commands
|
117
|
-
- And more...
|
118
|
-
|
119
|
-
### Profiles
|
120
|
-
Use predefined system prompts:
|
121
|
-
```bash
|
122
|
-
janito --developer "Create a REST API" # Same as --profile developer
|
123
|
-
janito --market "Analyze market trends" # Same as --profile market-analyst
|
124
|
-
```
|
125
|
-
|
126
|
-
### Environment Variables
|
127
|
-
You can also configure via environment variables:
|
128
|
-
|
129
|
-
**Moonshot:**
|
130
|
-
```bash
|
131
|
-
export MOONSHOT_API_KEY=your_key_here
|
132
|
-
export JANITO_PROVIDER=moonshot
|
133
|
-
export JANITO_MODEL=kimi-k1-8k
|
134
|
-
```
|
135
|
-
|
136
|
-
**OpenAI:**
|
137
|
-
```bash
|
138
|
-
export OPENAI_API_KEY=your_key_here
|
139
|
-
export JANITO_PROVIDER=openai
|
140
|
-
export JANITO_MODEL=gpt-5
|
141
|
-
```
|
142
|
-
|
143
|
-
**IBM WatsonX:**
|
144
|
-
```bash
|
145
|
-
export WATSONX_API_KEY=your_key_here
|
146
|
-
export WATSONX_PROJECT_ID=your_project_id
|
147
|
-
export WATSONX_SPACE_ID=your_space_id # optional
|
148
|
-
export JANITO_PROVIDER=ibm
|
149
|
-
export JANITO_MODEL=ibm/granite-3-8b-instruct
|
150
|
-
```
|
151
|
-
|
152
|
-
**Anthropic:**
|
153
|
-
```bash
|
154
|
-
export ANTHROPIC_API_KEY=your_key_here
|
155
|
-
export JANITO_PROVIDER=anthropic
|
156
|
-
export JANITO_MODEL=claude-3-7-sonnet-20250219
|
157
|
-
```
|
158
|
-
|
159
|
-
**Google:**
|
160
|
-
```bash
|
161
|
-
export GOOGLE_API_KEY=your_key_here
|
162
|
-
export JANITO_PROVIDER=google
|
163
|
-
export JANITO_MODEL=gemini-2.5-flash
|
164
|
-
```
|
165
|
-
|
166
|
-
## Examples
|
167
|
-
|
168
|
-
### Code Generation
|
169
|
-
```bash
|
170
|
-
janito "Create a Python FastAPI application with user authentication"
|
171
|
-
```
|
172
|
-
|
173
|
-
### File Analysis
|
174
|
-
```bash
|
175
|
-
janito "Analyze the performance bottlenecks in my_app.py"
|
176
|
-
```
|
177
|
-
|
178
|
-
### Data Processing
|
179
|
-
```bash
|
180
|
-
janito "Process this CSV file and generate summary statistics"
|
181
|
-
```
|
182
|
-
|
183
|
-
### Web Development
|
184
|
-
```bash
|
185
|
-
janito "Create a responsive landing page with Tailwind CSS"
|
186
|
-
```
|
187
|
-
|
188
|
-
## Support
|
189
|
-
|
190
|
-
- **Documentation**: Check individual provider directories for detailed setup guides
|
191
|
-
- **Issues**: Report bugs and feature requests on GitHub
|
1
|
+
# Janito CLI
|
2
|
+
|
3
|
+
A powerful command-line tool for running LLM-powered workflows with built-in tool execution capabilities.
|
4
|
+
|
5
|
+
## Quick Start
|
6
|
+
|
7
|
+
### Installation
|
8
|
+
|
9
|
+
```bash
|
10
|
+
uv pip install janito
|
11
|
+
```
|
12
|
+
|
13
|
+
### First-Time Setup
|
14
|
+
|
15
|
+
1. **Get your API key**: Sign up at [Moonshot AI](https://platform.moonshot.cn/) and get your API key
|
16
|
+
2. **Set your API key**:
|
17
|
+
```bash
|
18
|
+
janito --set-api-key YOUR_MOONSHOT_API_KEY -p moonshot
|
19
|
+
```
|
20
|
+
|
21
|
+
### Basic Usage
|
22
|
+
|
23
|
+
**Moonshot (Recommended - Default Provider)**
|
24
|
+
```bash
|
25
|
+
# Using the default provider (moonshot) and model
|
26
|
+
janito "Create a Python script that reads a CSV file"
|
27
|
+
|
28
|
+
# Using a specific Moonshot model
|
29
|
+
janito -m kimi-k1-8k "Explain quantum computing"
|
30
|
+
```
|
31
|
+
|
32
|
+
**Other Providers**
|
33
|
+
```bash
|
34
|
+
# OpenAI
|
35
|
+
janito -p openai -m gpt-4 "Write a React component"
|
36
|
+
|
37
|
+
# Anthropic
|
38
|
+
janito -p anthropic -m claude-3-5-sonnet-20241022 "Analyze this code"
|
39
|
+
|
40
|
+
# Google
|
41
|
+
janito -p google -m gemini-2.0-flash-exp "Generate unit tests"
|
42
|
+
```
|
43
|
+
|
44
|
+
### Interactive Chat Mode
|
45
|
+
|
46
|
+
Start an interactive session (default mode):
|
47
|
+
```bash
|
48
|
+
janito
|
49
|
+
```
|
50
|
+
|
51
|
+
Or explicitly:
|
52
|
+
```bash
|
53
|
+
janito --chat
|
54
|
+
```
|
55
|
+
|
56
|
+
In chat mode, you can:
|
57
|
+
|
58
|
+
- Have multi-turn conversations
|
59
|
+
- Execute code and commands
|
60
|
+
- Read and write files
|
61
|
+
- Use built-in tools
|
62
|
+
|
63
|
+
### Available Commands
|
64
|
+
|
65
|
+
- `janito --list-providers` - List all supported providers
|
66
|
+
- `janito --list-models` - List all available models
|
67
|
+
- `janito --list-tools` - List available tools
|
68
|
+
- `janito --show-config` - Show current configuration
|
69
|
+
|
70
|
+
### Configuration
|
71
|
+
|
72
|
+
Set default provider and model:
|
73
|
+
```bash
|
74
|
+
janito --set provider=moonshot
|
75
|
+
janito --set model=kimi-k1-8k
|
76
|
+
```
|
77
|
+
|
78
|
+
## Providers
|
79
|
+
|
80
|
+
### Moonshot (Recommended)
|
81
|
+
|
82
|
+
- **Models**: kimi-k1-8k, kimi-k1-32k, kimi-k1-128k, kimi-k2-turbo-preview
|
83
|
+
- **Strengths**: Excellent Chinese/English support, competitive pricing, fast responses
|
84
|
+
- **Setup**: Get API key from [Moonshot AI Platform](https://platform.moonshot.cn/)
|
85
|
+
|
86
|
+
### OpenAI
|
87
|
+
|
88
|
+
- **Models**: gpt-5, gpt-4.1, gpt-4o, gpt-4-turbo, gpt-3.5-turbo
|
89
|
+
- **Setup**: Get API key from [OpenAI Platform](https://platform.openai.com/)
|
90
|
+
|
91
|
+
### Anthropic
|
92
|
+
|
93
|
+
- **Models**: claude-3-7-sonnet-20250219, claude-3-5-sonnet-20241022, claude-3-opus-20250514
|
94
|
+
- **Setup**: Get API key from [Anthropic Console](https://console.anthropic.com/)
|
95
|
+
|
96
|
+
### IBM WatsonX
|
97
|
+
|
98
|
+
- **Models**: ibm/granite-3-8b-instruct, ibm/granite-3-2b-instruct, meta-llama/llama-3-1-8b-instruct, meta-llama/llama-3-1-70b-instruct, mistralai/mistral-large
|
99
|
+
- **Strengths**: Enterprise-grade AI, IBM Granite models, hosted Llama and Mistral models
|
100
|
+
- **Setup**: Get API key and project ID from [IBM Cloud](https://cloud.ibm.com/)
|
101
|
+
|
102
|
+
### Google
|
103
|
+
|
104
|
+
- **Models**: gemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-lite-preview-06-17
|
105
|
+
- **Setup**: Get API key from [Google AI Studio](https://makersuite.google.com/)
|
106
|
+
|
107
|
+
## Advanced Features
|
108
|
+
|
109
|
+
### Tool Usage
|
110
|
+
|
111
|
+
Janito includes powerful built-in tools for:
|
112
|
+
|
113
|
+
- File operations (read, write, search)
|
114
|
+
- Code execution
|
115
|
+
- Web scraping
|
116
|
+
- System commands
|
117
|
+
- And more...
|
118
|
+
|
119
|
+
### Profiles
|
120
|
+
Use predefined system prompts:
|
121
|
+
```bash
|
122
|
+
janito --developer "Create a REST API" # Same as --profile developer
|
123
|
+
janito --market "Analyze market trends" # Same as --profile market-analyst
|
124
|
+
```
|
125
|
+
|
126
|
+
### Environment Variables
|
127
|
+
You can also configure via environment variables:
|
128
|
+
|
129
|
+
**Moonshot:**
|
130
|
+
```bash
|
131
|
+
export MOONSHOT_API_KEY=your_key_here
|
132
|
+
export JANITO_PROVIDER=moonshot
|
133
|
+
export JANITO_MODEL=kimi-k1-8k
|
134
|
+
```
|
135
|
+
|
136
|
+
**OpenAI:**
|
137
|
+
```bash
|
138
|
+
export OPENAI_API_KEY=your_key_here
|
139
|
+
export JANITO_PROVIDER=openai
|
140
|
+
export JANITO_MODEL=gpt-5
|
141
|
+
```
|
142
|
+
|
143
|
+
**IBM WatsonX:**
|
144
|
+
```bash
|
145
|
+
export WATSONX_API_KEY=your_key_here
|
146
|
+
export WATSONX_PROJECT_ID=your_project_id
|
147
|
+
export WATSONX_SPACE_ID=your_space_id # optional
|
148
|
+
export JANITO_PROVIDER=ibm
|
149
|
+
export JANITO_MODEL=ibm/granite-3-8b-instruct
|
150
|
+
```
|
151
|
+
|
152
|
+
**Anthropic:**
|
153
|
+
```bash
|
154
|
+
export ANTHROPIC_API_KEY=your_key_here
|
155
|
+
export JANITO_PROVIDER=anthropic
|
156
|
+
export JANITO_MODEL=claude-3-7-sonnet-20250219
|
157
|
+
```
|
158
|
+
|
159
|
+
**Google:**
|
160
|
+
```bash
|
161
|
+
export GOOGLE_API_KEY=your_key_here
|
162
|
+
export JANITO_PROVIDER=google
|
163
|
+
export JANITO_MODEL=gemini-2.5-flash
|
164
|
+
```
|
165
|
+
|
166
|
+
## Examples
|
167
|
+
|
168
|
+
### Code Generation
|
169
|
+
```bash
|
170
|
+
janito "Create a Python FastAPI application with user authentication"
|
171
|
+
```
|
172
|
+
|
173
|
+
### File Analysis
|
174
|
+
```bash
|
175
|
+
janito "Analyze the performance bottlenecks in my_app.py"
|
176
|
+
```
|
177
|
+
|
178
|
+
### Data Processing
|
179
|
+
```bash
|
180
|
+
janito "Process this CSV file and generate summary statistics"
|
181
|
+
```
|
182
|
+
|
183
|
+
### Web Development
|
184
|
+
```bash
|
185
|
+
janito "Create a responsive landing page with Tailwind CSS"
|
186
|
+
```
|
187
|
+
|
188
|
+
## Support
|
189
|
+
|
190
|
+
- **Documentation**: Check individual provider directories for detailed setup guides
|
191
|
+
- **Issues**: Report bugs and feature requests on GitHub
|
192
192
|
- **Discord**: Join our community for help and discussions
|
janito/_version.py
CHANGED
@@ -1,55 +1,55 @@
|
|
1
|
-
"""Version handling for Janito.
|
2
|
-
Attempts to obtain the package version in the following order:
|
3
|
-
1. If a janito.version module exists (generated when the package is built with
|
4
|
-
setuptools-scm), use the version attribute from that module.
|
5
|
-
2. Ask importlib.metadata for the installed distribution version – works for
|
6
|
-
both regular and editable installs handled by pip.
|
7
|
-
3. Fall back to calling setuptools_scm.get_version() directly, using the git
|
8
|
-
repository when running from source without an installed distribution.
|
9
|
-
4. If everything else fails, return the literal string ``"unknown"`` so that
|
10
|
-
the application continues to work even when the version cannot be
|
11
|
-
determined.
|
12
|
-
|
13
|
-
This layered approach guarantees that a meaningful version string is returned
|
14
|
-
in most development and production scenarios while keeping Janito free from
|
15
|
-
hard-coded version numbers.
|
16
|
-
"""
|
17
|
-
|
18
|
-
from __future__ import annotations
|
19
|
-
|
20
|
-
import pathlib
|
21
|
-
from importlib import metadata as importlib_metadata
|
22
|
-
|
23
|
-
__all__ = ["__version__"]
|
24
|
-
|
25
|
-
|
26
|
-
# 1. "janito.version" (generated at build time by setuptools-scm)
|
27
|
-
try:
|
28
|
-
from . import version as _generated_version # type: ignore
|
29
|
-
|
30
|
-
__version__: str = _generated_version.version # pytype: disable=module-attr
|
31
|
-
except ImportError: # pragma: no cover – not available in editable installs
|
32
|
-
|
33
|
-
def _resolve_version() -> str:
|
34
|
-
"""Resolve the version string using several fallbacks."""
|
35
|
-
|
36
|
-
# 2. importlib.metadata – works for both regular and `pip install -e`.
|
37
|
-
try:
|
38
|
-
return importlib_metadata.version("janito")
|
39
|
-
except importlib_metadata.PackageNotFoundError:
|
40
|
-
pass # Not installed – probably running from a source checkout.
|
41
|
-
|
42
|
-
# 3. setuptools_scm – query the VCS metadata directly.
|
43
|
-
try:
|
44
|
-
from setuptools_scm import get_version # Imported lazily.
|
45
|
-
|
46
|
-
package_root = pathlib.Path(__file__).resolve().parent.parent
|
47
|
-
return get_version(root=str(package_root), relative_to=__file__)
|
48
|
-
except Exception: # pragma: no cover – any failure here falls through
|
49
|
-
# Either setuptools_scm is not available or this is not a git repo.
|
50
|
-
pass
|
51
|
-
|
52
|
-
# 4. Ultimate fallback – return a placeholder.
|
53
|
-
return "unknown"
|
54
|
-
|
55
|
-
__version__ = _resolve_version()
|
1
|
+
"""Version handling for Janito.
|
2
|
+
Attempts to obtain the package version in the following order:
|
3
|
+
1. If a janito.version module exists (generated when the package is built with
|
4
|
+
setuptools-scm), use the version attribute from that module.
|
5
|
+
2. Ask importlib.metadata for the installed distribution version – works for
|
6
|
+
both regular and editable installs handled by pip.
|
7
|
+
3. Fall back to calling setuptools_scm.get_version() directly, using the git
|
8
|
+
repository when running from source without an installed distribution.
|
9
|
+
4. If everything else fails, return the literal string ``"unknown"`` so that
|
10
|
+
the application continues to work even when the version cannot be
|
11
|
+
determined.
|
12
|
+
|
13
|
+
This layered approach guarantees that a meaningful version string is returned
|
14
|
+
in most development and production scenarios while keeping Janito free from
|
15
|
+
hard-coded version numbers.
|
16
|
+
"""
|
17
|
+
|
18
|
+
from __future__ import annotations
|
19
|
+
|
20
|
+
import pathlib
|
21
|
+
from importlib import metadata as importlib_metadata
|
22
|
+
|
23
|
+
__all__ = ["__version__"]
|
24
|
+
|
25
|
+
|
26
|
+
# 1. "janito.version" (generated at build time by setuptools-scm)
|
27
|
+
try:
|
28
|
+
from . import version as _generated_version # type: ignore
|
29
|
+
|
30
|
+
__version__: str = _generated_version.version # pytype: disable=module-attr
|
31
|
+
except ImportError: # pragma: no cover – not available in editable installs
|
32
|
+
|
33
|
+
def _resolve_version() -> str:
|
34
|
+
"""Resolve the version string using several fallbacks."""
|
35
|
+
|
36
|
+
# 2. importlib.metadata – works for both regular and `uv pip install -e`.
|
37
|
+
try:
|
38
|
+
return importlib_metadata.version("janito")
|
39
|
+
except importlib_metadata.PackageNotFoundError:
|
40
|
+
pass # Not installed – probably running from a source checkout.
|
41
|
+
|
42
|
+
# 3. setuptools_scm – query the VCS metadata directly.
|
43
|
+
try:
|
44
|
+
from setuptools_scm import get_version # Imported lazily.
|
45
|
+
|
46
|
+
package_root = pathlib.Path(__file__).resolve().parent.parent
|
47
|
+
return get_version(root=str(package_root), relative_to=__file__)
|
48
|
+
except Exception: # pragma: no cover – any failure here falls through
|
49
|
+
# Either setuptools_scm is not available or this is not a git repo.
|
50
|
+
pass
|
51
|
+
|
52
|
+
# 4. Ultimate fallback – return a placeholder.
|
53
|
+
return "unknown"
|
54
|
+
|
55
|
+
__version__ = _resolve_version()
|