|
| 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 |
0 commit comments