janito 0.1.0__py3-none-any.whl → 0.2.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.
janito/__init__.py CHANGED
@@ -1,6 +1,14 @@
1
-
2
1
  """
3
2
  Janito - Language-Driven Software Development Assistant
4
3
  """
4
+ from .version import __version__
5
+ from .console import JanitoConsole
6
+ import sys
5
7
 
6
- __version__ = "0.1.0"
8
+ def main():
9
+ if len(sys.argv) > 1 and sys.argv[1] in ['--version', '-v']:
10
+ print(f"Janito version {__version__}")
11
+ return
12
+
13
+ console = JanitoConsole()
14
+ console.run()
janito/__main__.py CHANGED
@@ -2,8 +2,7 @@
2
2
  Entry point for Janito package.
3
3
  Allows running the application using 'python -m janito'.
4
4
  """
5
-
6
- from janito.janito import run_cli
5
+ from . import main
7
6
 
8
7
  if __name__ == '__main__':
9
- run_cli()
8
+ main()
janito/console.py CHANGED
@@ -104,18 +104,28 @@ class JanitoConsole:
104
104
  self._setup_file_watcher()
105
105
  self._setup_signal_handlers()
106
106
  self._load_history()
107
+
108
+ # Print welcome message after initialization
109
+ from janito import __version__
110
+ print(f"\nWelcome to Janito v{__version__} - your friendly AI coding assistant!")
111
+ print("Type '.help' to see available commands.")
112
+ print("")
107
113
 
108
114
  def _load_history(self):
109
115
  """Load command history from file"""
110
116
  try:
111
- if self.janito and self.janito.workspace.history_file.exists():
112
- with open(self.janito.workspace.history_file) as f:
113
- # Clear existing history first
114
- readline.clear_history()
115
- for line in f:
116
- line = line.strip()
117
- if line: # Only add non-empty lines
118
- readline.add_history(line)
117
+ if self.janito and self.janito.workspace.history_file:
118
+ # Create parent directory if it doesn't exist
119
+ self.janito.workspace.history_file.parent.mkdir(parents=True, exist_ok=True)
120
+
121
+ if self.janito.workspace.history_file.exists():
122
+ with open(self.janito.workspace.history_file) as f:
123
+ # Clear existing history first
124
+ readline.clear_history()
125
+ for line in f:
126
+ line = line.strip()
127
+ if line: # Only add non-empty lines
128
+ readline.add_history(line)
119
129
  except Exception as e:
120
130
  print(f"Warning: Could not load command history: {e}")
121
131
 
@@ -128,19 +138,20 @@ class JanitoConsole:
128
138
  readline.add_history(new_command)
129
139
 
130
140
  history_path = self.janito.workspace.history_file
131
- history_path.parent.mkdir(exist_ok=True)
132
-
141
+ # Create parent directory if it doesn't exist
142
+ history_path.parent.mkdir(parents=True, exist_ok=True)
143
+
133
144
  # Get all history items
134
145
  history = []
135
146
  for i in range(readline.get_current_history_length()):
136
147
  item = readline.get_history_item(i + 1)
137
148
  if item and item.strip(): # Only save non-empty commands
138
149
  history.append(item)
139
-
150
+
140
151
  # Write to file
141
152
  with open(history_path, 'w') as f:
142
153
  f.write('\n'.join(history) + '\n')
143
-
154
+
144
155
  except Exception as e:
145
156
  print(f"Warning: Could not save command history: {e}")
146
157
 
@@ -299,7 +310,7 @@ class JanitoConsole:
299
310
 
300
311
  if command.startswith('$'):
301
312
  # Handle shell command
302
- self._execute_shell_command(command[1:].strip())
313
+ self._execute_shell_command(command[1:].trip())
303
314
  elif command.startswith('.'):
304
315
  parts = command.split()
305
316
  cmd, args = parts[0], parts[1:]
@@ -346,9 +357,4 @@ class JanitoConsole:
346
357
  if self.restart_requested:
347
358
  self.restart_process()
348
359
  else:
349
- self.cleanup_terminal()
350
-
351
- # Print welcome message after file watcher setup
352
- print("\nWelcome to Janito - your friendly AI coding assistant!")
353
- print("Type '.help' to see available commands.")
354
- print("")
360
+ self.cleanup_terminal()
janito/janito.py CHANGED
@@ -290,10 +290,12 @@ import traceback
290
290
  from pathlib import Path
291
291
  import os
292
292
  from janito.console import JanitoConsole
293
+ from rich.console import Console
293
294
 
294
295
  class CLI:
295
296
  """Command-line interface handler for Janito using Typer"""
296
297
  def __init__(self):
298
+ self.console = Console()
297
299
  self.app = typer.Typer(
298
300
  help="Janito - Language-Driven Software Development Assistant",
299
301
  add_completion=False,
@@ -303,6 +305,14 @@ class CLI:
303
305
 
304
306
  def _setup_commands(self):
305
307
  """Setup Typer commands"""
308
+ @self.app.callback(invoke_without_command=True)
309
+ def callback(version: bool = typer.Option(False, "--version", "-v", help="Show version and exit")):
310
+ """Janito - Language-Driven Software Development Assistant"""
311
+ if version:
312
+ from janito import __version__
313
+ self.console.print(f"Janito version {__version__}")
314
+ raise typer.Exit()
315
+
306
316
  @self.app.command()
307
317
  def start(
308
318
  workspace: Optional[str] = typer.Argument(None, help="Optional workspace directory to change to"),
janito/version.py ADDED
@@ -0,0 +1,3 @@
1
+
2
+ """Version information."""
3
+ __version__ = "0.0.0.dev0" # This will be replaced during release builds
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: janito
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Language-Driven Software Development Assistant powered by Claude AI
5
5
  Home-page: https://github.com/joaompinto/janito
6
6
  Author: João M. Pinto
@@ -59,17 +59,19 @@ python -m janito --no-watch # Disable file watching
59
59
 
60
60
  ### Commands
61
61
 
62
- - `.help` - Show help information
62
+ - `.help [command]` - Show help information. Specify a command for details.
63
63
  - `.exit` - Exit the console
64
- - `.clear` - Clear console output
65
- - `.debug` - Toggle debug mode
66
- - `.workspace` - Show workspace structure
64
+ - `.clear` - Clear console output
65
+ - `.debug` - Toggle debug mode
66
+ - `.workspace [--missing]` - Show workspace structure. Use --missing to show excluded files.
67
67
  - `.last` - Show last Claude response
68
68
  - `.show <file>` - Show file content with syntax highlighting
69
69
  - `.check` - Check workspace Python files for syntax errors
70
70
  - `.p <file>` - Run a Python file
71
71
  - `.python <file>` - Run a Python file (alias for .p)
72
72
  - `.edit <file>` - Open file in system editor
73
+ - `.missing` - Show files excluded from the workspace based on patterns
74
+ - `.edit <file>` - Open file in system editor
73
75
 
74
76
  ### Input Formats
75
77
 
@@ -1,19 +1,21 @@
1
- janito/__init__.py,sha256=y6hOI0whYLZTk73Uoq-dxcCGKdPmAH9Fa5ywXV4CIaM,87
2
- janito/__main__.py,sha256=e_8IHo0JtPt8lgS43UTUzkaIu47SZ8PjhOomNqrt6Q4,173
1
+ janito/__init__.py,sha256=ERPwbxNTrrvkQlsNoHG3MMcad2CFjHsqpZItal6c7GA,336
2
+ janito/__main__.py,sha256=NhDkW5aQlWwwwP8dpqGGisdJUmHUgo5nTkJ9l5AqRS0,154
3
3
  janito/change.py,sha256=4GueUiqKx6fqzmwaxTyj9n-rifyc54IUdoxmJHxnnBc,17898
4
4
  janito/claude.py,sha256=KFyhAqRKY0iUMiuazlpvPlR6uufJCkkxZx_Jxeqdu1w,4294
5
5
  janito/commands.py,sha256=CqP0oOA9Rl6siQT0mNo3jeB7ubZwSCxsmXLTA0ostAM,15305
6
- janito/console.py,sha256=-SqCPFBt-7gqROCWlkGUcmOAJGC1_YnS5cuwXZITHAk,14909
7
- janito/janito.py,sha256=bgddRXQNQj28scRYNhXPeA3T3Jh84A9EOZApZ_OD0us,13311
6
+ janito/console.py,sha256=tnQoiGPamyJS3qdLUmyPHGKTtIhBblW4M5SjBTqeaMM,15262
7
+ janito/janito.py,sha256=MEdgWJGI5-bOeTqXIQTLwUSL7cyyxDAoHkovcR2LS3E,13790
8
8
  janito/prompts.py,sha256=4TkFnam7Ya8sBUQ9k5iAt72Ca7-k9KPmKjaqilfCX6U,5879
9
+ janito/version.py,sha256=mZWztY6CLZn2XicnPnZiTkL4w68xcXjPGLN3gSvs-j0,101
9
10
  janito/watcher.py,sha256=8icD9XnHnYpy_XI_i5Dg6tHpw27ecJie2ZqpEo66COY,3363
10
11
  janito/workspace.py,sha256=do66QRQ2VIpMofJuyVUyS_Gp5WMDG-5XoNYm270Zv0s,6979
11
12
  janito/xmlchangeparser.py,sha256=kfMa9AntsPBhG_R2NHFU3DZsaRh5BXRREZCnCfR1SDs,8576
12
13
  tests/__init__.py,sha256=EjWgRAmKaumanB8t00SWGaTu2b7AuZNDiMxqYoAhVJI,26
13
14
  tests/conftest.py,sha256=_8lI6aTT2s1A14ggojPW-bI0imOj1JmXwdR1_2BPuCw,185
14
15
  tests/test_change.py,sha256=wqufymSOo4ypMorMpQk9oyJYeYgO6Zn1H2GhU1Wx2ls,12482
15
- janito-0.1.0.dist-info/LICENSE,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
16
- janito-0.1.0.dist-info/METADATA,sha256=ROEPyzYWR3q8ibD4bpLGQGTyQBGEkpRx0IyKxVFHfc0,2979
17
- janito-0.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
18
- janito-0.1.0.dist-info/top_level.txt,sha256=b9vGz4twQlT5Sx2aD5wtd9NbXg3N40FjXgGRpcbKGVQ,13
19
- janito-0.1.0.dist-info/RECORD,,
16
+ janito-0.2.0.dist-info/LICENSE,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
17
+ janito-0.2.0.dist-info/METADATA,sha256=hrkNw92tuq9Cv0QtfzAcgES232CxG8M3Cr3LickAxng,3188
18
+ janito-0.2.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
19
+ janito-0.2.0.dist-info/entry_points.txt,sha256=HOM68XH24TvqV0oKth0uz_GPMe_rXI1-zJ-y79XaJz4,39
20
+ janito-0.2.0.dist-info/top_level.txt,sha256=b9vGz4twQlT5Sx2aD5wtd9NbXg3N40FjXgGRpcbKGVQ,13
21
+ janito-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ janito = janito:main
File without changes