Learn-skills.dev alma-linux-remote-plugin
Remote Linux management for Alma via SSH/SFTP with persistent stateful SSH sessions, thread-session binding, NL-to-command bridge, xterm.js websocket terminal bridge, dangerous-command approval flow, strict command policy option, host-key verification modes, RBAC allowlist, and SIEM-friendly redacted audit fields.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/adfoke/alma-linux-remote-plugin/alma-linux-remote-plugin" ~/.claude/skills/neversight-learn-skills-dev-alma-linux-remote-plugin && rm -rf "$T"
manifest:
data/skills-md/adfoke/alma-linux-remote-plugin/alma-linux-remote-plugin/SKILL.mdsource content
Alma Linux Remote Plugin
Use this project to manage remote Linux hosts from Alma with safety controls.
Capabilities
- SSH connection test
- Single/batch command execution
- Primary tools:
,run_commandrun_batch - Compatibility aliases:
,execute_commandexecute_batch
- Primary tools:
- Upload/download files via SFTP
- Service status and journal logs
- Dangerous command protection:
- Manual approval workflow (
)approval_id - Operator RBAC allowlist (
)approval.allowed_operators - Optional one-time confirmation token mode
- Manual approval workflow (
- Command policy hardening:
(compatible mode)policy.strict_policy=false
(normalized/token-level matching)policy.strict_policy=true
- Host key verification policy (
):ssh.host_key_policy
(RejectPolicy + optionalknown_hosts
)known_hosts_required
(strict reject unknown hosts)reject
(compatibility mode)auto_add
- Server profile docs:
- First remote access auto-creates
server_profiles/<IP>.md - Subsequent remote calls read this profile before connect
- First remote access auto-creates
- Audit logging (
) with SIEM-friendly fields and safety:JSONL
/request_id
/trace_idoperator_ip- Sensitive fields redacted (
)password/token/secret/key/passphrase
truncated for log safetystdout/stderr
- Persistent SSH sessions (stateful shell):
,open_session
,list_sessionsclose_session
,run_command_in_session
,write_session
,read_sessionresize_session- Session metadata persistence (
)session.storage_file
- Real terminal bridge (xterm.js + WebSocket):
returnsstart_terminal_wsws://.../terminal/<session_id>
unregisters a session or stops the WS serverstop_terminal_ws
- Session key injection:
supportssend_keys_to_sessionESC/UP/DOWN/LEFT/RIGHT/TAB/ENTER
- Thread-session binding layer:
,bind_thread_session
,get_thread_sessionunbind_thread_session
(auto-open and bind when missing)ensure_thread_session
- NL -> command bridge:
(plan only)plan_command_from_text
(plan + run in persistent session)execute_text_in_session
Install
git clone https://github.com/adfoke/alma-linux-remote-plugin.git cd alma-linux-remote-plugin uv sync --all-extras
Quick Start
uv run python demo_cli.py --config ./examples/hosts.example.yaml handle health uv run python demo_cli.py --config ./examples/hosts.example.yaml tools uv run python demo_cli.py --config ./examples/hosts.example.yaml handle execute_command '{"host_name":"prod-web-1","command":"uptime"}' uv run python demo_cli.py --config ./examples/hosts.example.yaml handle open_session '{"host_name":"prod-web-1"}' uv run python demo_cli.py --config ./examples/hosts.example.yaml handle list_sessions '{"status":"all"}' uv run python demo_cli.py --config ./examples/hosts.example.yaml plan-text thread-a prod-web-1 "帮我看下磁盘和内存" uv run python demo_cli.py --config ./examples/hosts.example.yaml exec-text thread-a prod-web-1 "查看 nginx 状态和最近日志" uv run python demo_cli.py --config ./examples/hosts.example.yaml handle send_keys_to_session '{"session_id":"<SESSION_ID>","keys":["ESC",":wq","ENTER"]}'
English doc:
README.en.md
Safety Workflow (dangerous command)
- Run dangerous command → receive
andapproval_requiredapproval_id - Approver calls
with allowedapprove_requestoperator - Re-run command with
approval_id
Code Audit Notes
now usesplugin.py
to consolidate repeated connect/close patterns._with_connected_client(...)- Added focused tests for
andssh_client.py
to keep critical path coverage high.terminal_ws.py
Quality Gate
uv run ruff check src tests demo_cli.py uv run pytest --cov=src/alma_linux_remote_plugin --cov-report=term-missing --cov-fail-under=65
Main Entrypoint
- Runtime adapter:
src/alma_linux_remote_plugin/runtime_adapter.py - Plugin metadata:
plugin.yaml