Skip to content
XRSecPublic

About

轻量化的 CS,仅适用于个人、学习用途 未经授权 禁止商用

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

CSLite

Lightweight Multi-Runtime Fleet Control & Remote Execution Platform

English | 简体中文 | Docs Index

Node.js Rust TypeScript License

CSLite Fleet Management

CSLite is built for resource-constrained nodes and serverless environments — zero Redis, zero external message queues. Its portable Web Standards server (TypeScript + Hono) deploys identically to Node.js / Docker, Cloudflare Workers + D1 (+ R2), and Tencent Cloud SCF, while its zero-dependency single-binary Rust agent (cslite-agent) and POSIX/PowerShell Lite scripts run smoothly on Linux, OpenWrt, Alpine, macOS, Windows, and Android (Termux).


Key Features

  • Multi-Runtime Control Plane (server/)
    • Node.js / Docker: Built-in node:sqlite out of the box (Node >= 22.5), plus MySQL 8.x and Turso HTTP drivers.
    • Cloudflare Workers: Native D1 database, optional R2 release-asset bucket (RELEASES_BUCKET), and zero Node.js runtime dependencies.
    • Tencent Cloud SCF + CDN: Supports Web Function (scf_bootstrap) and APIGW Event handler (scf.main_handler) with origin-secret protection.
    • HTTPS / HTTP Layered Routing: Browser & management APIs enforce HTTPS (CSLITE_FORCE_WEB_HTTPS=true), while Agent routes (/api/agent/*, /i, /u, /t-XXXXXX) remain plain HTTP for lightweight embedded devices without TLS overhead.
  • Vue 3 Zero-CDN Web UI (web/)
    • Compiled by web/build.mjs into an inline HTML shell + content-hashed /assets/*.js & /assets/*.css (1-year immutable cache + weak ETag), with zero external fonts or CDNs.
    • Bilingual UI (中文 / English): Automatically detects browser preferred language (navigator.languages), with one-click switching in the top bar and Settings page.
    • Fleet & Operations: Per-user SWR cache, incremental device sync (since / active_ids), 60-slot poll health matrix, 1h / 24h / 7d / 30d health timelines, online terminal, multi-host batch console with Output Diff, cron scheduling, Logs Center, and configurable retention.
  • Single-Process Cross-Platform Agent (agent-rs/ & agent/)
    • Single Binary, Single Config: Pure std Rust cslite-agent (no external HTTP/TLS crate, no cslite-daemon wrapper) managed directly by systemd, OpenWrt procd + UCI, OpenRC, launchd, or Windows SCM, with unified config.env persistence.
    • Safe Self-Upgrade & Release Distribution: 15-second pre-flight verification before atomic binary replacement, backed by Cloudflare R2 / Tencent COS / GitHub Releases.
    • 6-Digit TOTP Quick Auth (/t-XXXXXX): Short-lived enrollment links for frictionless device onboarding.
  • AI / Automation Native (mcp/ & skills/)
    • Built-in stateless Streamable HTTP MCP endpoint (/mcp) with /.well-known/mcp.json discovery, local stdio MCP (mcp/dist/cslite-mcp.mjs), and cslite-remote Agent Skill.

Quick Start

Prerequisites

  • Node.js >= 22.5 (uses built-in node:sqlite)
  • Rust toolchain (cargo / rustc) (only needed when building agent-rs locally)

Run Locally

make install   # Install Node dependencies
make dev       # Build Web UI + agent scripts and start Node dev server (./data/cslite.db)

Open http://127.0.0.1:9000. Default admin credentials: admin / admin (override via CSLITE_ADMIN_PASSWORD in production).

Common Commands

make build-web          # Assemble agent scripts & build Vue 3 Web UI into server/src/ui-bundle.ts
make typecheck          # Run TypeScript + vue-tsc type checks
make check-size         # Check source/script line-count budgets
make dev-worker         # Run Cloudflare Workers locally (wrangler dev)
make deploy-worker      # Build Web UI and deploy to Cloudflare Workers
make build-scf          # Package Tencent Cloud SCF zip -> deploy/scf/dist/cslite-scf.zip
make build-agent        # Build Rust cslite-agent binary for host OS/arch
make build-agent-all    # Cross-compile Linux musl (amd64/arm64/armv7) binaries -> dist/agent/
make build-openwrt-ipk  # Build OpenWrt .ipk packages -> dist/openwrt/
make docker-build       # Build multi-stage Node 22 Alpine Docker image
make test               # Full verification (build-web + typecheck + vitest + cargo test)

Documentation Index

Full navigation: docs/README.md

About

轻量化的 CS,仅适用于个人、学习用途 未经授权 禁止商用

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages