Skip to content

Commit 5da473e

Browse files
committed
doc: add README file
1 parent 3cbd2b6 commit 5da473e

File tree

3 files changed

+255
-1
lines changed

3 files changed

+255
-1
lines changed

README-CN.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Sub-Store-Manager-Cli
2+
3+
[English](./README.md) | 简体中文
4+
5+
用于管理 [Sub-Store](https://github.com/sub-store-org/Sub-Store) 后端服务的命令行工具。由于该工具基于 [Docker](https://www.docker.com/),您需要先安装 Docker。
6+
7+
8+
# 安装
9+
10+
您可以通过运行以下命令来安装这个工具:
11+
12+
```bash
13+
curl -sSL https://desnlee.github.io/Sub-Store-Manager-Cli/install.sh | bash
14+
```
15+
16+
或者您可以下载 [Release 文件](https://github.com/DesnLee/Sub-Store-Manager-Cli/releases),并手动配置环境变量和程序名称。
17+
18+
19+
# 使用方法
20+
21+
如果您正在使用脚本安装则可以直接执行以下命令。如果您正在进行手动安装,请确保每个命令中的程序名称匹配你的可执行文件名。
22+
23+
### new
24+
25+
创建一个新的 Sub-Store Docker 容器并运行,如果镜像不存在将自动构建。
26+
27+
```bash
28+
ssm new
29+
```
30+
31+
> 该命令支持以下 `flag`
32+
>
33+
> - `--name` or `-n` : 容器的唯一名称,默认名称为 `sub-store-manager-backend`。此名称将用于管理持久化数据,只要不手动删除该名称的持久化数据,或者使用 `ssm delete -c` 标志执行删除操作,无论是如何删除/重建容器,只要使用此名称都可以访问该数据。
34+
>
35+
> - `--version` or `-v` : 一个 [Sub-Store Release](https://github.com/sub-store-org/Sub-Store/releases) 的版本字符串,默认获取最新版本。
36+
>
37+
> - `--port` or `-p` : 指定端口映射,默认为 `3000`,且必须可用。如果你想使用域名访问服务,则需要使用反向代理工具(如 Nginx 或 Caddy)手动代理该端口。
38+
39+
40+
41+
### start
42+
43+
启动一个未在运行的 Sub-Store Docker 容器,默认名称为 `sub-store-manager-backend`
44+
45+
> 基本等价于 `docker start <name>`.
46+
47+
```bash
48+
ssm new <name>
49+
```
50+
51+
52+
### stop
53+
54+
停止一个正在运行的 Sub-Store Docker 容器,默认名称为 `sub-store-manager-backend`
55+
56+
> 基本等价于 `docker stop <name>`.
57+
58+
```bash
59+
ssm stop <name>
60+
```
61+
62+
63+
### delete
64+
65+
删除一个 Sub-Store Docker 容器,默认名称为 `sub-store-manager-backend`
66+
67+
> 基本等价于 `docker rm <name>`.
68+
69+
```bash
70+
ssm delete <name>
71+
```
72+
73+
> 该命令支持以下 `flag`
74+
>
75+
> - `--clear` or `-c` : 同时删除容器的持久化数据。
76+
77+
78+
### update
79+
80+
更新一个 Sub-Store Docker 容器,默认名称为 `sub-store-manager-backend`
81+
82+
```bash
83+
ssm update <name>
84+
```
85+
86+
> 该命令支持以下 `flag`
87+
>
88+
> - `--version` or `-v` : 一个 [Sub-Store Release](https://github.com/sub-store-org/Sub-Store/releases) 版本字符串,默认为最新版本。您可以借助这个 flag 来降级 Sub-Store 的版本。
89+
90+
91+
### list
92+
93+
列出所有 Sub-Store Docker 容器。
94+
95+
> 基本等价于 `docker ps -a` 并过滤以 `sub-store-manager-backend` 镜像启动的容器。
96+
97+
```bash
98+
ssm ls
99+
```
100+
101+
102+
### version
103+
104+
查看当前 Sub-Store-Manager-Cli 的版本。
105+
106+
```bash
107+
ssm version
108+
```
109+
110+
111+
# 卸载
112+
113+
如果您使用脚本安装则可以直接执行以下命令。如果您使用手动安装,请手动移除您的可执行文件。
114+
115+
```bash
116+
rm -rf /usr/local/bin/ssm
117+
```
118+
119+
如果您想同时删除持久化数据,可以执行以下命令:
120+
121+
```bash
122+
rm -rf ~/.ssm
123+
```
124+
125+
126+
# License
127+
GPL-2.0 License

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Sub-Store-Manager-Cli
2+
3+
English | [简体中文](./README-CN.md)
4+
5+
A CLI tool for managing [Sub-Store](https://github.com/sub-store-org/Sub-Store) backend service. Because of this tool based on [docker](https://www.docker.com/), you should install docker first.
6+
7+
8+
# Install
9+
10+
You can install this tool by running the following command:
11+
12+
```bash
13+
curl -sSL https://desnlee.github.io/Sub-Store-Manager-Cli/install.sh | bash
14+
```
15+
16+
Or you can download [release binary](https://github.com/DesnLee/Sub-Store-Manager-Cli/releases) and configure your environment variable manually.
17+
18+
19+
# Usage
20+
21+
If you are using a script installation, you can directly execute the following commands. However, if you are doing a manual installation, please make sure to modify the program name in each command to match the executable file name.
22+
23+
24+
### new
25+
26+
Create a new sub-store docker container and run it. If the Image does not exist, it will be build automatically.
27+
28+
```bash
29+
ssm new
30+
```
31+
32+
> this command support the following flags:
33+
>
34+
> - `--name` or `-n` : A unique name for the container, default name is `sub-store-manager-backend`. This name will be used to manage persistent data. As long as the persistent data with this name is not manually deleted, or execute `ssm delete` with `-c` flag, it will be accessible whenever the container is rebuilt or when the image is deleted and then launched using this name.
35+
>
36+
> - `--version` or `-v` : A [Sub-Store release](https://github.com/sub-store-org/Sub-Store/releases) version string, default is latest.
37+
>
38+
> -`--port` or `-p` : To successfully create a new Docker container, you need to specify the port mapping. The default port is `3000`, and it must be available. If you want to access the container using a domain name, you will need to manually proxy this port with a reverse proxy tool such as Nginx or Caddy.
39+
40+
41+
### start
42+
43+
Start a non-running sub-store Docker container by name, default name set as `sub-store-manager-backend`.
44+
45+
> Equivalent to `docker start <name>`.
46+
47+
```bash
48+
ssm new <name>
49+
```
50+
51+
52+
### stop
53+
54+
Stop a running sub-store Docker container by name, default name set as `sub-store-manager-backend`.
55+
56+
> Equivalent to `docker stop <name>`.
57+
58+
```bash
59+
ssm stop <name>
60+
```
61+
62+
63+
### delete
64+
65+
Delete a sub-store Docker container by name, default name set as `sub-store-manager-backend`.
66+
67+
> Equivalent to `docker rm -f <name>`.
68+
69+
```bash
70+
ssm delete <name>
71+
```
72+
73+
> this command support the following flags:
74+
>
75+
> - `--clear` or `-c` : Delete the persistent data of the container at the same time.
76+
77+
78+
### update
79+
80+
Update a sub-store Docker container by name, default name set as `sub-store-manager-backend`.
81+
82+
```bash
83+
ssm update <name>
84+
```
85+
86+
> this command support the following flags:
87+
>
88+
> - `--version` or `-v` : A [Sub-Store release](https://github.com/sub-store-org/Sub-Store/releases) version string, default is latest. You can use this flag to downgrade the version of the container.
89+
90+
91+
### list
92+
93+
List all sub-store Docker containers.
94+
95+
> Equivalent to `docker ps -a`, filter images with names starting with `sub-store-manager-backend`.
96+
97+
```bash
98+
ssm ls
99+
```
100+
101+
102+
### version
103+
104+
Print the version number of ssm.
105+
106+
```bash
107+
ssm version
108+
```
109+
110+
111+
# Uninstall
112+
113+
If you are using a script installation, you can directly execute the following command. If you are doing a manual installation, please manually remove your executable file.
114+
115+
```bash
116+
rm -rf /usr/local/bin/ssm
117+
```
118+
119+
If you want to delete the persistent data of the container at the same time, you can execute the following command:
120+
121+
```bash
122+
rm -rf ~/.ssm
123+
```
124+
125+
126+
# License
127+
GPL-2.0 License

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var inputPort = ""
1313
var rootCmd = &cobra.Command{
1414
Use: "ssm",
1515
Short: "A Sub-Store Manager CLI",
16-
Long: `A Sub-Store Manager CLI for managing sub-store in Linux`,
16+
Long: `A Sub-Store Manager CLI for managing sub-store`,
1717
}
1818

1919
func init() {

0 commit comments

Comments
 (0)