janito 0.14.0__py3-none-any.whl → 0.15.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.
@@ -97,9 +97,9 @@ def handle_view(args: Dict[str, Any]) -> Tuple[str, bool]:
97
97
 
98
98
  # Only print count if not in trust mode
99
99
  if not get_config().trust_mode:
100
- console.print(f"Found ", style="default", end="")
100
+ console.print(f"(", style="default", end="")
101
101
  console.print(f"{file_dir_count}", style="cyan", end="")
102
- console.print(" files and directories")
102
+ console.print(" files and directories returned)")
103
103
  return (output, False)
104
104
  except Exception as e:
105
105
  return (f"Error listing directory {path}: {str(e)}", True)
@@ -139,12 +139,18 @@ def handle_view(args: Dict[str, Any]) -> Tuple[str, bool]:
139
139
  line_num_str = f"{line_number:6d}\t{line}"
140
140
  numbered_content.append(line_num_str)
141
141
 
142
- # Check if we need to truncate the output
143
- MAX_LINES = 500 # Arbitrary limit for demonstration
142
+ # Check if we need to show a warning about large file
143
+ MAX_LINES = get_config().max_view_lines
144
144
  if len(numbered_content) > MAX_LINES:
145
- truncated_content = "".join(numbered_content[:MAX_LINES])
146
- print(truncated_content + "\n<response clipped>")
147
- return (truncated_content + "\n<response clipped>", False)
145
+ # Only print warning if not in trust mode
146
+ if not get_config().trust_mode:
147
+ console.print("(", style="default", end="")
148
+ console.print(f"{len(numbered_content)}", style="cyan", end="")
149
+ console.print(f" lines returned - warning: file exceeds recommended size of {MAX_LINES} lines)")
150
+
151
+ # Return the full content without truncation
152
+ content_to_print = "".join(numbered_content)
153
+ return (content_to_print, False)
148
154
 
149
155
  content_to_print = "".join(numbered_content)
150
156
 
@@ -152,7 +158,7 @@ def handle_view(args: Dict[str, Any]) -> Tuple[str, bool]:
152
158
  if not get_config().trust_mode:
153
159
  console.print("(", style="default", end="")
154
160
  console.print(f"{len(numbered_content)}", style="cyan", end="")
155
- console.print(")")
161
+ console.print(" lines returned)")
156
162
  # Return the content as a string without any Rich objects
157
163
  return (content_to_print, False)
158
164
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janito
3
- Version: 0.14.0
3
+ Version: 0.15.0
4
4
  Summary: Janito CLI tool
5
5
  Project-URL: Homepage, https://github.com/joaompinto/janito
6
6
  Author-email: João Pinto <lamego.pinto@gmail.com>
@@ -130,7 +130,7 @@ janito --continue "Please add one more line"
130
130
 
131
131
  # Continue a specific conversation using its message ID
132
132
  # (Janito displays the message ID after each conversation)
133
- janito --continue 'abc123def' 'Let's refine that code'
133
+ janito --continue "abc123def" "Let's refine that code"
134
134
 
135
135
  # Alternative way to continue a specific conversation
136
136
  janito --continue-id abc123def "Let's refine that code"
@@ -143,6 +143,18 @@ janito -s "You are a poetry expert who speaks in rhymes" "Write about coding"
143
143
  # Show current configuration and available profiles
144
144
  janito --show-config
145
145
 
146
+ # Set a local configuration value (applies to current workspace only)
147
+ janito --set-local-config "temperature=0.7"
148
+
149
+ # Set a global configuration value (applies to all workspaces by default)
150
+ janito --set-global-config "profile=creative"
151
+
152
+ # Reset local configuration
153
+ janito --reset-local-config
154
+
155
+ # Reset global configuration
156
+ janito --reset-global-config
157
+
146
158
  # You can press Ctrl+C at any time to interrupt a query
147
159
  # Interrupted conversations can be continued with --continue
