plainship

module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: MIT

README

Plainship

Ship your Git-native content as durable static websites.

English | 中文

CI Release License Platform

What is Plainship

Plainship is a local-first, Git-first publishing system for Markdown content.

  • Content lives in a Git repository as plain Markdown; Git owns history, diffs, and collaboration.
  • One command incrementally builds a static website, commits the result, and assigns a build number.
  • One command publishes the site to your own server; the server only stores, syncs, and serves static HTTP.
  • Two small static binaries — plainship and plainship-server — are released together with the same version.

Quick start

On the server

One command installs plainship-server, starts the service, and prints the server URL and access token.

Linux / macOS

# Install and start the server, then print the URL and access token
curl -fsSL https://raw.githubusercontent.com/emanyzwww/plainship/master/scripts/install.sh | bash

Windows (PowerShell)

# Download the installer
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/emanyzwww/plainship/master/scripts/install.ps1 -OutFile install.ps1
# Install and start the server
.\install.ps1

On your computer

Install the latest client:

# Install the client
go install github.com/emanyzwww/plainship/cmd/plainship@latest

Create a new project and publish your first document:

# Create a new project (initializes Git)
plainship new mydoc
cd mydoc

# Create a document
plainship create "my-first-doc"
# Build: commit and assign a build number
plainship build -m "first document"

# Connect to your server (paste the token when prompted)
plainship connect http://<server>:9090

# Publish to the server
plainship publish

The generated build/ directory is a self-contained static site that can be deployed to any static host.

For local development with hot reload:

# Local preview with hot reload
plainship dev

Documentation

Development

Plainship requires Go 1.26+.

Build the binaries:

# Build the client
go build -o plainship ./cmd/plainship
# Build the server
go build -o plainship-server ./cmd/plainship-server

Run the test suite:

# Run all tests
go test ./...

Design principles

Plainship is built around a few simple principles:

  • Git-first — Git remains the source of truth for content, history, and collaboration.
  • Local-first — authoring and building happen locally, without requiring a hosted CMS.
  • Static by default — the published site is static and can be served by almost any HTTP server.
  • Simple deployment — the server is intentionally small and only handles storage, synchronization, and serving.
  • Durable content — Markdown files and Git history remain usable without Plainship.

License

MIT

Directories

Path Synopsis
cmd
plainship command
Plainship 是一个本地优先, Markdown 优先, Git 优先的文档发布系统.
Plainship 是一个本地优先, Markdown 优先, Git 优先的文档发布系统.
plainship-server command
Plainship Server 是 Plainship 的服务器端二进制.
Plainship Server 是 Plainship 的服务器端二进制.
internal
builder
Package builder 实现 Plainship 构建管线.
Package builder 实现 Plainship 构建管线.
cli
connect.go 实现 plainship connect: 在客户端配置服务器地址与访问令牌.
connect.go 实现 plainship connect: 在客户端配置服务器地址与访问令牌.
clifx
Package clifx 提供客户端与服务端 CLI 共享的框架件: 控制台编码与工具语言检测.
Package clifx 提供客户端与服务端 CLI 共享的框架件: 控制台编码与工具语言检测.
core
Package core 是 Plainship 的核心编排层.
Package core 是 Plainship 的核心编排层.
dev
Package dev 实现本地开发模式: 监听源码变更, 自动重新构建并通知浏览器热更新.
Package dev 实现本地开发模式: 监听源码变更, 自动重新构建并通知浏览器热更新.
format
Package format 提供链式的文本排版构建器.
Package format 提供链式的文本排版构建器.
fsutil
Package fsutil 提供安全的文件系统操作工具.
Package fsutil 提供安全的文件系统操作工具.
git
Package git 封装对 Git CLI 的安全调用.
Package git 封装对 Git CLI 的安全调用.
hash
Package hash 提供内容哈希与构建输入哈希计算.
Package hash 提供内容哈希与构建输入哈希计算.
i18n
Package i18n 提供 Plainship 的中英双语支持 (英文优先, 中文可切换).
Package i18n 提供 Plainship 的中英双语支持 (英文优先, 中文可切换).
i18n/gen command
Command gen 从 locales/*.yaml 生成消息键常量, 并校验双语完整性.
Command gen 从 locales/*.yaml 生成消息键常量, 并校验双语完整性.
layout
Package layout 集中定义 Plainship 工作区目录与文件常量.
Package layout 集中定义 Plainship 工作区目录与文件常量.
manifest
Package manifest 定义构建清单 (Build Manifest).
Package manifest 定义构建清单 (Build Manifest).
model
Package model 定义 Plainship 的核心数据模型.
Package model 定义 Plainship 的核心数据模型.
parser
codeblock.go 自定义代码块渲染: 构建期语法高亮 (chroma) + 语言标识.
codeblock.go 自定义代码块渲染: 构建期语法高亮 (chroma) + 语言标识.
protocol
Package protocol 定义 Plainship 同步协议的类型与版本.
Package protocol 定义 Plainship 同步协议的类型与版本.
revision
Package revision 封装 Plainship 的版本控制语义:
Package revision 封装 Plainship 的版本控制语义:
router
Package router 负责将源文件路径解析为 URL 路由与输出路径.
Package router 负责将源文件路径解析为 URL 路由与输出路径.
server
Package server 实现 Plainship Server.
Package server 实现 Plainship Server.
servercli
Package servercli 实现 plainship-server 命令行界面.
Package servercli 实现 plainship-server 命令行界面.
space
Package space 管理 Plainship 单个 Space 的创建与加载.
Package space 管理 Plainship 单个 Space 的创建与加载.
state
Package state 管理 Plainship 的内部运行状态.
Package state 管理 Plainship 的内部运行状态.
style
Package style 提供终端 ANSI 颜色渲染, 用于 CLI 输出的视觉分层.
Package style 提供终端 ANSI 颜色渲染, 用于 CLI 输出的视觉分层.
sync
Package sync 实现 Plainship 同步协议客户端.
Package sync 实现 Plainship 同步协议客户端.
theme
Package theme 负责加载与渲染主题.
Package theme 负责加载与渲染主题.
theme/embed
Package embed 使用 go:embed 内嵌默认主题, 保证即使 themes 目录缺失也能构建.
Package embed 使用 go:embed 内嵌默认主题, 保证即使 themes 目录缺失也能构建.
ui
Package ui 提供 Plainship 全部命令的统一输出入口.
Package ui 提供 Plainship 全部命令的统一输出入口.
version
Package version 集中管理 Plainship 的版本号.
Package version 集中管理 Plainship 的版本号.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL