sharkit 0.2.1.dev1__tar.gz → 0.2.1.dev3__tar.gz
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.
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/PKG-INFO +1 -1
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/pyproject.toml +1 -1
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/commands/builtins.py +82 -21
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/output/renderer.py +4 -1
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/manager.py +15 -1
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/osint/recon/hybrid/blackbird.py +1 -1
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/.gitignore +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/LICENSE +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/README.md +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/__main__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/app.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/commands/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/commands/base.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/commands/registry.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/config/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/config/manager.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/config/paths.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/console/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/console/completion.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/console/prompt.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/console/repl.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/exceptions.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/history/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/history/manager.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/network/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/network/client.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/output/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/output/theme.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/__init__.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/base.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/loader.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/osint/recon/username/maigret.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/osint/recon/username/sherlock.py +0 -0
- {sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/registry.py +0 -0
|
@@ -193,10 +193,16 @@ class UseCommand(Command):
|
|
|
193
193
|
self._log(context, f'Tool "{name}" is not installed. Run: install {name}')
|
|
194
194
|
return None
|
|
195
195
|
renderer = context.session.get("renderer")
|
|
196
|
+
first_progress = [True]
|
|
196
197
|
|
|
197
198
|
def on_progress(msg: str) -> None:
|
|
198
199
|
if renderer is not None:
|
|
199
|
-
|
|
200
|
+
tag = f"install {display}"
|
|
201
|
+
if first_progress[0]:
|
|
202
|
+
renderer.gutter(tag, msg, GREEN, is_first=True)
|
|
203
|
+
first_progress[0] = False
|
|
204
|
+
else:
|
|
205
|
+
renderer.gutter(tag, msg, GREEN, is_first=False)
|
|
200
206
|
|
|
201
207
|
ok, message = tool_manager.install(name, spec, on_progress=on_progress)
|
|
202
208
|
if not ok:
|
|
@@ -633,24 +639,42 @@ class InstallCommand(Command):
|
|
|
633
639
|
tool_cls = tool_registry.get_tool(name)
|
|
634
640
|
if tool_cls is None or tool_cls.metadata.install is None:
|
|
635
641
|
return f'Tool "{name}" is not an external tool or was not found.'
|
|
636
|
-
|
|
637
|
-
|
|
642
|
+
tool_name = tool_cls.metadata.name
|
|
643
|
+
display = tool_registry.format_display(tool_registry.get_tool_path(tool_name))
|
|
644
|
+
if tool_manager.is_installed(tool_name):
|
|
638
645
|
renderer = context.session.get("renderer")
|
|
639
646
|
if renderer is not None:
|
|
640
647
|
renderer.log_line(f"install {display}", "already installed", color=GREEN)
|
|
641
648
|
return None
|
|
642
649
|
renderer = context.session.get("renderer")
|
|
650
|
+
first_progress = [True]
|
|
643
651
|
|
|
644
652
|
def on_progress(msg: str) -> None:
|
|
645
653
|
if renderer is not None:
|
|
646
|
-
|
|
654
|
+
tag = f"install {display}"
|
|
655
|
+
if first_progress[0]:
|
|
656
|
+
renderer.gutter(tag, msg, GREEN, is_first=True)
|
|
657
|
+
first_progress[0] = False
|
|
658
|
+
else:
|
|
659
|
+
renderer.gutter(tag, msg, GREEN, is_first=False)
|
|
647
660
|
|
|
648
|
-
|
|
661
|
+
install_spec = tool_cls.metadata.install
|
|
662
|
+
ok, message = tool_manager.install(
|
|
663
|
+
tool_name, install_spec, on_progress=on_progress
|
|
664
|
+
)
|
|
649
665
|
if renderer is not None:
|
|
666
|
+
tag = f"install {display}"
|
|
650
667
|
if ok:
|
|
651
|
-
|
|
668
|
+
msg = "installed"
|
|
669
|
+
elif message == "Aborted":
|
|
670
|
+
msg = "aborted"
|
|
671
|
+
print("\r\033[K", end="")
|
|
672
|
+
else:
|
|
673
|
+
msg = f"failed: {message}"
|
|
674
|
+
if first_progress[0]:
|
|
675
|
+
renderer.log_line(tag, msg, color=GREEN)
|
|
652
676
|
else:
|
|
653
|
-
renderer.
|
|
677
|
+
renderer.gutter(tag, msg, GREEN, is_first=False)
|
|
654
678
|
return None
|
|
655
679
|
return str(message)
|
|
656
680
|
|
|
@@ -677,24 +701,42 @@ class UpgradeCommand(Command):
|
|
|
677
701
|
tool_cls = tool_registry.get_tool(name)
|
|
678
702
|
if tool_cls is None or tool_cls.metadata.install is None:
|
|
679
703
|
return f'Tool "{name}" is not an external tool or was not found.'
|
|
680
|
-
|
|
681
|
-
|
|
704
|
+
tool_name = tool_cls.metadata.name
|
|
705
|
+
display = tool_registry.format_display(tool_registry.get_tool_path(tool_name))
|
|
706
|
+
if not tool_manager.is_installed(tool_name):
|
|
682
707
|
renderer = context.session.get("renderer")
|
|
683
708
|
if renderer is not None:
|
|
684
709
|
renderer.log_line(f"upgrade {display}", "not installed (skipped)", color=BLUE)
|
|
685
710
|
return None
|
|
686
711
|
renderer = context.session.get("renderer")
|
|
712
|
+
first_progress = [True]
|
|
687
713
|
|
|
688
714
|
def on_progress(msg: str) -> None:
|
|
689
715
|
if renderer is not None:
|
|
690
|
-
|
|
716
|
+
tag = f"upgrade {display}"
|
|
717
|
+
if first_progress[0]:
|
|
718
|
+
renderer.gutter(tag, msg, BLUE, is_first=True)
|
|
719
|
+
first_progress[0] = False
|
|
720
|
+
else:
|
|
721
|
+
renderer.gutter(tag, msg, BLUE, is_first=False)
|
|
691
722
|
|
|
692
|
-
|
|
723
|
+
upgrade_spec = tool_cls.metadata.install
|
|
724
|
+
ok, message = tool_manager.update(
|
|
725
|
+
tool_name, upgrade_spec, on_progress=on_progress
|
|
726
|
+
)
|
|
693
727
|
if renderer is not None:
|
|
728
|
+
tag = f"upgrade {display}"
|
|
694
729
|
if ok:
|
|
695
|
-
|
|
730
|
+
msg = "upgraded"
|
|
731
|
+
elif message == "Aborted":
|
|
732
|
+
msg = "aborted"
|
|
733
|
+
print("\r\033[K", end="")
|
|
734
|
+
else:
|
|
735
|
+
msg = f"failed: {message}"
|
|
736
|
+
if first_progress[0]:
|
|
737
|
+
renderer.log_line(tag, msg, color=BLUE)
|
|
696
738
|
else:
|
|
697
|
-
renderer.
|
|
739
|
+
renderer.gutter(tag, msg, BLUE, is_first=False)
|
|
698
740
|
return None
|
|
699
741
|
return str(message)
|
|
700
742
|
|
|
@@ -727,17 +769,35 @@ class UpgradeCommand(Command):
|
|
|
727
769
|
renderer.log_line(f"upgrade {display}", "not installed (skipped)", color=BLUE)
|
|
728
770
|
continue
|
|
729
771
|
renderer = context.session.get("renderer")
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
772
|
+
first_progress = [True]
|
|
773
|
+
|
|
774
|
+
def on_progress(
|
|
775
|
+
msg: str,
|
|
776
|
+
_first: list[bool] = first_progress,
|
|
777
|
+
_tag: str = f"upgrade {display}",
|
|
778
|
+
_renderer: Any = renderer,
|
|
779
|
+
) -> None:
|
|
780
|
+
if _renderer is not None:
|
|
781
|
+
if _first[0]:
|
|
782
|
+
_renderer.gutter(_tag, msg, BLUE, is_first=True)
|
|
783
|
+
_first[0] = False
|
|
784
|
+
else:
|
|
785
|
+
_renderer.gutter(_tag, msg, BLUE, is_first=False)
|
|
734
786
|
|
|
735
787
|
ok, message = tool_manager.update(name, spec, on_progress=on_progress)
|
|
736
788
|
if renderer is not None:
|
|
789
|
+
tag = f"upgrade {display}"
|
|
737
790
|
if ok:
|
|
738
|
-
|
|
791
|
+
msg = "upgraded"
|
|
792
|
+
elif message == "Aborted":
|
|
793
|
+
msg = "aborted"
|
|
794
|
+
print("\r\033[K", end="")
|
|
795
|
+
else:
|
|
796
|
+
msg = f"failed: {message}"
|
|
797
|
+
if first_progress[0]:
|
|
798
|
+
renderer.log_line(tag, msg, color=BLUE)
|
|
739
799
|
else:
|
|
740
|
-
renderer.
|
|
800
|
+
renderer.gutter(tag, msg, BLUE, is_first=False)
|
|
741
801
|
return None
|
|
742
802
|
|
|
743
803
|
|
|
@@ -759,9 +819,10 @@ class RemoveCommand(Command):
|
|
|
759
819
|
tool_cls = tool_registry.get_tool(name)
|
|
760
820
|
if tool_cls is None or tool_cls.metadata.install is None:
|
|
761
821
|
return f'Tool "{name}" is not an external tool or was not found.'
|
|
762
|
-
|
|
822
|
+
tool_name = tool_cls.metadata.name
|
|
823
|
+
display = tool_registry.format_display(tool_registry.get_tool_path(tool_name))
|
|
763
824
|
renderer = context.session.get("renderer")
|
|
764
|
-
ok, message = tool_manager.uninstall(
|
|
825
|
+
ok, message = tool_manager.uninstall(tool_name)
|
|
765
826
|
if renderer is not None:
|
|
766
827
|
if ok:
|
|
767
828
|
renderer.log_line(f"remove {display}", "removed", color=RED)
|
|
@@ -253,7 +253,10 @@ class Renderer:
|
|
|
253
253
|
print(text, end="")
|
|
254
254
|
|
|
255
255
|
def log_line(self, tag: str, message: str, color: str = PINK) -> None:
|
|
256
|
-
|
|
256
|
+
lines = message.splitlines() or [""]
|
|
257
|
+
self.gutter(tag, lines[0], color, is_first=True)
|
|
258
|
+
for line in lines[1:]:
|
|
259
|
+
print(f"{color}{BOLD}│{RESET} {line}")
|
|
257
260
|
|
|
258
261
|
def gutter(self, name: str, line: str, color: str, is_first: bool) -> None:
|
|
259
262
|
if is_first:
|
|
@@ -54,7 +54,11 @@ class ToolManager:
|
|
|
54
54
|
self._run([pip, "install", *spec.pip_args])
|
|
55
55
|
dest.joinpath(".installed").write_text(name)
|
|
56
56
|
return True, f'Tool "{name}" installed.'
|
|
57
|
+
except KeyboardInterrupt:
|
|
58
|
+
shutil.rmtree(dest, ignore_errors=True)
|
|
59
|
+
return False, "Aborted"
|
|
57
60
|
except Exception as e:
|
|
61
|
+
shutil.rmtree(dest, ignore_errors=True)
|
|
58
62
|
return False, f'Failed to install "{name}": {e}'
|
|
59
63
|
|
|
60
64
|
def update(
|
|
@@ -82,6 +86,8 @@ class ToolManager:
|
|
|
82
86
|
on_progress("upgrading packages...")
|
|
83
87
|
self._run([pip, "install", "--upgrade", *spec.pip_args])
|
|
84
88
|
return True, f'Tool "{name}" updated.'
|
|
89
|
+
except KeyboardInterrupt:
|
|
90
|
+
return False, "Aborted"
|
|
85
91
|
except Exception as e:
|
|
86
92
|
return False, f'Failed to update "{name}": {e}'
|
|
87
93
|
|
|
@@ -96,4 +102,12 @@ class ToolManager:
|
|
|
96
102
|
return False, f'Failed to uninstall "{name}": {e}'
|
|
97
103
|
|
|
98
104
|
def _run(self, cmd: list[str]) -> None:
|
|
99
|
-
subprocess.run(cmd,
|
|
105
|
+
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
106
|
+
if result.returncode != 0:
|
|
107
|
+
stderr = result.stderr.strip() if result.stderr else ""
|
|
108
|
+
stdout = result.stdout.strip() if result.stdout else ""
|
|
109
|
+
raw = stderr or stdout or "No output"
|
|
110
|
+
# Truncate long build output — keep last 20 lines where the actual error lives
|
|
111
|
+
lines = raw.splitlines()
|
|
112
|
+
detail = "\n".join(lines[-20:]) if len(lines) > 20 else raw
|
|
113
|
+
raise RuntimeError(detail)
|
|
@@ -107,7 +107,7 @@ class BlackbirdTool(Tool):
|
|
|
107
107
|
success=False,
|
|
108
108
|
error="Both 'type' and 'query' options are required.",
|
|
109
109
|
)
|
|
110
|
-
args = [f"--{stype}", query
|
|
110
|
+
args = [f"--{stype}", query]
|
|
111
111
|
if parse_bool(context.options.get("pdf")):
|
|
112
112
|
args.append("--pdf")
|
|
113
113
|
renderer = context.renderer
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sharkit-0.2.1.dev1 → sharkit-0.2.1.dev3}/src/sharkit/tools/osint/recon/username/sherlock.py
RENAMED
|
File without changes
|
|
File without changes
|