148
160
  ```
@@ -150,13 +162,14 @@ janito --show-config
150
162
  ## 🔧 Available Tools
151
163
 
152
164
  Janito comes with several built-in tools:
153
- - 📄 `str_replace_editor` - View, create, and edit files
165
+ - 📄 `str_replace_editor` - View, create, and edit files with configurable display limits
154
166
  - 🔎 `find_files` - Find files matching patterns
155
167
  - 🗑️ `delete_file` - Delete files
156
168
  - 🔍 `search_text` - Search for text patterns in files
157
169
  - 🌐 `fetch_webpage` - Fetch and extract content from web pages
158
170
  - 📋 `move_file` - Move files from one location to another
159
171
  - 💻 `bash` - Execute bash commands with real-time output display
172
+ - 🧠 `think` - Tool to record thoughts for complex reasoning
160
173
 
161
174
  ## 📊 Usage Tracking
162
175
 
@@ -170,6 +183,24 @@ Janito includes a comprehensive token usage tracking system that helps you monit
170
183
  - Cache performance metrics with savings analysis
171
184
  - Line delta tracking for file modifications
172
185
 
186
+ ## 📄 Enhanced File Viewing
187
+
188
+ The str_replace_editor tool now includes improved file viewing capabilities:
189
+
190
+ - **Configurable Display Limits**: Set the maximum number of lines to display before showing a warning
191
+ - **Warning Instead of Truncation**: When a file exceeds the configured line limit, a warning is shown but the full content is still displayed
192
+ - **Customizable Limits**: Configure the `max_view_lines` setting to adjust the threshold (default: 500 lines)
193
+
194
+ ```bash
195
+ # Set a custom maximum view lines threshold globally
196
+ janito --set-global-config "max_view_lines=1000"
197
+
198
+ # Set a project-specific threshold
199
+ janito --set-local-config "max_view_lines=250"
200
+ ```
201
+
202
+ This improvement ensures you always see the complete file content while still being warned about potentially large files.
203
+
173
204
  ```bash
174
205
  # Show detailed token usage and cost information
175
206
  janito --show-tokens "Write a Python function to sort a list"
@@ -347,29 +378,73 @@ Janito automatically installs the following dependencies:
347
378
  Janito offers a variety of command-line options to customize its behavior:
348
379
 
349
380
  ```
350
- --verbose, -v Enable verbose mode with detailed output
351
- --show-tokens Show detailed token usage and pricing information
352
- --workspace, -w TEXT Set the workspace directory
353
- --set-config TEXT Configuration string in format 'key=value', e.g., 'temperature=0.7'
354
- --show-config Show current configuration
355
- --reset-config Reset configuration by removing the config file
356
- --set-api-key TEXT Set the Anthropic API key globally in the user's home directory
357
- --ask Enable ask mode which disables tools that perform changes
358
- --trust, -t Enable trust mode which suppresses tool outputs for concise execution
359
- --no-tools Disable all tools for this session (pure AI interaction)
360
- --temperature FLOAT Set the temperature for model generation (0.0 to 1.0)
361
- --profile TEXT Use a predefined parameter profile (precise, balanced, conversational, creative, technical)
362
- --role TEXT Set the assistant's role (default: 'software engineer')
363
- --system, -s TEXT Provide custom system instructions, bypassing the default file load method
364
- --version Show the version and exit
365
- --continue, -c TEXT Continue a conversation. Can be used as: 1) --continue (to continue most recent),
381
+ Arguments:
382
+ [QUERY] Query to send to the claudine agent
383
+
384
+ Options:
385
+ --verbose, -v Enable verbose mode with detailed output
386
+ --show-tokens, --tokens Show detailed token usage and pricing information
387
+ --workspace, -w TEXT Set the workspace directory
388
+ --set-local-config TEXT Set a local configuration value in format 'key=value' (overrides global config)
389
+ --set-global-config TEXT Set a global configuration value in format 'key=value' (used as default)
390
+ --show-config Show current configuration
391
+ --reset-local-config Reset local configuration by removing the local config file
392
+ --reset-global-config Reset global configuration by removing the global config file
393
+ --set-api-key TEXT Set the Anthropic API key globally in the user's home directory
394
+ --ask Enable ask mode which disables tools that perform changes
395
+ --trust, -t Enable trust mode which suppresses tool outputs for concise execution
396
+ --no-tools Disable all tools for this session (pure AI interaction)
397
+ --temperature FLOAT Set the temperature for model generation (0.0 to 1.0)
398
+ --profile TEXT Use a predefined parameter profile (precise, balanced, conversational, creative, technical)
399
+ --role TEXT Set the assistant's role (default: 'software engineer')
400
+ --system, -s TEXT Provide custom system instructions, bypassing the default file load method
401
+ --version Show the version and exit
402
+ --continue, -c [TEXT] Continue a conversation. Can be used as: 1) --continue (to continue most recent),
366
403
  2) --continue 123 (to continue conversation with ID 123), or
367
404
  3) --continue "query" (to continue most recent with new query)
368
- --continue-id TEXT Continue a specific conversation with the given ID
369
- --history Show a summary of conversations. Use --history for default (20) or --history n to specify count
370
- --help Show the help message and exit
405
+ --history [N] Show a summary of conversations. Use --history for default (20) or --history n to specify count
406
+ --help Show the help message and exit
407
+ ```
408
+
409
+ ## ⚙️ Configuration System
410
+
411
+ Janito uses a two-level configuration system with local and global settings:
412
+
413
+ ### Local vs Global Configuration
414
+
415
+ - **Local Configuration**: Stored in `.janito/config.json` in your current workspace directory
416
+ - **Global Configuration**: Stored in `~/.janito/config.json` in your home directory
417
+ - Local settings override global settings when both are present
418
+ - Use `--set-local-config` for project-specific settings and `--set-global-config` for user-wide defaults
419
+
420
+ ### Setting Configuration Values
421
+
422
+ ```bash
423
+ # Set a local configuration value (applies to current workspace only)
424
+ janito --set-local-config "temperature=0.7"
425
+
426
+ # Set a global configuration value (applies to all workspaces by default)
427
+ janito --set-global-config "profile=creative"
428
+
429
+ # Reset local configuration
430
+ janito --reset-local-config
431
+
432
+ # Reset global configuration
433
+ janito --reset-global-config
434
+
435
+ # View current configuration (shows both local and global settings)
436
+ janito --show-config
371
437
  ```
372
438
 
439
+ ### Configurable Settings
440
+
441
+ You can configure various settings including:
442
+ - `profile`: Parameter profile (precise, balanced, conversational, creative, technical)
443
+ - `temperature`: Model temperature (0.0 to 1.0)
444
+ - `role`: Assistant's role (default: 'software engineer')
445
+ - `ask_mode`: Enable/disable ask mode (true/false)
446
+ - `max_view_lines`: Maximum number of lines to display before showing a warning (default: 500)
447
+
373
448
  ## 🔑 API Key Configuration
374
449
 
375
450
  You can configure your Anthropic API key in several ways:
@@ -391,6 +466,16 @@ Your API key is securely stored and used for all future sessions.
391
466
 
392
467
  For development instructions, please refer to [README_DEV.md](README_DEV.md).
393
468
 
469
+ ## 💡 Use Cases
470
+
471
+ ### Debugging Code
472
+
473
+ Below is an example of using Janito to help fix a bug in your code:
474
+
475
+ ![Using Janito to fix a bug](docs/images/use_cases/fix_bug_example.png)
476
+
477
+ Simply describe the bug to Janito, and it will help you identify and fix the issue in your code.
478
+
394
479
  ## 📜 License
395
480
 
396
481
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -1,39 +1,50 @@
1
- janito/__init__.py,sha256=7oWOSdYGAlxA75CpzMThFPrXL2oWwJw60hTnRBxIo1A,53
1
+ janito/__init__.py,sha256=zsus-BGV8QuV6oDjBBKDMcceIgrr7KSYOcfkQBO657c,53
2
2
  janito/__main__.py,sha256=Oy-Nc1tZkpyvTKuq1R8oHSuJTkvptN6H93kIHBu7DKY,107
3
3
  janito/callbacks.py,sha256=E1FPXYHZUgiEGMabYuf999PSf_Su4ByHOWlc1-hMqWE,915
