Commit fb101af
Eric Bower
·
2026-03-01 20:48:19 -0500 EST
parent 4552aa5
docs(pgs): more usage for help page
1 files changed,
+38,
-15
+38,
-15
| ... | ... | @@ -127,64 +127,87 @@ func (c *Cmd) RmProjectAssets(projectName string) error { | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | func (c *Cmd) help() { | |
| 130 | - | helpStr := "Commands: [help, stats, ls, fzf, rm, link, unlink, prune, retain, depends, acl, cache]\r\n" | |
| 131 | - | helpStr += "NOTICE:" + " *must* append with `--write` for the changes to persist.\r\n" | |
| 130 | + | helpStr := `pgs.sh | |
| 131 | + | ====== | |
| 132 | + | ||
| 133 | + | Deploy static sites with a single command. No passwords. No config files. No CI setup. Just your SSH key and rsync. | |
| 134 | + | ||
| 135 | + | rsync --delete -rv ./public/ pgs.sh:/mysite | |
| 136 | + | # => https://erock-mysite.pgs.sh | |
| 137 | + | ||
| 138 | + | That's the entire workflow. Your SSH key is your identity and every deploy is instant. | |
| 139 | + | ||
| 140 | + | You can fetch project assets with the same command in reverse: | |
| 141 | + | ||
| 142 | + | rsync -rv pgs.sh:/mysite/ ./public/ | |
| 143 | + | ||
| 144 | + | You can also use unix pipes to directly upload files by providing the project name as part of the path: | |
| 145 | + | ||
| 146 | + | echo "<body>hello world!</body>" | ssh pgs.sh /mysite/index.html | |
| 147 | + | # => https://erock-mysite.pgs.sh/index.html | |
| 148 | + | ||
| 149 | + | The leading "/" is important. | |
| 150 | + | ` | |
| 151 | + | helpStr += "\r\nCommands: [help, stats, ls, fzf, rm, link, unlink, prune, retain, depends, acl, cache]\r\n" | |
| 152 | + | helpStr += "For most of these commands you can provide a `-h` to learn about its usage.\r\n" | |
| 153 | + | helpStr += "\r\n> NOTICE:" + " *must* append with `--write` for the changes to persist.\r\n" | |
| 132 | 154 | c.output(helpStr) | |
| 133 | - | projectName := "projA" | |
| 155 | + | projectName := "{project}" | |
| 134 | 156 | ||
| 135 | 157 | data := [][]string{ | |
| 136 | 158 | { | |
| 137 | 159 | "help", | |
| 138 | - | "prints this screen", | |
| 160 | + | "Prints this screen", | |
| 139 | 161 | }, | |
| 140 | 162 | { | |
| 141 | 163 | "stats", | |
| 142 | - | "usage statistics", | |
| 164 | + | "Usage statistics (quota, % quota used, number of projects)", | |
| 143 | 165 | }, | |
| 144 | 166 | { | |
| 145 | 167 | "ls", | |
| 146 | - | "lists projects", | |
| 168 | + | "Lists all projects and meta data", | |
| 147 | 169 | }, | |
| 148 | 170 | { | |
| 149 | 171 | fmt.Sprintf("fzf %s", projectName), | |
| 150 | - | fmt.Sprintf("lists urls of all assets in %s", projectName), | |
| 172 | + | "Lists urls of all assets in project", | |
| 151 | 173 | }, | |
| 152 | 174 | { | |
| 153 | 175 | fmt.Sprintf("rm %s", projectName), | |
| 154 | - | fmt.Sprintf("delete %s", projectName), | |
| 176 | + | "Removes all files in project and then deletes the project", | |
| 155 | 177 | }, | |
| 156 | 178 | { | |
| 157 | 179 | fmt.Sprintf("link %s --to projB", projectName), | |
| 158 | - | fmt.Sprintf("symbolic link `%s` to `projB`", projectName), | |
| 180 | + | fmt.Sprintf("Instant promotion and rollback mechanism that symbolic links %s to `projB`", projectName), | |
| 159 | 181 | }, | |
| 160 | 182 | { | |
| 161 | 183 | fmt.Sprintf("unlink %s", projectName), | |
| 162 | - | fmt.Sprintf("removes symbolic link for `%s`", projectName), | |
| 184 | + | "Removes symbolic link", | |
| 163 | 185 | }, | |
| 164 | 186 | { | |
| 165 | 187 | fmt.Sprintf("prune %s", projectName), | |
| 166 | - | fmt.Sprintf("removes projects that match prefix `%s`", projectName), | |
| 188 | + | "Delete all projects matching a prefix (except projects with linked projects)", | |
| 167 | 189 | }, | |
| 168 | 190 | { | |
| 169 | 191 | fmt.Sprintf("retain %s", projectName), | |
| 170 | - | "alias to `prune` but keeps last N projects", | |
| 192 | + | "Delete all projects matching a prefix except the last N recently updated projects.", | |
| 171 | 193 | }, | |
| 172 | 194 | { | |
| 173 | 195 | fmt.Sprintf("depends %s", projectName), | |
| 174 | - | fmt.Sprintf("lists all projects linked to `%s`", projectName), | |
| 196 | + | "Lists all projects linked to project", | |
| 175 | 197 | }, | |
| 176 | 198 | { | |
| 177 | 199 | fmt.Sprintf("acl %s", projectName), | |
| 178 | - | fmt.Sprintf("access control for `%s`", projectName), | |
| 200 | + | "Access control for project", | |
| 179 | 201 | }, | |
| 180 | 202 | { | |
| 181 | 203 | fmt.Sprintf("cache %s", projectName), | |
| 182 | - | fmt.Sprintf("clear http cache for `%s`", projectName), | |
| 204 | + | "Clear http cache", | |
| 183 | 205 | }, | |
| 184 | 206 | } | |
| 185 | 207 | ||
| 186 | 208 | writer := NewTabWriter(c.Session) | |
| 187 | 209 | _, _ = fmt.Fprintln(writer, "Cmd\tDescription") | |
| 210 | + | _, _ = fmt.Fprintf(writer, "===\t===========\r\n") | |
| 188 | 211 | for _, dat := range data { | |
| 189 | 212 | _, _ = fmt.Fprintf(writer, "%s\t%s\r\n", dat[0], dat[1]) | |
| 190 | 213 | } |