kapsel-cli 0.5.2__tar.gz → 0.5.4__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.
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/PKG-INFO +1 -1
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/__init__.py +1 -1
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/__init__.py +6 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/plugin_switch.py +109 -7
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/status.py +16 -1
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/catalog.py +32 -1
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/fetcher.py +47 -0
- kapsel_cli-0.5.4/kapsel/locales/en/help.yaml +181 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/en/tips.yaml +19 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/zh_CN/help.yaml +39 -8
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/PKG-INFO +1 -1
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/SOURCES.txt +1 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/pyproject.toml +1 -1
- kapsel_cli-0.5.4/tests/test_plugin_backup.py +161 -0
- kapsel_cli-0.5.2/kapsel/locales/en/help.yaml +0 -118
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/README.md +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/__main__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/cli.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/carapace_engine.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/carapace_installer.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/completer.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/add.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/completion.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/config.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/datadir.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/dir_nav.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/help.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/language.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/search.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/toggle.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/builtins/upgrade.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/dispatcher.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/kps/registry.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/completion/spec_manager.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/block/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/block/model.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/block/registry.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/block/runner.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/detector.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/engine.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/executor.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/i18n.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/base.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/context.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/hooks.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/core/plugin/manager.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/i18n.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/de/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/de/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/de/help.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/de/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/es/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/es/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/es/help.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/es/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/fr/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/fr/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/fr/help.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/fr/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ja/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ja/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ja/help.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ja/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/kapsel.pot +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ru/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ru/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ru/help.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/ru/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/zh_CN/LC_MESSAGES/kapsel.mo +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/zh_CN/LC_MESSAGES/kapsel.po +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/locales/zh_CN/tips.yaml +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/storage/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/storage/config.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/storage/history.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/storage/logger.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/storage/migrate.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/__init__.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/banner.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/card.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/prompt.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/theme.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/tips.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel/ui/viewport.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/dependency_links.txt +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/entry_points.txt +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/requires.txt +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/kapsel_cli.egg-info/top_level.txt +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/setup.cfg +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_block_system.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_carapace_installer.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_config.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_dir_nav.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_history.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_i18n.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_ai.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_alias.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_autopilot.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_commit.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_fetcher.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_init.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_install.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_lang.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_portal.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_preview.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_queue.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_template.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_plugin_trans.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_search_and_completions.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_spec_manager.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_toggle.py +0 -0
- {kapsel_cli-0.5.2 → kapsel_cli-0.5.4}/tests/test_upgrade.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kapsel-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: Next-generation cross-platform terminal capsule & ergonomic shell multiplexer with context-aware command translation and 1,000+ CLI completions.
|
|
5
5
|
Author-email: MrEiu <k648888@vip.qq.com>
|
|
6
6
|
License: MIT
|
|
@@ -153,7 +153,13 @@ def register_builtins(registry: "KpsCommandRegistry") -> None:
|
|
|
153
153
|
# 9. upgrade & update (Kapsel Core & official plugins)
|
|
154
154
|
from kapsel.completion.kps.builtins.upgrade import handle_upgrade
|
|
155
155
|
|
|
156
|
+
# Merge catalog entries with locally installed plugins so enable/disable/upgrade
|
|
157
|
+
# completions reflect the actual filesystem state (e.g. workspace dev plugins).
|
|
158
|
+
from kapsel.completion.kps.builtins.plugin_switch import get_all_installed_plugins
|
|
156
159
|
plugin_subcommands = {k: v for k, v in add_subcommands.items() if k != "update"}
|
|
160
|
+
for p in get_all_installed_plugins():
|
|
161
|
+
if p not in plugin_subcommands and p not in ("update", "all"):
|
|
162
|
+
plugin_subcommands[p] = f"Plugin: {p}"
|
|
157
163
|
|
|
158
164
|
registry.register(
|
|
159
165
|
name="upgrade",
|
|
@@ -36,17 +36,69 @@ def get_all_installed_plugins() -> List[str]:
|
|
|
36
36
|
return sorted(installed)
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
def _render_plugin_status_table(con: Console) -> None:
|
|
40
|
+
"""Renders a full overview table of all installed plugins with enabled/disabled status."""
|
|
41
|
+
from rich.table import Table
|
|
42
|
+
from kapsel.core.plugin.catalog import _extract_plugin_version, _extract_plugin_description
|
|
43
|
+
from kapsel.storage.config import get_kapsel_dir
|
|
44
|
+
from pathlib import Path
|
|
45
|
+
|
|
46
|
+
cfg = load_config()
|
|
47
|
+
enabled_set = set(p.lower() for p in (cfg.enabled_plugins or []))
|
|
48
|
+
all_installed = get_all_installed_plugins()
|
|
49
|
+
|
|
50
|
+
table = Table(
|
|
51
|
+
title="[bold #00f0ff]🧩 Kapsel Plugin Status Overview[/]",
|
|
52
|
+
border_style="#0891b2",
|
|
53
|
+
header_style="bold #00f0ff",
|
|
54
|
+
show_header=True,
|
|
55
|
+
expand=False,
|
|
56
|
+
)
|
|
57
|
+
table.add_column("Plugin", style="bold #a855f7", width=16)
|
|
58
|
+
table.add_column("Version", style="dim #9ca3af", width=10)
|
|
59
|
+
table.add_column("Status", width=14)
|
|
60
|
+
table.add_column("Description", style="#e4e4e7")
|
|
61
|
+
|
|
62
|
+
for name in all_installed:
|
|
63
|
+
# Resolve version & description from actual plugin dir
|
|
64
|
+
ver, desc = "0.1.0", f"Plugin: {name}"
|
|
65
|
+
for base in (Path.cwd() / "plugins", get_kapsel_dir() / "plugins"):
|
|
66
|
+
p_dir = base / name
|
|
67
|
+
if p_dir.is_dir():
|
|
68
|
+
v = _extract_plugin_version(p_dir)
|
|
69
|
+
d = _extract_plugin_description(p_dir)
|
|
70
|
+
if v:
|
|
71
|
+
ver = v
|
|
72
|
+
if d:
|
|
73
|
+
desc = d
|
|
74
|
+
break
|
|
75
|
+
|
|
76
|
+
if not enabled_set or name in enabled_set:
|
|
77
|
+
status = "[bold #10b981]● Enabled[/]"
|
|
78
|
+
else:
|
|
79
|
+
status = "[dim #6b7280]○ Disabled[/]"
|
|
80
|
+
|
|
81
|
+
table.add_row(name, f"v{ver}", status, desc)
|
|
82
|
+
|
|
83
|
+
con.print()
|
|
84
|
+
con.print(table)
|
|
85
|
+
con.print(
|
|
86
|
+
f"[dim]Run [bold #00f0ff]kapsel enable <plugin>[/] or "
|
|
87
|
+
f"[bold #f43f5e]kapsel disable <plugin>[/] to toggle.[/]\n"
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
39
91
|
def handle_enable_plugin(args: List[str], console: Optional[Console] = None) -> int:
|
|
40
92
|
"""
|
|
41
93
|
Enables one or more installed Kapsel plugins.
|
|
42
94
|
Usage:
|
|
43
95
|
kapsel enable <plugin_name>
|
|
96
|
+
kapsel enable (shows full plugin status table)
|
|
44
97
|
"""
|
|
45
98
|
con = console or Console(legacy_windows=False)
|
|
46
99
|
if not args:
|
|
47
|
-
con
|
|
48
|
-
|
|
49
|
-
return 1
|
|
100
|
+
_render_plugin_status_table(con)
|
|
101
|
+
return 0
|
|
50
102
|
|
|
51
103
|
target = args[0].strip().lower()
|
|
52
104
|
cfg = load_config()
|
|
@@ -88,13 +140,63 @@ def handle_enable_plugin(args: List[str], console: Optional[Console] = None) ->
|
|
|
88
140
|
except Exception:
|
|
89
141
|
pass
|
|
90
142
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
143
|
+
# Build status card
|
|
144
|
+
from rich.table import Table as _Table
|
|
145
|
+
from rich.panel import Panel as _Panel
|
|
146
|
+
from kapsel.core.plugin.catalog import _extract_plugin_version, _extract_plugin_description
|
|
147
|
+
from pathlib import Path as _Path
|
|
148
|
+
from kapsel.storage.config import get_kapsel_dir as _get_dir
|
|
149
|
+
|
|
150
|
+
# Resolve version & description from actual plugin files first
|
|
151
|
+
ver, desc = None, None
|
|
152
|
+
for base in (_Path.cwd() / "plugins", _get_dir() / "plugins"):
|
|
153
|
+
p_dir = base / target
|
|
154
|
+
if p_dir.is_dir():
|
|
155
|
+
ver = _extract_plugin_version(p_dir)
|
|
156
|
+
desc = _extract_plugin_description(p_dir)
|
|
157
|
+
break
|
|
158
|
+
if not ver:
|
|
159
|
+
ver = load_plugin_catalog_rich().get(target, {}).get("version", "0.1.0")
|
|
160
|
+
if not desc:
|
|
161
|
+
desc = load_plugin_catalog_rich().get(target, {}).get("description", f"Plugin: {target}")
|
|
162
|
+
|
|
163
|
+
# Collect subcommands from live registry if available
|
|
164
|
+
subcommands: dict = {}
|
|
165
|
+
try:
|
|
166
|
+
from kapsel.completion.kps.registry import get_kps_registry
|
|
167
|
+
cmd_entry = get_kps_registry().get(target)
|
|
168
|
+
if cmd_entry:
|
|
169
|
+
subcommands = cmd_entry.subcommands or {}
|
|
170
|
+
except Exception:
|
|
171
|
+
pass
|
|
172
|
+
|
|
173
|
+
grid = _Table.grid(padding=(0, 2))
|
|
174
|
+
grid.add_column(style="bold #a855f7", width=14)
|
|
175
|
+
grid.add_column(style="#e4e4e7")
|
|
176
|
+
|
|
177
|
+
grid.add_row("Plugin:", f"[bold #00f0ff]{target}[/] [dim]v{ver}[/]")
|
|
178
|
+
grid.add_row("Description:", desc)
|
|
179
|
+
grid.add_row("Status:", "[bold #10b981]✔ Enabled[/]")
|
|
180
|
+
grid.add_row("Run:", f"[bold #38bdf8]kps {target} [dim][command][/][/]")
|
|
181
|
+
|
|
182
|
+
if subcommands:
|
|
183
|
+
grid.add_row("Commands:", "")
|
|
184
|
+
for sub, sub_desc in list(subcommands.items())[:8]:
|
|
185
|
+
grid.add_row("", f" [bold #38bdf8]{sub:<16}[/] [dim]{sub_desc}[/]")
|
|
186
|
+
if len(subcommands) > 8:
|
|
187
|
+
grid.add_row("", f" [dim]... and {len(subcommands) - 8} more[/]")
|
|
188
|
+
|
|
189
|
+
con.print(_Panel(
|
|
190
|
+
grid,
|
|
191
|
+
title=f"[bold #00f0ff]🔌 Plugin Enabled: {target}[/]",
|
|
192
|
+
border_style="#0891b2",
|
|
193
|
+
padding=(1, 2),
|
|
194
|
+
expand=False,
|
|
195
|
+
))
|
|
95
196
|
return 0
|
|
96
197
|
|
|
97
198
|
|
|
199
|
+
|
|
98
200
|
def handle_disable_plugin(args: List[str], console: Optional[Console] = None) -> int:
|
|
99
201
|
"""
|
|
100
202
|
Disables one or more active Kapsel plugins.
|
|
@@ -115,11 +115,26 @@ def handle_status(args: Optional[List[str]] = None, console: Optional[Console] =
|
|
|
115
115
|
active_plugins = [p.lower() for p in enabled_plugins]
|
|
116
116
|
|
|
117
117
|
if active_plugins:
|
|
118
|
+
from kapsel.core.plugin.catalog import _extract_plugin_version
|
|
119
|
+
from kapsel.storage.config import get_kapsel_dir as _get_dir
|
|
120
|
+
|
|
121
|
+
def _get_plugin_version(name: str) -> str:
|
|
122
|
+
# 1. Try actual plugin directory (workspace dev or global)
|
|
123
|
+
for base in (Path.cwd() / "plugins", _get_dir() / "plugins"):
|
|
124
|
+
p = base / name
|
|
125
|
+
if p.is_dir():
|
|
126
|
+
v = _extract_plugin_version(p)
|
|
127
|
+
if v and v != "0.1.0":
|
|
128
|
+
return v
|
|
129
|
+
# 2. Fallback to catalog metadata
|
|
130
|
+
return rich_catalog.get(name, {}).get("version", "0.1.0")
|
|
131
|
+
|
|
118
132
|
plugin_badges = [
|
|
119
|
-
f"[bold #00f0ff]{p}[/][dim]@{
|
|
133
|
+
f"[bold #00f0ff]{p}[/][dim]@{_get_plugin_version(p)}[/]"
|
|
120
134
|
for p in active_plugins
|
|
121
135
|
]
|
|
122
136
|
plugins_str = ", ".join(plugin_badges)
|
|
137
|
+
|
|
123
138
|
else:
|
|
124
139
|
plugins_str = f"[dim]{none_str}[/]"
|
|
125
140
|
|
|
@@ -108,7 +108,37 @@ def load_plugin_catalog_rich() -> Dict[str, Dict[str, Any]]:
|
|
|
108
108
|
except Exception:
|
|
109
109
|
pass
|
|
110
110
|
|
|
111
|
-
# If file not present yet,
|
|
111
|
+
# If file not present yet, try to fetch from remote repository before falling back to defaults
|
|
112
|
+
try:
|
|
113
|
+
from kapsel.core.plugin.fetcher import fetch_remote_catalog
|
|
114
|
+
remote_data = fetch_remote_catalog()
|
|
115
|
+
if remote_data and isinstance(remote_data, dict):
|
|
116
|
+
result = {}
|
|
117
|
+
for k, v in remote_data.items():
|
|
118
|
+
if k.startswith(("_", "$")):
|
|
119
|
+
continue
|
|
120
|
+
if isinstance(v, dict):
|
|
121
|
+
result[k] = {
|
|
122
|
+
"version": v.get("version", "0.1.0"),
|
|
123
|
+
"description": v.get("description", f"Plugin {k}"),
|
|
124
|
+
"changelog": v.get("changelog", ""),
|
|
125
|
+
}
|
|
126
|
+
else:
|
|
127
|
+
result[k] = {
|
|
128
|
+
"version": "0.1.0",
|
|
129
|
+
"description": str(v),
|
|
130
|
+
"changelog": "",
|
|
131
|
+
}
|
|
132
|
+
result.setdefault("update", {
|
|
133
|
+
"version": "0.1.0",
|
|
134
|
+
"description": "Scan and update available plugin catalog and completion dictionary",
|
|
135
|
+
"changelog": "Catalog dictionary update scanner.",
|
|
136
|
+
})
|
|
137
|
+
return result
|
|
138
|
+
except Exception:
|
|
139
|
+
pass
|
|
140
|
+
|
|
141
|
+
# Final fallback: built-in DEFAULT_CATALOG (offline / import error)
|
|
112
142
|
return {
|
|
113
143
|
k: {
|
|
114
144
|
"version": "0.2.0" if k in ("alias", "install") else "0.1.0",
|
|
@@ -119,6 +149,7 @@ def load_plugin_catalog_rich() -> Dict[str, Dict[str, Any]]:
|
|
|
119
149
|
}
|
|
120
150
|
|
|
121
151
|
|
|
152
|
+
|
|
122
153
|
def _extract_plugin_version(plugin_dir: Path) -> str:
|
|
123
154
|
"""Extracts version string from plugin manifest, pyproject.toml, or __init__.py."""
|
|
124
155
|
# 1. Try reading manifest in plugin.py
|
|
@@ -154,3 +154,50 @@ def fetch_plugin_from_remote(
|
|
|
154
154
|
f"from official repository (https://github.com/MrEiu/plugins)."
|
|
155
155
|
)
|
|
156
156
|
return False
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
OFFICIAL_CATALOG_URL = "https://raw.githubusercontent.com/MrEiu/plugins/master/catalog.json"
|
|
160
|
+
OFFICIAL_CATALOG_MIRROR_URL = "https://ghproxy.net/https://raw.githubusercontent.com/MrEiu/plugins/master/catalog.json"
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def fetch_remote_catalog(console: Optional[Console] = None) -> Optional[dict]:
|
|
164
|
+
"""
|
|
165
|
+
Fetches the latest catalog.json from the official remote repository.
|
|
166
|
+
Tries direct GitHub raw URL first, then mirror fallback.
|
|
167
|
+
On success, writes to the local global cache and returns the parsed dict.
|
|
168
|
+
Returns None if all attempts fail (offline / unreachable).
|
|
169
|
+
"""
|
|
170
|
+
import json as _json
|
|
171
|
+
from kapsel.storage.config import get_kapsel_dir
|
|
172
|
+
|
|
173
|
+
con = console or Console(legacy_windows=False)
|
|
174
|
+
headers = {"User-Agent": "Kapsel-Plugin-Fetcher/1.0"}
|
|
175
|
+
|
|
176
|
+
for url, label in [
|
|
177
|
+
(OFFICIAL_CATALOG_URL, "GitHub"),
|
|
178
|
+
(OFFICIAL_CATALOG_MIRROR_URL, "Mirror"),
|
|
179
|
+
]:
|
|
180
|
+
try:
|
|
181
|
+
req = urllib.request.Request(url, headers=headers)
|
|
182
|
+
with urllib.request.urlopen(req, timeout=8.0) as resp:
|
|
183
|
+
if resp.status == 200:
|
|
184
|
+
raw = resp.read().decode("utf-8")
|
|
185
|
+
data = _json.loads(raw)
|
|
186
|
+
if isinstance(data, dict):
|
|
187
|
+
# Write to local cache so subsequent calls skip network
|
|
188
|
+
global_cache = get_kapsel_dir() / "plugins_catalog.json"
|
|
189
|
+
try:
|
|
190
|
+
global_cache.parent.mkdir(parents=True, exist_ok=True)
|
|
191
|
+
global_cache.write_text(
|
|
192
|
+
_json.dumps(data, indent=2, ensure_ascii=False) + "\n",
|
|
193
|
+
encoding="utf-8",
|
|
194
|
+
)
|
|
195
|
+
except Exception as cache_err:
|
|
196
|
+
logger.debug(f"Failed to write remote catalog cache: {cache_err}")
|
|
197
|
+
logger.debug(f"Remote catalog fetched from {label} ({len(data)} entries).")
|
|
198
|
+
return data
|
|
199
|
+
except Exception as ex:
|
|
200
|
+
logger.debug(f"Remote catalog fetch failed from {label} ({url}): {ex}")
|
|
201
|
+
|
|
202
|
+
con.print("[dim]Could not reach remote catalog; using built-in defaults.[/]")
|
|
203
|
+
return None
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Kapsel System Manual & Cheatsheet (English)
|
|
2
|
+
meta:
|
|
3
|
+
title: "KAPSEL"
|
|
4
|
+
subtitle: "User Manual & Fast Command Cheatsheet"
|
|
5
|
+
architecture: "Unified Command Pipeline: 'kapsel <cmd>' and 'kps <cmd>' share the exact same execution engine."
|
|
6
|
+
version_prefix: "v"
|
|
7
|
+
|
|
8
|
+
modes:
|
|
9
|
+
title: "🚀 Core Interaction Dual Modes"
|
|
10
|
+
columns:
|
|
11
|
+
mode: "Mode"
|
|
12
|
+
trigger: "Trigger"
|
|
13
|
+
description: "Behavior & Capabilities"
|
|
14
|
+
rows:
|
|
15
|
+
- name: "Native Mode"
|
|
16
|
+
trigger: "Direct command input"
|
|
17
|
+
description: "100% native host execution (git, docker, npm, python, vim) with Carapace dynamic context-aware completion."
|
|
18
|
+
- name: "Kapsel Mode"
|
|
19
|
+
trigger: "Prefix 'kapsel ' or 'kps '"
|
|
20
|
+
description: "Unified capsule commands (help, status, config, language, add, enable, toggle, and plugin extensions); Tab opens candidates."
|
|
21
|
+
|
|
22
|
+
quickstart:
|
|
23
|
+
title: "⚡ Quick Start Workflow"
|
|
24
|
+
items:
|
|
25
|
+
- step: "1. Launch Interactive Shell"
|
|
26
|
+
cmd: "kapsel toggle"
|
|
27
|
+
desc: "Opens the smart capsule shell with real-time autocompletion and command history."
|
|
28
|
+
- step: "2. Native Pass-Through"
|
|
29
|
+
cmd: "git checkout -b feature"
|
|
30
|
+
desc: "Run any native command without friction. Carapace provides live branch and flag completions."
|
|
31
|
+
- step: "3. Inspect Host Status"
|
|
32
|
+
cmd: "kapsel status"
|
|
33
|
+
desc: "Inspect OS platform, active shell, Git branch, completion engine, and active plugin roster."
|
|
34
|
+
- step: "4. Browse & Install Plugins"
|
|
35
|
+
cmd: "kapsel enable"
|
|
36
|
+
desc: "View all installed plugins with enabled/disabled status. Use 'kapsel enable <name>' to activate one."
|
|
37
|
+
- step: "5. Safely Exit"
|
|
38
|
+
cmd: "exit"
|
|
39
|
+
desc: "Returns cleanly to your host terminal without residual background processes."
|
|
40
|
+
|
|
41
|
+
commands:
|
|
42
|
+
title: "⚙️ Capsule Core & Tool Command Suite (kapsel / kps)"
|
|
43
|
+
columns:
|
|
44
|
+
command: "Command"
|
|
45
|
+
description: "Description"
|
|
46
|
+
origin: "Origin"
|
|
47
|
+
builtin_rows:
|
|
48
|
+
- name: "kapsel help"
|
|
49
|
+
desc: "Display comprehensive manual, modes, keybindings, and cheatsheets"
|
|
50
|
+
origin: "Core"
|
|
51
|
+
- name: "kapsel status"
|
|
52
|
+
desc: "Inspect OS platform, active host shell, Git branch, completion engine, and active plugin roster"
|
|
53
|
+
origin: "Core"
|
|
54
|
+
- name: "kapsel config"
|
|
55
|
+
desc: "View, edit, get, set, or reload settings in ~/.kapsel/config.yaml"
|
|
56
|
+
origin: "Core"
|
|
57
|
+
- name: "kapsel search"
|
|
58
|
+
desc: "Fuzzy search across Kapsel repository plugins and metadata catalog"
|
|
59
|
+
origin: "Core"
|
|
60
|
+
- name: "kapsel language"
|
|
61
|
+
desc: "View and switch active UI language (en, zh_CN, ja, es, fr, de, ru)"
|
|
62
|
+
origin: "Core"
|
|
63
|
+
- name: "kapsel datadir"
|
|
64
|
+
desc: "View or migrate data sandbox storage directory with automatic data transfer"
|
|
65
|
+
origin: "Core"
|
|
66
|
+
- name: "kapsel add <plugin>"
|
|
67
|
+
desc: "Fetch, install dependencies and register a plugin into the Kapsel environment"
|
|
68
|
+
origin: "Core"
|
|
69
|
+
- name: "kapsel upgrade [name]"
|
|
70
|
+
desc: "Check and upgrade Kapsel Core and official plugins with release notes"
|
|
71
|
+
origin: "Core"
|
|
72
|
+
- name: "kapsel enable"
|
|
73
|
+
desc: "Show all installed plugins with enabled/disabled status overview table"
|
|
74
|
+
origin: "Core"
|
|
75
|
+
- name: "kapsel enable <plugin>"
|
|
76
|
+
desc: "Enable an installed Kapsel plugin and display its status card"
|
|
77
|
+
origin: "Core"
|
|
78
|
+
- name: "kapsel disable <plugin>"
|
|
79
|
+
desc: "Disable an active Kapsel plugin without removing its files"
|
|
80
|
+
origin: "Core"
|
|
81
|
+
- name: "kapsel completion"
|
|
82
|
+
desc: "Manage, inspect, and synchronize declarative Carapace completion specifications"
|
|
83
|
+
origin: "Core"
|
|
84
|
+
- name: "kapsel toggle"
|
|
85
|
+
desc: "Toggle interactive Kapsel terminal mode on or off"
|
|
86
|
+
origin: "Core"
|
|
87
|
+
- name: "kapsel dir"
|
|
88
|
+
desc: "Preview the current directory tree and display Ctrl+Arrow navigation shortcut hints"
|
|
89
|
+
origin: "Core"
|
|
90
|
+
- name: "kapsel rm <path>"
|
|
91
|
+
desc: "Safely and permanently delete a file or directory with explicit confirmation prompt"
|
|
92
|
+
origin: "Core"
|
|
93
|
+
- name: "exit / quit"
|
|
94
|
+
desc: "Safely exit Kapsel interactive capsule and return to host shell"
|
|
95
|
+
origin: "Core"
|
|
96
|
+
|
|
97
|
+
shortcuts:
|
|
98
|
+
title: "⌨️ Interactive Keybindings & Ergonomics"
|
|
99
|
+
columns:
|
|
100
|
+
key: "Key"
|
|
101
|
+
description: "Action"
|
|
102
|
+
items:
|
|
103
|
+
- key: "Tab"
|
|
104
|
+
desc: "Trigger completion menu; accept selected candidate; cycle to next suggestion"
|
|
105
|
+
- key: "Shift + Tab"
|
|
106
|
+
desc: "Cycle backwards through the completion candidate menu"
|
|
107
|
+
- key: "Enter"
|
|
108
|
+
desc: "Accept selected completion candidate, or execute the current command"
|
|
109
|
+
- key: "Ctrl + Enter / Alt + Enter"
|
|
110
|
+
desc: "Execute input as a background Command Block (auto-prepends 'kp' if needed)"
|
|
111
|
+
- key: "↑ (Up Arrow)"
|
|
112
|
+
desc: "In completion: browse up; at top: cancel completion and go back in history"
|
|
113
|
+
- key: "↓ (Down Arrow)"
|
|
114
|
+
desc: "In history: go forward; at origin: open completion and select first candidate"
|
|
115
|
+
- key: "→ (Single Tap)"
|
|
116
|
+
desc: "Accept one word of ghost suggestion, or complete the only active candidate"
|
|
117
|
+
- key: "→ (Hold / Rapid)"
|
|
118
|
+
desc: "Accept the entire ghost suggestion line at once"
|
|
119
|
+
- key: "Ctrl + → (Right)"
|
|
120
|
+
desc: "In input: jump one word forward; on empty line: expand subfolders in-place"
|
|
121
|
+
- key: "Ctrl + ← (Left)"
|
|
122
|
+
desc: "In input: jump one word backward; on empty line: cd .. (double-tap to confirm)"
|
|
123
|
+
- key: "Ctrl + ↑ (Up)"
|
|
124
|
+
desc: "Create a new empty file interactively at the current path"
|
|
125
|
+
- key: "Ctrl + ↓ (Down)"
|
|
126
|
+
desc: "Permanently delete selected file or folder (double-tap to confirm)"
|
|
127
|
+
- key: "Alt + ↑ (Up)"
|
|
128
|
+
desc: "Launch the interactive file manager (runs 'fm')"
|
|
129
|
+
- key: "Alt + ↓ (Down)"
|
|
130
|
+
desc: "Copy current prompt text to clipboard; if empty, copies last command"
|
|
131
|
+
- key: "Alt + T"
|
|
132
|
+
desc: "Translate output of previous command (runs 'tr' shorthand)"
|
|
133
|
+
- key: "Alt + B"
|
|
134
|
+
desc: "Jump cursor backward one word (same as Ctrl+Left in input)"
|
|
135
|
+
- key: "Alt + F"
|
|
136
|
+
desc: "Jump cursor forward one word (same as Ctrl+Right in input)"
|
|
137
|
+
- key: "Alt + D"
|
|
138
|
+
desc: "Delete the word immediately after the cursor"
|
|
139
|
+
- key: "Alt + Backspace"
|
|
140
|
+
desc: "Delete the word immediately before the cursor"
|
|
141
|
+
- key: "Ctrl + W"
|
|
142
|
+
desc: "Delete the word immediately before the cursor (same as Alt+Backspace)"
|
|
143
|
+
- key: "Ctrl + U"
|
|
144
|
+
desc: "Delete all input before the cursor"
|
|
145
|
+
- key: "Ctrl + K"
|
|
146
|
+
desc: "Delete all input after the cursor"
|
|
147
|
+
- key: "Ctrl + A"
|
|
148
|
+
desc: "Jump cursor to the beginning of the line"
|
|
149
|
+
- key: "Ctrl + E"
|
|
150
|
+
desc: "Jump cursor to the end of the line"
|
|
151
|
+
- key: "Ctrl + B"
|
|
152
|
+
desc: "Open Block Roaming mode — browse session history blocks and live outputs"
|
|
153
|
+
- key: "Ctrl + C"
|
|
154
|
+
desc: "Silently ignore on empty prompt; running commands are terminated via OS signal"
|
|
155
|
+
- key: "Ctrl + D"
|
|
156
|
+
desc: "Exit the Kapsel interactive session cleanly (EOF)"
|
|
157
|
+
- key: "Ctrl + L"
|
|
158
|
+
desc: "Clear terminal screen and redraw the card interface"
|
|
159
|
+
- key: "Escape / q (Roaming)"
|
|
160
|
+
desc: "Exit Block Roaming mode and restore previous prompt input"
|
|
161
|
+
- key: "y / o (Roaming)"
|
|
162
|
+
desc: "Copy the output of the currently selected block to clipboard"
|
|
163
|
+
- key: "c (Roaming)"
|
|
164
|
+
desc: "Copy the command of the currently selected block to clipboard"
|
|
165
|
+
- key: "r (Roaming)"
|
|
166
|
+
desc: "Re-run the currently selected block's command"
|
|
167
|
+
- key: "x / Ctrl+C (Roaming)"
|
|
168
|
+
desc: "Terminate the currently running block"
|
|
169
|
+
- key: "v (Roaming)"
|
|
170
|
+
desc: "View the full log output of the currently selected block"
|
|
171
|
+
|
|
172
|
+
tips:
|
|
173
|
+
title: "💡 Pro Tips & Best Practices"
|
|
174
|
+
items:
|
|
175
|
+
- "Press → (Right Arrow) once to accept the next word of a ghost suggestion; hold or tap rapidly to accept the entire line."
|
|
176
|
+
- "Press Ctrl+Enter (or Alt+Enter) to run any command as a background block — the prompt is immediately ready for the next command."
|
|
177
|
+
- "Press Ctrl+B to open Block Roaming and inspect, copy, or re-run any previous block output without leaving the prompt."
|
|
178
|
+
- "On an empty prompt, press Ctrl+→ to peek into subdirectories, or Ctrl+← to navigate up (cd ..) — no typing required."
|
|
179
|
+
- "Type 'kapsel help <command>' (e.g. 'kapsel help config') to get focused usage and subcommand details for any specific command."
|
|
180
|
+
- "Run 'kapsel add update' after cloning or modifying the plugins repo to refresh completions and the plugin catalog instantly."
|
|
181
|
+
- "Run 'kapsel enable' with no arguments to see which plugins are active and which are installed but disabled."
|
|
@@ -47,3 +47,22 @@ tips:
|
|
|
47
47
|
- "Run [bold #38bdf8]kapsel upgrade[/] to automatically check and update Kapsel core and all installed official plugins."
|
|
48
48
|
- "Add your personal notes or team commands to ~/.kapsel/tips.yaml; Kapsel will blend them into daily tips."
|
|
49
49
|
- "Type [bold #f43f5e]exit[/] or press [bold #f43f5e]Ctrl+D[/] to safely exit Kapsel and return to your host shell without pollution."
|
|
50
|
+
- "Press [bold #f59e0b]Ctrl+→[/] while the prompt is empty to instantly expand and preview subdirectories without typing anything."
|
|
51
|
+
- "Press [bold #f59e0b]Ctrl+←[/] on an empty prompt to navigate up to the parent directory (cd ..); double-tap to confirm."
|
|
52
|
+
- "Press [bold #f59e0b]Ctrl+↑[/] to create a new empty file interactively at the current path — no command needed."
|
|
53
|
+
- "Press [bold #f59e0b]Ctrl+↓[/] to permanently delete the selected file or folder; double-tap to bypass the confirmation."
|
|
54
|
+
- "Press [bold #38bdf8]Alt+↑[/] to instantly launch the interactive file manager (fm) from any prompt state."
|
|
55
|
+
- "Press [bold #38bdf8]Alt+↓[/] to copy your current prompt text to the clipboard; if the prompt is empty, it copies your last command."
|
|
56
|
+
- "Press [bold #38bdf8]Alt+T[/] to immediately translate the output of your previous command via the trans plugin shorthand 'tr'."
|
|
57
|
+
- "Press [bold #38bdf8]Alt+B[/] or [bold #38bdf8]Alt+F[/] to jump backward or forward one word in your current input line."
|
|
58
|
+
- "Run [bold #10b981]bk[/] (or [bold #10b981]kps backup[/]) to instantly snapshot the current directory; run [bold #10b981]bk undo[/] to roll back immediately."
|
|
59
|
+
- "Run [bold #10b981]bk restore[/] with no arguments to open an interactive time-travel picker and restore any previous snapshot."
|
|
60
|
+
- "Run [bold #10b981]bk log[/] to view backup history with relative timestamps; [bold #10b981]bk diff[/] shows changes since the last snapshot."
|
|
61
|
+
- "Run [bold #10b981]kps trans <text>[/] to translate command output or arbitrary text across multiple languages directly in the terminal."
|
|
62
|
+
- "Run [bold #10b981]kps lang switch <locale>[/] to hot-swap the terminal locale and shell culture settings without restarting."
|
|
63
|
+
- "Run [bold #10b981]kps preview <file>[/] for smart, syntax-highlighted preview of code, markdown, images, and archives."
|
|
64
|
+
- "Run [bold #10b981]kps commit[/] to launch the interactive Conventional Commit wizard — it auto-deduces type and scope from your diff."
|
|
65
|
+
- "Run [bold #38bdf8]kapsel enable[/] (no args) to see a full table of all installed plugins with their enabled/disabled status."
|
|
66
|
+
- "Run [bold #38bdf8]kapsel dir[/] to preview the current directory tree and get a reminder of all Ctrl+Arrow navigation shortcuts."
|
|
67
|
+
- "Run [bold #38bdf8]kapsel rm <path>[/] to safely delete a file or folder — it always asks for explicit confirmation before removing."
|
|
68
|
+
|
|
@@ -17,7 +17,7 @@ modes:
|
|
|
17
17
|
description: "100% 原生宿主执行 (git, docker, npm, python, vim 等),配备 Carapace 深度上下文动态补全。"
|
|
18
18
|
- name: "胶囊模式 (Kapsel)"
|
|
19
19
|
trigger: "输入 'kapsel ' 或 'kps '"
|
|
20
|
-
description: "统一胶囊指令 (help, status, config, language, add, toggle 及插件扩展);Tab 展开候选。"
|
|
20
|
+
description: "统一胶囊指令 (help, status, config, language, add, enable, toggle 及插件扩展);Tab 展开候选。"
|
|
21
21
|
|
|
22
22
|
quickstart:
|
|
23
23
|
title: "⚡ 极速上手工作流"
|
|
@@ -28,10 +28,13 @@ quickstart:
|
|
|
28
28
|
- step: "2. 原生无缝执行"
|
|
29
29
|
cmd: "git checkout -b feature"
|
|
30
30
|
desc: "无感运行任意原生命令,Carapace 自动感知分支名、参数与文件路径。"
|
|
31
|
-
- step: "3.
|
|
31
|
+
- step: "3. 检查系统状态"
|
|
32
32
|
cmd: "kapsel status"
|
|
33
|
-
desc: "
|
|
34
|
-
- step: "4.
|
|
33
|
+
desc: "查看系统平台、宿主终端、Git 分支、补全引擎与已激活插件一览。"
|
|
34
|
+
- step: "4. 浏览与管理插件"
|
|
35
|
+
cmd: "kapsel enable"
|
|
36
|
+
desc: "查看所有已安装插件的启用/禁用状态总览表;运行 'kapsel enable <名称>' 激活指定插件。"
|
|
37
|
+
- step: "5. 安全无痕退出"
|
|
35
38
|
cmd: "exit"
|
|
36
39
|
desc: "安全退出胶囊环境并返回宿主终端,不残留后台进程与脏环境。"
|
|
37
40
|
|
|
@@ -46,7 +49,7 @@ commands:
|
|
|
46
49
|
desc: "显示完整的系统使用指南、交互机制与命令速查手册"
|
|
47
50
|
origin: "Core 核心"
|
|
48
51
|
- name: "kapsel status"
|
|
49
|
-
desc: "查看操作系统平台、宿主终端、Git
|
|
52
|
+
desc: "查看操作系统平台、宿主终端、Git 分支、补全引擎及已激活插件列表"
|
|
50
53
|
origin: "Core 核心"
|
|
51
54
|
- name: "kapsel config"
|
|
52
55
|
desc: "查看、编辑、读取、设置或热重载 ~/.kapsel/config.yaml"
|
|
@@ -61,13 +64,16 @@ commands:
|
|
|
61
64
|
desc: "查看或安全搬迁数据存储沙箱目录 (全量自动搬迁,旧位置彻底清除)"
|
|
62
65
|
origin: "Core 核心"
|
|
63
66
|
- name: "kapsel add <plugin>"
|
|
64
|
-
desc: "
|
|
67
|
+
desc: "从远程仓库拉取、安装依赖并将插件注册至 Kapsel 运行环境"
|
|
65
68
|
origin: "Core 核心"
|
|
66
69
|
- name: "kapsel upgrade [name]"
|
|
67
70
|
desc: "检查并升级 Kapsel 自身及官方插件,展示更新说明"
|
|
68
71
|
origin: "Core 核心"
|
|
72
|
+
- name: "kapsel enable"
|
|
73
|
+
desc: "显示所有已安装插件的启用/禁用状态总览表"
|
|
74
|
+
origin: "Core 核心"
|
|
69
75
|
- name: "kapsel enable <plugin>"
|
|
70
|
-
desc: "启用已安装的 Kapsel
|
|
76
|
+
desc: "启用已安装的 Kapsel 插件并展示插件状态卡片"
|
|
71
77
|
origin: "Core 核心"
|
|
72
78
|
- name: "kapsel disable <plugin>"
|
|
73
79
|
desc: "禁用已启用的 Kapsel 插件 (保留插件文件)"
|
|
@@ -78,6 +84,12 @@ commands:
|
|
|
78
84
|
- name: "kapsel toggle"
|
|
79
85
|
desc: "开启或关闭 Kapsel 终端默认交互会话"
|
|
80
86
|
origin: "Core 核心"
|
|
87
|
+
- name: "kapsel dir"
|
|
88
|
+
desc: "预览当前目录树结构并展示 Ctrl+Arrow 方向键导航快捷键说明"
|
|
89
|
+
origin: "Core 核心"
|
|
90
|
+
- name: "kapsel rm <path>"
|
|
91
|
+
desc: "安全永久删除文件或目录,执行前需显式确认,防止误删"
|
|
92
|
+
origin: "Core 核心"
|
|
81
93
|
- name: "exit / quit"
|
|
82
94
|
desc: "安全退出 Kapsel 终端胶囊,无痕返回宿主原生 Shell"
|
|
83
95
|
origin: "Core 核心"
|
|
@@ -106,6 +118,12 @@ shortcuts:
|
|
|
106
118
|
desc: "取消当前输入行并重置输入提示符"
|
|
107
119
|
- key: "Ctrl + D"
|
|
108
120
|
desc: "正常退出终端胶囊交互会话 (EOF)"
|
|
121
|
+
- key: "Ctrl + L"
|
|
122
|
+
desc: "清空终端屏幕并重绘卡片界面"
|
|
123
|
+
- key: "Ctrl + Enter / Alt + Enter"
|
|
124
|
+
desc: "将多行粘贴内容作为 Command Block 整体执行"
|
|
125
|
+
- key: "Ctrl + B / Alt + B"
|
|
126
|
+
desc: "进入 Block Roaming 模式,浏览历史块、输出与状态"
|
|
109
127
|
|
|
110
128
|
tips:
|
|
111
129
|
title: "💡 进阶使用技巧"
|
|
@@ -115,4 +133,17 @@ tips:
|
|
|
115
133
|
- "随时运行 'kapsel language <代码/缩写>' (如 'kapsel language en' 或 'kapsel language ja') 即刻切换语言。"
|
|
116
134
|
- "跨盘迁移数据非常安全:运行 'kapsel datadir D:\\KapselData' 即可全自动搬迁数据库与配置。"
|
|
117
135
|
- "调用外部扩展工具时使用 'kps <tool>',例如 'kps shore set python tuna' 或 'kps init use node@22'。"
|
|
118
|
-
|
|
136
|
+
- "运行 'kapsel enable'(不带参数)即可查看所有已安装插件的启用/禁用状态总览表。"
|
|
137
|
+
- "运行 'kapsel enable <插件名>' 激活插件后,会弹出状态卡片展示版本、描述及可用子命令。"
|
|
138
|
+
- "运行 'kapsel dir' 预览当前目录树,并查看 Ctrl+方向键的导航快捷键说明。"
|
|
139
|
+
- "运行 'kapsel rm <路径>' 安全删除文件或目录——执行前始终要求显式确认,防止误删。"
|
|
140
|
+
- "运行 'bk'(或 'kps backup')立即对当前目录打快照;运行 'bk undo' 即时回滚至上一版本。"
|
|
141
|
+
- "运行 'bk restore'(不带参数)启动交互式时间轴选择器,可视化还原任意历史快照。"
|
|
142
|
+
- "运行 'bk log' 查看带相对时间戳的备份历史;'bk diff' 展示自上次快照以来的变更内容。"
|
|
143
|
+
- "运行 'kps trans <文本>' 在终端内直接翻译命令输出或任意文本,支持多种目标语言。"
|
|
144
|
+
- "运行 'kps lang switch <locale>' 可热切换终端语言区域设置,无需重启 Shell。"
|
|
145
|
+
- "运行 'kps preview <文件>' 对代码、Markdown、图片和压缩包进行智能语法高亮预览。"
|
|
146
|
+
- "运行 'kps commit' 启动交互式 Conventional Commit 向导,自动从 diff 推断类型与作用域。"
|
|
147
|
+
- "运行 'kapsel search <关键词>' 模糊搜索官方插件、工具和生态包,用 'kapsel add <名称>' 安装。"
|
|
148
|
+
- "在 ~/.kapsel/tips.yaml 中添加个人笔记或团队命令;Kapsel 会将它们融入每日启动提示。"
|
|
149
|
+
- "输入 'exit' 或按 Ctrl+D 安全退出 Kapsel,无痕返回宿主 Shell。"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kapsel-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: Next-generation cross-platform terminal capsule & ergonomic shell multiplexer with context-aware command translation and 1,000+ CLI completions.
|
|
5
5
|
Author-email: MrEiu <k648888@vip.qq.com>
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kapsel-cli"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.4"
|
|
8
8
|
description = "Next-generation cross-platform terminal capsule & ergonomic shell multiplexer with context-aware command translation and 1,000+ CLI completions."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|