@snowdreamtech/unigo-linux-s390x 0.0.2
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.
- package/LICENSE +21 -0
- package/README.md +124 -0
- package/README_zh-CN.md +124 -0
- package/bin/unigo +0 -0
- package/package.json +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present SnowdreamTech Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# UniGo
|
|
2
|
+
|
|
3
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/cd.yml)
|
|
5
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/pages.yml)
|
|
6
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/codeql.yml)
|
|
7
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
9
|
+
[](https://github.com/snowdreamtech/UniGo/releases/latest)
|
|
10
|
+
[](https://opensource.org/license/MIT)
|
|
11
|
+
[](https://github.com/snowdreamtech/UniGo/releases/latest)
|
|
12
|
+
[](https://github.com/snowdreamtech/UniGo/blob/main/.github/dependabot.yml)
|
|
13
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
14
|
+
[](https://github.com/snowdreamtech/UniGo)
|
|
15
|
+
[](https://github.com/snowdreamtech/UniGo/issues)
|
|
16
|
+
[](https://github.com/snowdreamtech/UniGo)
|
|
17
|
+
|
|
18
|
+
[English](README.md) | [简体中文](README_zh-CN.md)
|
|
19
|
+
|
|
20
|
+
UniGo is a fast, flexible, and enterprise-grade Golang CLI template inspired by UniRTM and helloworld. It provides a robust foundation for building modern command-line applications in Go, featuring beautiful terminal output, structured logging, built-in caching, and a comprehensive CI/CD pipeline.
|
|
21
|
+
|
|
22
|
+
## 🌟 Features
|
|
23
|
+
|
|
24
|
+
- **Modern CLI Architecture**: Built with Go 1.24+ and Cobra, providing a structured and extensible command-line application framework.
|
|
25
|
+
- **Beautiful Output**: Utilizes `pterm` for rich, colorful, and interactive terminal output.
|
|
26
|
+
- **Structured Logging**: Built-in support for Go's standard `slog` package for high-performance structured logging.
|
|
27
|
+
- **Robust Tooling**: Includes built-in commands like `doctor`, `self-update`, `cache`, `config`, and `license`.
|
|
28
|
+
- **Triple Guarantee Quality**: 100% code purity enforced through IDE checks, Pre-commit hooks, and GitHub Actions integrated quality gates.
|
|
29
|
+
- **Cross-Platform Ready**: Runs seamlessly on macOS, Linux, and Windows.
|
|
30
|
+
|
|
31
|
+
## 🏗️ Architecture & Design
|
|
32
|
+
|
|
33
|
+
### Overview
|
|
34
|
+
|
|
35
|
+
UniGo is engineered to solve the boilerplate problem when starting new Go CLI projects. It standardizes the development environment, architectural patterns, and automation pipelines out of the box.
|
|
36
|
+
|
|
37
|
+
### Core Components
|
|
38
|
+
|
|
39
|
+
- **CLI Framework**: Utilizes `spf13/cobra` and `spf13/viper` for powerful command parsing and configuration management.
|
|
40
|
+
- **UI & Logging**: Integrated `pterm` for UI components and `slog` for structured event logging.
|
|
41
|
+
- **Database & Caching**: SQLite-backed (via `modernc.org/sqlite`) local caching and transactional data storage.
|
|
42
|
+
- **Task Orchestration**: Configured with `UniRTM` for managing local development workflows (lint, test, verify).
|
|
43
|
+
|
|
44
|
+
## 📖 Usage Guide
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
|
|
48
|
+
- **Runtime**: Go (>= 1.24).
|
|
49
|
+
- **Git**: Global git installation required.
|
|
50
|
+
- **UniRTM**: Required for task execution and orchestration.
|
|
51
|
+
|
|
52
|
+
### Quick Start
|
|
53
|
+
|
|
54
|
+
1. **Install UniRTM**: Ensure `unirtm` is installed on your system.
|
|
55
|
+
2. **Initialize**: `unirtm run setup` (bootstraps core dependencies and hooks).
|
|
56
|
+
3. **Install**: `unirtm run install` (installs project dependencies).
|
|
57
|
+
4. **Verify**: `unirtm run verify` (ensures everything is green).
|
|
58
|
+
5. **Build**: `go build -o unigo main.go`
|
|
59
|
+
|
|
60
|
+
### Available Commands
|
|
61
|
+
|
|
62
|
+
- `unigo version`: Print the version number
|
|
63
|
+
- `unigo doctor`: Check system health and diagnose issues
|
|
64
|
+
- `unigo self-update`: Update to the latest version
|
|
65
|
+
- `unigo cache`: Manage local cache
|
|
66
|
+
- `unigo config`: Manage configuration
|
|
67
|
+
- `unigo license`: Manage copyright license headers
|
|
68
|
+
|
|
69
|
+
## 🛠️ Operations Guide
|
|
70
|
+
|
|
71
|
+
### Pre-deployment Checklist
|
|
72
|
+
|
|
73
|
+
1. Run `unirtm run verify` to ensure all quality gates are green (runs formatters, linters, tests, and security audits).
|
|
74
|
+
2. Ensure `CHANGELOG.md` is updated.
|
|
75
|
+
|
|
76
|
+
### Troubleshooting
|
|
77
|
+
|
|
78
|
+
- **Problem**: `unirtm run verify` fails with test errors.
|
|
79
|
+
- **Solution**: Ensure your code passes all Go unit tests. UniGo enforces strict coverage and race condition checks.
|
|
80
|
+
- **Problem**: Pre-commit hooks fail.
|
|
81
|
+
- **Solution**: The hooks often auto-fix issues (like formatting). Stage the modified files and commit again.
|
|
82
|
+
|
|
83
|
+
## 🔒 Security Considerations
|
|
84
|
+
|
|
85
|
+
### Security Model
|
|
86
|
+
|
|
87
|
+
- **Audit Logging**: All critical operations and security scans are executed during the `verify` task using tools like `trivy`, `gitleaks`, and `govulncheck`.
|
|
88
|
+
- **Dependency Management**: Powered by Dependabot to ensure all dependencies are kept up-to-date and secure.
|
|
89
|
+
|
|
90
|
+
## 🧑💻 Development Guide
|
|
91
|
+
|
|
92
|
+
### Local Development Setup
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/snowdreamtech/UniGo.git
|
|
96
|
+
cd UniGo
|
|
97
|
+
unirtm run setup
|
|
98
|
+
unirtm run install
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 🚀 Proxy Usage Scenarios
|
|
102
|
+
|
|
103
|
+
The `GITHUB_PROXY` (default: `https://gh-proxy.sn0wdr1am.com/`) is optimized for specific network acceleration scenarios. Misusing it for unsupported protocols (like Git) will result in errors.
|
|
104
|
+
|
|
105
|
+
| Scenario | Supported? | Example / Note |
|
|
106
|
+
| :-------------------- | :--------- | :----------------------------------------------------- |
|
|
107
|
+
| **Release Files** | ✅ Yes | `.../releases/download/v1.0/tool.zip` |
|
|
108
|
+
| **Source Archives** | ✅ Yes | `.../archive/master.zip` or `.tar.gz` |
|
|
109
|
+
| **Direct File Links** | ✅ Yes | `.../blob/master/filename` |
|
|
110
|
+
| **Git Clone** | ❌ **No** | Do **not** use for `git clone` or `insteadOf` configs. |
|
|
111
|
+
| **Project Folders** | ❌ **No** | Browsing/cloning via proxy is not supported. |
|
|
112
|
+
|
|
113
|
+
> [!IMPORTANT]
|
|
114
|
+
> To prevent breaking toolchains (like `unirtm`), this template explicitly disables Git redirection via this proxy. Use it only for direct HTTP downloads in scripts.
|
|
115
|
+
|
|
116
|
+
## 📄 License
|
|
117
|
+
|
|
118
|
+
This project is licensed under the **MIT License**.
|
|
119
|
+
Copyright (c) 2026-present [SnowdreamTech Inc.](https://github.com/snowdreamtech)
|
|
120
|
+
See the [LICENSE](./LICENSE) file for the full license text.
|
|
121
|
+
|
|
122
|
+
## Star History
|
|
123
|
+
|
|
124
|
+
[](https://www.star-history.com/?repos=snowdreamtech%2FUniGo&type=date&legend=top-left)
|
package/README_zh-CN.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# UniGo
|
|
2
|
+
|
|
3
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/cd.yml)
|
|
5
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/pages.yml)
|
|
6
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/codeql.yml)
|
|
7
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/snowdreamtech/UniGo/actions/workflows/ci.yml)
|
|
9
|
+
[](https://github.com/snowdreamtech/UniGo/releases/latest)
|
|
10
|
+
[](https://opensource.org/license/MIT)
|
|
11
|
+
[](https://github.com/snowdreamtech/UniGo/releases/latest)
|
|
12
|
+
[](https://github.com/snowdreamtech/UniGo/blob/main/.github/dependabot.yml)
|
|
13
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
14
|
+
[](https://github.com/snowdreamtech/UniGo)
|
|
15
|
+
[](https://github.com/snowdreamtech/UniGo/issues)
|
|
16
|
+
[](https://github.com/snowdreamtech/UniGo)
|
|
17
|
+
|
|
18
|
+
[English](README.md) | [简体中文](README_zh-CN.md)
|
|
19
|
+
|
|
20
|
+
UniGo 是一个快速、灵活且企业级的 Golang CLI 模板,深受 UniRTM 和 helloworld 的启发。它为构建现代 Go 命令行应用程序提供了一个坚实的基础,内置了精美的终端输出、结构化日志、缓存管理机制以及全套的 CI/CD 流水线。
|
|
21
|
+
|
|
22
|
+
## 🌟 特性
|
|
23
|
+
|
|
24
|
+
- **现代 CLI 架构**:基于 Go 1.24+ 和 Cobra 构建,提供结构化且易于扩展的命令行框架。
|
|
25
|
+
- **精美输出**:使用 `pterm` 实现丰富、多彩且交互友好的终端输出效果。
|
|
26
|
+
- **结构化日志**:内置对 Go 标准库 `slog` 的支持,提供高性能的结构化日志记录。
|
|
27
|
+
- **丰富的内置工具**:自带 `doctor`、`self-update`、`cache`、`config` 和 `license` 等实用命令。
|
|
28
|
+
- **三重保证质量**:通过 IDE 实时检查、Pre-commit 本地拦截和 GitHub Actions 远端全量审计,构建 100% 代码纯净度防线。
|
|
29
|
+
- **跨平台就绪**:在 macOS、Linux 和 Windows 上均可无缝运行。
|
|
30
|
+
|
|
31
|
+
## 🏗️ 架构与设计
|
|
32
|
+
|
|
33
|
+
### 概览
|
|
34
|
+
|
|
35
|
+
UniGo 旨在解决每次启动新的 Go CLI 项目时遇到的模板化和重复配置问题。它提供了开箱即用的标准开发环境、架构模式和自动化流水线。
|
|
36
|
+
|
|
37
|
+
### 核心组件
|
|
38
|
+
|
|
39
|
+
- **CLI 框架**:使用 `spf13/cobra` 和 `spf13/viper` 进行强大的命令解析和配置管理。
|
|
40
|
+
- **UI 与 日志**:集成了 `pterm` 作为 UI 组件,并使用 `slog` 进行结构化的事件记录。
|
|
41
|
+
- **数据库与缓存**:由 SQLite 驱动 (通过 `modernc.org/sqlite`),支持本地缓存和事务性数据存储。
|
|
42
|
+
- **任务编排**:内置了 `UniRTM` 配置,用于管理本地开发工作流(lint、test、verify)。
|
|
43
|
+
|
|
44
|
+
## 📖 使用指南
|
|
45
|
+
|
|
46
|
+
### 前置条件
|
|
47
|
+
|
|
48
|
+
- **运行时**: Go (>= 1.24)。
|
|
49
|
+
- **Git**: 需要全局安装 git。
|
|
50
|
+
- **UniRTM**: 必须安装以执行任务编排。
|
|
51
|
+
|
|
52
|
+
### 快速开始
|
|
53
|
+
|
|
54
|
+
1. **安装 UniRTM**:请确保系统已安装 `unirtm`。
|
|
55
|
+
2. **初始化**:`unirtm run setup`(引导安装核心工具与钩子)。
|
|
56
|
+
3. **安装依赖**:`unirtm run install`(安装项目依赖)。
|
|
57
|
+
4. **验证**:`unirtm run verify`(确保所有代码检查通过)。
|
|
58
|
+
5. **构建**:`go build -o unigo main.go`
|
|
59
|
+
|
|
60
|
+
### 可用命令
|
|
61
|
+
|
|
62
|
+
- `unigo version`: 打印版本号
|
|
63
|
+
- `unigo doctor`: 检查系统健康状况并诊断问题
|
|
64
|
+
- `unigo self-update`: 更新到最新版本
|
|
65
|
+
- `unigo cache`: 管理本地缓存
|
|
66
|
+
- `unigo config`: 管理配置
|
|
67
|
+
- `unigo license`: 管理源代码文件中的版权许可头
|
|
68
|
+
|
|
69
|
+
## 🛠️ 运维指南
|
|
70
|
+
|
|
71
|
+
### 部署前检查清单
|
|
72
|
+
|
|
73
|
+
1. 运行 `unirtm run verify` 确保所有质量门禁均为绿色(执行格式化、Lint、测试及安全审计)。
|
|
74
|
+
2. 确保 `CHANGELOG.md` 已更新。
|
|
75
|
+
|
|
76
|
+
### 故障排除
|
|
77
|
+
|
|
78
|
+
- **问题**: `unirtm run verify` 报测试失败。
|
|
79
|
+
- **解决方案**: 确保代码通过所有 Go 单元测试。UniGo 会执行严格的代码覆盖率和竞态条件 (race) 检查。
|
|
80
|
+
- **问题**: Pre-commit 钩子报错。
|
|
81
|
+
- **解决方案**: 许多钩子(如代码格式化)会自动修复问题。将修改后的文件重新 `git add` 并再次提交即可。
|
|
82
|
+
|
|
83
|
+
## 🔒 安全注意事项
|
|
84
|
+
|
|
85
|
+
### 安全模型
|
|
86
|
+
|
|
87
|
+
- **审计日志**: 所有的关键操作与安全扫描,均在使用 `unirtm run verify` 时,由 `trivy`、`gitleaks` 和 `govulncheck` 等工具自动执行。
|
|
88
|
+
- **依赖管理**: 由 Dependabot 支持,以确保所有项目依赖项始终保持最新且安全的状态。
|
|
89
|
+
|
|
90
|
+
## 🧑💻 开发者指南
|
|
91
|
+
|
|
92
|
+
### 本地开发设置
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/snowdreamtech/UniGo.git
|
|
96
|
+
cd UniGo
|
|
97
|
+
unirtm run setup
|
|
98
|
+
unirtm run install
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 🚀 代理使用场景
|
|
102
|
+
|
|
103
|
+
`GITHUB_PROXY` (默认: `https://gh-proxy.sn0wdr1am.com/`) 针对特定的网络加速场景进行了优化。在不支持的协议(如 Git)上误用它会导致错误。
|
|
104
|
+
|
|
105
|
+
| 场景 | 是否支持 | 示例 / 说明 |
|
|
106
|
+
| :--------------------- | :------------ | :--------------------------------------------- |
|
|
107
|
+
| **Release 文件** | ✅ 支持 | `.../releases/download/v1.0/tool.zip` |
|
|
108
|
+
| **源码归档 (Archive)** | ✅ 支持 | `.../archive/master.zip` 或 `.tar.gz` |
|
|
109
|
+
| **文件直接链接** | ✅ 支持 | `.../blob/master/filename` |
|
|
110
|
+
| **Git Clone** | ❌ **不支持** | **请勿**用于 `git clone` 或 `insteadOf` 配置。 |
|
|
111
|
+
| **项目文件夹** | ❌ **不支持** | 不支持通过代理进行项目文件夹的浏览或克隆。 |
|
|
112
|
+
|
|
113
|
+
> [!IMPORTANT]
|
|
114
|
+
> 为了防止破坏工具链(如 `unirtm`),本模板显式禁用了通过此代理进行的 Git 重定向。请仅在脚本中进行直接 HTTP 下载时使用它。
|
|
115
|
+
|
|
116
|
+
## 📄 许可证
|
|
117
|
+
|
|
118
|
+
本项目采用 **MIT 许可证** 授权。
|
|
119
|
+
版权所有 (c) 2026-现在 [SnowdreamTech Inc.](https://github.com/snowdreamtech)
|
|
120
|
+
详见 [LICENSE](./LICENSE) 文件。
|
|
121
|
+
|
|
122
|
+
## Star History
|
|
123
|
+
|
|
124
|
+
[](https://www.star-history.com/?repos=snowdreamtech%2FUniGo&type=date&legend=top-left)
|
package/bin/unigo
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@snowdreamtech/unigo-linux-s390x",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "unigo binary for Linux s390x (IBM Z)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/snowdreamtech/unigo",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/snowdreamtech/unigo.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/snowdreamtech/unigo/issues"
|
|
13
|
+
},
|
|
14
|
+
"os": ["linux"],
|
|
15
|
+
"cpu": ["s390x"],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.md",
|
|
20
|
+
"README_zh-CN.md"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18"
|
|
24
|
+
}
|
|
25
|
+
}
|