4
- janito/config.py,sha256=XZYVjHPTv41l0NyGHaeq3UKB5FyRNHSEuLui-_mv5BU,13821
5
4
  janito/token_report.py,sha256=Mks7o2yTxPChgQyBJNoQ5eMmrhSgEM4LKCKi2tHJbVo,9580
6
5
  janito/cli/__init__.py,sha256=dVi9l3E86YyukjxQ-XSUnMZkghnNasXex-X5XAOBiwk,85
7
6
  janito/cli/agent.py,sha256=gIkbQZHNcg8hH52ziqklhKY6EDSyl6URUbtRvQQHqyI,414
8
- janito/cli/app.py,sha256=QkH14BhnFQ2RgavLwxMKa9m_7C8KGoSuSjRNS3iYR1o,9477
7
+ janito/cli/app.py,sha256=8YfBD0aiJIbKLyS1OtQW8lxDQQIEwDaVetLzRqsiqKg,9394
9
8
  janito/cli/commands.py,sha256=M0DKCFZMS1mXA-s9Lm_4Ug7LJFlNg12fBdcDOhCnIWg,380
10
9
  janito/cli/output.py,sha256=mo3hUokhrD4SWexUjCbLGGQeCDUf0369DA_i9BW7HjU,933
11
10
  janito/cli/utils.py,sha256=gO4NtCNwtEzYDsQesrFlqB5FtYuw87yGwo4iG3nINgw,661
12
11
  janito/cli/agent/__init__.py,sha256=3O3b_MnwX_-qApYlyXzXhdjT4-dHzfxpOAy1lK_ZAIE,250
13
12
  janito/cli/agent/conversation.py,sha256=iif8ciIbsb_HZaZ6qvK40s0PyW3QmriZ1Q7PtUqKfI4,5644
14
- janito/cli/agent/initialization.py,sha256=-7APIAk0gawVVrxd1AdeBwffEuudvy1bIhDE6LMXfw4,6583
15
- janito/cli/agent/query.py,sha256=Sly1k-cVOydTPraUmdSPKxFYrScmCOd8BfAqFUvWwkg,4612
13
+ janito/cli/agent/initialization.py,sha256=7EOdNAUvzx9SAwTaXSgl-qxzqwR_IsUJ475eLJdkY4M,6344
14
+ janito/cli/agent/query.py,sha256=zblUqyy6JjmA7d2JH8sjah4Kf4iNHBgrImb4d5joxLk,4920
16
15
  janito/cli/commands/__init__.py,sha256=4zGGB0x-TeBetSArBV38SZQo0T1K59vJofhXhLiD3g0,331
17
- janito/cli/commands/config.py,sha256=U1Bnc_YSMwFkX-1dcksmdgsoH2_yrO8MSYTaESxR-sQ,9819
16
+ janito/cli/commands/config.py,sha256=P-ScO3_PZvlny_nlTANNzLCbExAZejQIa2Zi9VJXyP4,827
18
17
  janito/cli/commands/history.py,sha256=WzWgPRZ7mQwlbDCPw3Hapb-K_Ybk1uKLs-qLams6sO4,5409
19
- janito/cli/commands/profile.py,sha256=jsGKSqXlaSLE__Xjj9OKNTW68evU0APyK9QYr_OEELQ,2397
18
+ janito/cli/commands/profile.py,sha256=_N2jaCe5sb5CbWkX5MK2tSbqkDMwDjY-g9barusVGCI,3679
20
19
  janito/cli/commands/validation.py,sha256=ldtfk0vAOkrto1Ys6G0MDmUOQvYalHsTd_l_0fMVHcI,718
