Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
59182f7
feat: add sctl daemon
CodFrm Jul 21, 2026
38b48d8
refactor: reorganize sctl architecture
CodFrm Jul 21, 2026
3889987
ci: replace goreleaser and refine repository guides
CodFrm Jul 21, 2026
4ac428e
refactor: flatten trust to a single enrollment (External Access)
CodFrm Jul 23, 2026
4143e64
chore: add local development Makefile
CodFrm Jul 23, 2026
1c9af6c
refactor: group envelope types into session/bridge layers, drop dead …
CodFrm Jul 24, 2026
d9621e0
chore: bump go-sdk to v1.7.0 for MCP 2026-07-28
CodFrm Aug 3, 2026
88d867a
feat: declare scripts.edit.request and scripts.source.grep in protoco…
CodFrm Aug 3, 2026
99f345c
feat: resource-oriented CLI surface (get/delete/enable/disable, -o/--…
CodFrm Aug 3, 2026
60cc197
fix: tighten resource-oriented CLI guards and strip the resource word…
CodFrm Aug 3, 2026
9cc688f
fix: refuse to launch the daemon when the running executable is not sctl
CodFrm Aug 3, 2026
1a9b3a6
feat: add edit and grep commands, and register their MCP tools
CodFrm Aug 3, 2026
c6b99cb
chore: translate user-facing strings to English
CodFrm Aug 3, 2026
6077219
docs: rewrite README in English and sync docs with the kubectl-style CLI
CodFrm Aug 3, 2026
52b71cb
feat: migrate WebSocket transport to JSON-RPC 2.0
CodFrm Aug 4, 2026
b871d32
fix: generate CSP-safe TypeScript RPC validators
CodFrm Aug 4, 2026
5545a67
feat: add global data directory flag
CodFrm Aug 4, 2026
2fafe4b
docs: add MCP installation guide
CodFrm Aug 4, 2026
badeaa3
docs: streamline bilingual README
CodFrm Aug 4, 2026
eabb371
docs: move Chinese README under docs
CodFrm Aug 4, 2026
6f6270d
docs: keep README focused on users
CodFrm Aug 4, 2026
7490d83
fix: address external access review findings
CodFrm Aug 5, 2026
8ded291
refactor: remove external access policy restrictions
CodFrm Aug 5, 2026
e82fd7a
ci: update paired ScriptCat protocol ref
CodFrm Aug 5, 2026
80fef2a
feat: support data directory environment variable
CodFrm Aug 5, 2026
ebdf747
feat: limit MCP full source reads
CodFrm Aug 5, 2026
fe83e03
ci: pair latest ScriptCat protocol mirror
CodFrm Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: release

on:
push:
tags: ["v*"]

permissions:
contents: read

concurrency:
# 发布不允许被后续运行打断。
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
# 复用测试工作流的全部门禁(lint / test / 协议一致性),门禁不过不发布。
test:
uses: ./.github/workflows/test.yaml
permissions:
contents: read

build:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: darwin
goarch: amd64
arch: x86_64
format: tar.gz
- goos: darwin
goarch: arm64
arch: arm64
format: tar.gz
- goos: linux
goarch: amd64
arch: x86_64
format: tar.gz
- goos: linux
goarch: arm64
arch: arm64
format: tar.gz
- goos: windows
goarch: amd64
arch: x86_64
format: zip
- goos: windows
goarch: arm64
arch: arm64
format: zip
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: 构建并打包
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
BUILD_DATE=$(git show -s --format=%cI HEAD)
COMMIT_TIMESTAMP=$(git show -s --format=%ct HEAD)
PACKAGE="sctl_${VERSION}_${GOOS}_${{ matrix.arch }}"
STAGE="dist/${PACKAGE}"
BINARY=sctl
if [ "$GOOS" = windows ]; then
BINARY=sctl.exe
fi

mkdir -p "$STAGE/docs"
go build -trimpath -ldflags "-s -w \
-X github.com/scriptscat/sctl/internal/cli.Version=${VERSION} \
-X github.com/scriptscat/sctl/internal/cli.Commit=${GITHUB_SHA} \
-X github.com/scriptscat/sctl/internal/cli.BuildDate=${BUILD_DATE}" \
-o "$STAGE/$BINARY" ./cmd/sctl
cp README.md LICENSE* "$STAGE/"
cp -R docs/. "$STAGE/docs/"
find "$STAGE" -exec touch -d "@${COMMIT_TIMESTAMP}" {} +

if [ "${{ matrix.format }}" = zip ]; then
(cd dist && zip -X -q -r "${PACKAGE}.zip" "$PACKAGE")
else
tar --sort=name --mtime="@${COMMIT_TIMESTAMP}" --owner=0 --group=0 --numeric-owner \
-C dist -czf "dist/${PACKAGE}.tar.gz" "$PACKAGE"
fi
- uses: actions/upload-artifact@v7
with:
name: release-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*.${{ matrix.format }}
if-no-files-found: error

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write # 创建 GitHub Release 并上传产物
id-token: write # 构建来源证明(build provenance)签名
attestations: write
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v8
with:
path: artifacts
pattern: release-*
merge-multiple: true
- name: 生成校验和
run: cd artifacts && sha256sum * > checksums.txt
- name: 判断是否为预发布
id: prerelease
env:
TAG: ${{ github.ref_name }}
run: |
if [[ "$TAG" == *-* ]]; then
echo "flag=--prerelease" >> "$GITHUB_OUTPUT"
fi
- name: 创建 GitHub 草稿 Release
env:
GH_TOKEN: ${{ github.token }}
PRERELEASE_FLAG: ${{ steps.prerelease.outputs.flag }}
run: |
gh release create "$GITHUB_REF_NAME" \
--draft \
--title "$GITHUB_REF_NAME" \
--generate-notes \
$PRERELEASE_FLAG \
artifacts/*
- name: 生成构建来源证明
# 只对 checksums.txt 签名即可:它覆盖了全部产物的 sha256,
# 用户先 `sha256sum -c` 再 `gh attestation verify checksums.txt` 就形成完整信任链。
uses: actions/attest-build-provenance@v4
with:
subject-path: artifacts/checksums.txt
- name: 输出发布摘要
run: |
{
echo "## sctl ${GITHUB_REF_NAME} 发布产物"
echo
echo '```'
cat artifacts/checksums.txt
echo '```'
echo
echo "Release 以**草稿**形式创建,确认 changelog 后手动点击 Publish。"
} >> "$GITHUB_STEP_SUMMARY"
86 changes: 86 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: test

on:
push:
branches: [main, "release/**"]
pull_request:
# 供 release 工作流复用:打 tag 发布前跑同一套门禁,避免两边规则漂移。
workflow_call:
workflow_dispatch:

permissions:
contents: read

concurrency:
# PR 上新提交会取消上一次运行;main / release 分支保留每次运行。
group: test-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
name: lint
runs-on: ubuntu-latest
env:
# 与本地开发保持同一版本,避免"本地过 CI 挂"。升级时同步改 docs/development.md。
GOLANGCI_LINT_VERSION: v2.12.2
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- uses: golangci/golangci-lint-action@v9
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}

test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go build ./...
- run: go vet ./...
- run: go test -race ./...

protocol-schema:
name: protocol schema and ScriptCat mirror
runs-on: ubuntu-latest
env:
SCRIPTCAT_REF: e32bb5a43d3061aa1d380f62328bd249fdf55ac8
steps:
- uses: actions/checkout@v5
with:
path: sctl
- uses: actions/checkout@v5
with:
repository: scriptscat/scriptcat
ref: ${{ env.SCRIPTCAT_REF }}
path: scriptcat
- uses: actions/setup-go@v6
with:
go-version-file: sctl/go.mod
cache-dependency-path: sctl/go.sum
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Check generated artifacts and exact paired mirror
working-directory: sctl
run: |
make protocol-check
mkdir -p ../formatted
cp internal/pkg/protocol/generated/*.ts ../formatted/
npx --yes prettier@3.6.2 --config ../scriptcat/.prettierrc --write ../formatted/*.ts
cmp ../formatted/protocol.generated.ts ../scriptcat/src/app/service/service_worker/external_access/generated/protocol.generated.ts
cmp ../formatted/validators.generated.ts ../scriptcat/src/app/service/service_worker/external_access/generated/validators.generated.ts
{
echo "ScriptCat ref: $SCRIPTCAT_REF"
sha256sum ../formatted/*.ts
} >> "$GITHUB_STEP_SUMMARY"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/sctl
/bin/
dist/
# 一次性端到端验证脚本与证据(见 docs/verification.md),永远不进版本库
/e2e/scratch/
52 changes: 52 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: "2"

# 注意:golangci-lint 只分析当前 GOOS 下参与构建的文件,`_windows.go` 一类
# 带构建标签的代码在 Linux 测试 CI 上不会被检查;跨平台产物由发布流程编译。

linters:
default: standard # errcheck govet ineffassign staticcheck unused
enable:
- bodyclose # HTTP body 未关闭
- errorlint # %w / errors.Is 用法
- gocritic
- misspell
- nilerr # 拿到 err 却返回 nil
- nolintlint # //nolint 必须写明理由
- revive
- unconvert
- usestdlibvars
- whitespace
settings:
errcheck:
check-type-assertions: true
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
- name: exported
disabled: true # 内部包为主,不强制导出符号注释
- name: unused-parameter
disabled: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# 测试里大量 defer close / 断言,放宽噪音较大的检查。
- path: _test\.go
linters:
- bodyclose
- errcheck

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/scriptscat/sctl
Loading
Loading