21
- janito/cli/commands/workspace.py,sha256=nSCrN3SSK4zq10x38uksaOMuzx___rnl-cmyVpvNlqk,909
22
- janito/data/instructions_template.txt,sha256=Ewfjk_1qRO178WEcRQVONnff6CpRAeKGE8JAydD39Qw,2143
20
+ janito/cli/commands/workspace.py,sha256=D1kDnUmSYkItVJUj7TQEKstMlj9n4TW-7F6-DngACwY,867
21
+ janito/config/README.md,sha256=-O5yJ6S9-G34Gkr7leopYKwvn56wxApAsciQvzQ7M8U,3840
22
+ janito/config/__init__.py,sha256=6cgEQmhc3lmHU0onB_id4H_ToU570w3WNNUpqamZJm8,627
23
+ janito/config/cli/__init__.py,sha256=7NsEWbKFYyHurtLLTBsFsfSaeSiO7_RDlfzI6DGqbiE,785
24
+ janito/config/cli/commands.py,sha256=YucCvzsF0KuIb0JyfuER1y3-3qTL-4QCADZEtpKOIv0,16231
25
+ janito/config/cli/validators.py,sha256=Wl0-b_P3sKZoZG9wiFQTcU27x11lCTdz5wXLbwVc7RE,2766
26
+ janito/config/core/__init__.py,sha256=TgaRaJ_qeG5oK3aEBZlPjOmTaUv22a1onHPz_91csao,531
27
+ janito/config/core/file_operations.py,sha256=il_xwyY45EAxzo0rCil0Vj_3V6BHI93-z4CpK_xKIL8,2723
28
+ janito/config/core/properties.py,sha256=vaPTCXypsZ-RyAVgQCId4OY1kOLUhZffX3uaorG7ygY,12098
29
+ janito/config/core/singleton.py,sha256=m5dIcryOK9TPDFtAWyMCDDZRQCQ9-KXRRhQlPySy3Dw,10417
30
+ janito/config/profiles/__init__.py,sha256=69l2e2kgy0wPqzpXWNZFrtJOnwLq6_22EUJHJs_rsm4,281
31
+ janito/config/profiles/definitions.py,sha256=KJZQHvK6bvgnfttI7w6BqD5-477Rc7Xk3ZXAm6FPz18,1112
32
+ janito/config/profiles/manager.py,sha256=oLx1RqIJPkmxrOXVvqWjYDZGEkWtX70uZN62kYYSD7k,2321
33
+ janito/data/instructions_template.txt,sha256=JCH6LO_9Uo5r7yD2gRJRuCQRxpKrVY42L5jJivfo_CI,2307
23
34
  janito/tools/__init__.py,sha256=mCtmWVFfgrk_SFWcwzw92O9Fb9P-5SYnO2rPMxkT5rM,1624
24
35
  janito/tools/decorators.py,sha256=Tp48n5y4LKsjyV3HeOA9wk2dV413RrEG-23kRyQVlKs,2522
25
36
  janito/tools/delete_file.py,sha256=UrZ5q59SIxWfuJcqgol6yPBqL-RhO9lFCF4MqAc6o00,2252
26
37
  janito/tools/find_files.py,sha256=c_N9ETcRPprQeuZYanwFnl-9E05ZqUYhNVoCRS5uqQg,8300
27
- janito/tools/move_file.py,sha256=FCs1ghalfHlXmcbAA_IlLcUll9hTOU1MMFGrTWopXvM,2741
38
+ janito/tools/move_file.py,sha256=EkSKFXY47HU7gNpLA4H4z7S3oD5iWkyb55iS2r6jB3E,2732
28
39
  janito/tools/prompt_user.py,sha256=OnTiWVBCbL_2MYu7oThlKr8X_pnYdG-dzxXSOgJF41c,1942
29
40
  janito/tools/replace_file.py,sha256=i4GoLtS14eKSU5lYI18mJ96S0_ekeHMwlQfazg-fxrM,2296
30
41
  janito/tools/rich_console.py,sha256=0zWYRF8qk4N-upuwswUSEfYFAfkEYDYeCgxst-czWtY,6044
31
42
  janito/tools/search_text.py,sha256=GXc8fuqKD6r0dEr2lMs5LrYYMM5RtTApvMXlvdt2ZiY,8839
32
43
  janito/tools/think.py,sha256=VsfYzYSfdBz6ayUYE8aoeAsdeN2PFpHjwUkxtaw1YYQ,1204
33
44
  janito/tools/usage_tracker.py,sha256=3qHXIs9rzm0oY2iaaFHqlLre6ZoWicZgOc46s6XyGc0,4681
34
- janito/tools/bash/bash.py,sha256=AFm0w_z-yyYRWxuR744OFpm5iCZaZpE-pWbnKbgajp4,3665
35
- janito/tools/bash/unix_persistent_bash.py,sha256=I59PPQiXHscPJ6Y7ev_83dLFNFWq1hKwAK9kFXdnbBY,7185
36
- janito/tools/bash/win_persistent_bash.py,sha256=96xm_yijjc6hBYfNluLahbvR2oUuHug_JkoMah7Hy38,12894
45
+ janito/tools/bash/bash.py,sha256=lY6OX7EgxkkBHmQpTwoe53onxfaA-z4UCE1hdRhqYos,6522
46
+ janito/tools/bash/unix_persistent_bash.py,sha256=PxwYU-YNTBixp4RgecoVPGnfqVNjy8u3ScIkzfQfT18,8522
47
+ janito/tools/bash/win_persistent_bash.py,sha256=aglpYIF6JZJiER5c2IBPqM5ufo096y96qtuzA34TKX8,14339
37
48
  janito/tools/fetch_webpage/__init__.py,sha256=Rnzni75VX1JfmGJ2LHckGWQqr7xC95wahh5Q-1PlncQ,514
38
49
  janito/tools/fetch_webpage/core.py,sha256=3Q8dAlWYMU_Mg8DyrNCBaLuriAxItSYIyGAcPZFktcI,7555
39
50
  janito/tools/str_replace_editor/__init__.py,sha256=kYmscmQgft3Jzt3oCNz7k2FiRbJvku6OFDDC3Q_zoAA,144
@@ -44,10 +55,10 @@ janito/tools/str_replace_editor/handlers/create.py,sha256=s8RQE04kDAL7OLZA8WxJkD
44
55
  janito/tools/str_replace_editor/handlers/insert.py,sha256=eKHodm2ozKUlRMxWMLAsu9ca6unUo1jfXWwHSld-pSU,4061
45
56
  janito/tools/str_replace_editor/handlers/str_replace.py,sha256=RciLTlA7R2PGljeeyluLcBHUAje9c1OCxm-bFE7j6iY,4473
46
57
  janito/tools/str_replace_editor/handlers/undo.py,sha256=3OIdAWkpXC2iDe94_sfx_WxEFh3a1cRzoP0NtPXq1Ks,2491
47
- janito/tools/str_replace_editor/handlers/view.py,sha256=k8F-n64bomHmDjavr5OJKC4cHhfm4_1-aMIFZdMICQo,6809
48
- janito/data/instructions_template.txt,sha256=Ewfjk_1qRO178WEcRQVONnff6CpRAeKGE8JAydD39Qw,2143
49
- janito-0.14.0.dist-info/METADATA,sha256=VzEC8lrwVeAhFxZDGripkjFcCm8CoHAjJFAh_OchFo0,14074
50
- janito-0.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- janito-0.14.0.dist-info/entry_points.txt,sha256=JMbF_1jg-xQddidpAYkzjOKdw70fy_ymJfcmerY2wIY,47
52
- janito-0.14.0.dist-info/licenses/LICENSE,sha256=6-H8LXExbBIAuT4cyiE-Qy8Bad1K4pagQRVTWr6wkhk,1096
53
- janito-0.14.0.dist-info/RECORD,,
58
+ janito/tools/str_replace_editor/handlers/view.py,sha256=5NEdWM53oqofdbQNw3DU86icai2BWdf0WzeIAgZIzzg,7158
59
+ janito/data/instructions_template.txt,sha256=JCH6LO_9Uo5r7yD2gRJRuCQRxpKrVY42L5jJivfo_CI,2307
60
+ janito-0.15.0.dist-info/METADATA,sha256=9ZODZE5o2a45v78I2ptNveo8vAGr9l-_fK2d7ywkmaE,17212
61
+ janito-0.15.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
+ janito-0.15.0.dist-info/entry_points.txt,sha256=JMbF_1jg-xQddidpAYkzjOKdw70fy_ymJfcmerY2wIY,47
63
+ janito-0.15.0.dist-info/licenses/LICENSE,sha256=6-H8LXExbBIAuT4cyiE-Qy8Bad1K4pagQRVTWr6wkhk,1096
64
+ janito-0.15.0.dist-info/RECORD,,