Skip to content

Commit 9fb51d3

Browse files
committed
add hugo docs into this repo
1 parent fbf8c3e commit 9fb51d3

36 files changed

+7670
-24
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ tmp/
1111
dist/
1212
pig
1313
.DS_Store
14-
CLAUDE.md
14+
CLAUDE.md
15+
.hugo_build.lock
16+
public/

Makefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,9 @@ c: clean
5555
clean:
5656
rm -rf pig
5757
d:
58-
bin/dist
59-
dd:
60-
bin/dist2
61-
t: tb tt
62-
tb:
63-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o pig
64-
scp pig meta:/tmp/pig
65-
tt:
66-
ssh sv "/tmp/pig status"
67-
68-
58+
hugo serve
59+
b:
60+
hugo --minify
6961

7062

7163
.PHONY: run build clean build-linux-amd64 build-linux-arm64 release release-linux linux-amd64 linux-arm64

docs/_index.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: PIG CLI
3+
description: The Missing Package Manager for PostgreSQL Extensions
4+
icon: PiggyBank
5+
full: true
6+
cascade:
7+
type: docs
8+
breadcrumbs: false
9+
comments: false
10+
---
11+
12+
13+
—— ***Postgres Install Genius, the missing extension package manager for PostgreSQL ecosystem***
14+
15+
{{< cards >}}
16+
{{< card link="/intro" title="Introduction" subtitle="Why we need a package manager" icon="sparkles" >}}
17+
{{< card link="/start" title="Get Started" subtitle="Tutorial and examples" icon="play" >}}
18+
{{< card link="/install" title="Installation" subtitle="Install in different ways" icon="save" >}}
19+
{{< /cards >}}
20+
21+
22+
23+
## Quick Start
24+
25+
[Install](/install) `pig` with a single command
26+
27+
```bash tab="Global"
28+
curl -fsSL https://repo.pigsty.io/pig | bash
29+
```
30+
31+
32+
Then it’s ready to use, assume you want to install the [**`pg_duckdb`**](/e/pg_duckdb/) extension:
33+
34+
```bash
35+
$ pig repo add pigsty pgdg -u # add pgdg & pigsty repo, then update repo cache
36+
$ pig ext install pg17 # install PostgreSQL 17 kernels with native PGDG packages
37+
$ pig ext install pg_duckdb # install the pg_duckdb extension (for current pg17)
38+
```
39+
40+
41+
## CLI Usage
42+
43+
Check sub-commands [documentation](/cmd) with `pig help <command>`
44+
45+
{{< cards cols="5" >}}
46+
{{< card link="/cmd/repo" title="pig repo" subtitle="Manage software repositories" icon="library" >}}
47+
{{< card link="/cmd/ext" title="pig ext" subtitle="Manage postgres extensions" icon="cube" >}}
48+
{{< card link="/cmd/build" title="pig build" subtitle="Build extension from source" icon="view-grid" >}}
49+
{{< card link="/cmd/sty" title="pig sty" subtitle="Manage pigsty installation" icon="cloud-download" >}}
50+
{{< /cards >}}
51+
52+
53+
54+
## Source
55+
56+
The `pig` CLI is developed by [Vonng](https://blog.vonng.com/en/), and open-sourced under the [Apache License 2.0](https://github.com/pgsty/pig/?tab=Apache-2.0-1-ov-file#readme).
57+
58+
You can also check the [pigsty](https://pgsty.com) project, which makes it even smoother to deliver all these [extensions](/usage) in an IaC way:
59+
60+
- https://github.com/pgsty/pigsty
61+
- https://github.com/pgsty/pig

docs/_index.zh.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: PIG CLI
3+
description: PostgreSQL 与扩展生态包管理器
4+
icon: PiggyBank
5+
full: true
6+
cascade:
7+
type: docs
8+
breadcrumbs: false
9+
comments: false
10+
---
11+
12+
—— **Postgres Install Genius,PostgreSQL 生态中缺失的扩展包管理器**
13+
14+
{{< cards >}}
15+
{{< card link="/intro" title="Introduction" subtitle="为什么我们需要一个PG专用包管理器?" icon="sparkles" >}}
16+
{{< card link="/start" title="Get Started" subtitle="快速上手与样例" icon="play" >}}
17+
{{< card link="/install" title="Installation" subtitle="下载、安装、更新 pig" icon="save" >}}
18+
{{< /cards >}}
19+
20+
## 快速上手
21+
22+
使用以下命令即可[快速上手](/zh/pig/start) PIG 包管理器:
23+
24+
```bash tab="default"
25+
curl -fsSL https://repo.pigsty.io/pig | bash
26+
```
27+
```bash tab="mirror"
28+
curl -fsSL https://repo.pigsty.cc/pig | bash
29+
```
30+
31+
安装完成后,即可使用。例如,若需安装 [**`pg_duckdb`**](/zh/e/pg_duckdb/) 扩展:
32+
33+
```bash
34+
$ pig repo add pigsty pgdg -u # 添加 pgdg 与 pigsty 源,并更新仓库缓存
35+
$ pig ext install pg17 # 安装 PostgreSQL 17 内核(原生 PGDG 包)
36+
$ pig ext install pg_duckdb # 安装 pg_duckdb 扩展(针对当前 pg17)
37+
```
38+
39+
--------
40+
41+
<Cards>
42+
<Card icon={<Zap className="text-green-500"/>} title='快速上手' href={"/zh/pig/start"}>
43+
PIG CLI 快速上手
44+
</Card>
45+
<Card icon={<Download className="text-blue-600"/>} title='安装' href={"/zh/pig/install"}>
46+
安装 PostgreSQL 扩展
47+
</Card>
48+
<Card icon={<HelpCircle className="text-purple-600"/>} title='特性' href={"/zh/pig/why"}>
49+
为什么需要 PostgreSQL 包管理器?
50+
</Card>
51+
<Card icon={<Rocket className="text-orange-500"/>} title='发布说明' href={"/zh/pig/release"}>
52+
PIG 命令行工具发布说明
53+
</Card>
54+
</Cards>
55+
56+
--------
57+
58+
## 命令
59+
60+
你可以执行 `pig help <command>` 获取子命令的详细帮助。
61+
62+
<Cards>
63+
<Card icon={<Terminal className="text-slate-600"/>} title='pig' href={"/zh/pig/pig"}>
64+
主命令行接口
65+
</Card>
66+
<Card icon={<Package className="text-indigo-600"/>} title='pig repo' href={"/zh/pig/repo"}>
67+
管理 Linux 发行版的软件仓库
68+
</Card>
69+
<Card icon={<Puzzle className="text-emerald-600"/>} title='pig ext' href={"/zh/pig/ext"}>
70+
安装、移除、搜索、扫描 PostgreSQL 扩展
71+
</Card>
72+
<Card icon={<Hammer className="text-amber-600"/>} title='pig build' href={"/zh/pig/build"}>
73+
配置扩展构建环境并编译扩展
74+
</Card>
75+
</Cards>
76+
77+
--------
78+
79+
## 源代码
80+
81+
`pig` 命令行工具由 [Vonng](https://vonng.com/en/)(冯若航 [email protected])开发,并以 [Apache 2.0](https://github.com/pgsty/pig/?tab=Apache-2.0-1-ov-file#readme) 许可证开源。
82+
83+
更多信息请参见 [pigsty](https://pgsty.com) 项目,可一键高效交付所有扩展:
84+
85+
- https://github.com/pgsty/pig
86+
- https://github.com/pgsty/pigsty

docs/cmd/_index.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: "CLI Usage"
3+
description: Overview of the pig cli tool
4+
icon: SquareTerminal
5+
weight: 600
6+
---
7+
8+
## Overview
9+
10+
```bash
11+
pig - the Linux Package Manager for PostgreSQL and CLI tool for Pigsty
12+
13+
Usage:
14+
pig [command]
15+
16+
Examples:
17+
18+
# get started: check https://github.com/pgsty/pig for details
19+
pig repo add -ru # overwrite existing repo & update cache
20+
pig ext add pg17 # install optional postgresql 17 package
21+
pig ext add pg_duckdb # install certain postgresql extension
22+
23+
pig repo : add rm update list info status create boot cache
24+
pig ext : add rm update list info status import link build
25+
pig sty : init boot conf install get list
26+
27+
28+
PostgreSQL Extension Manager
29+
ext Manage PostgreSQL Extensions (pgext)
30+
repo Manage Linux Software Repo (apt/dnf)
31+
32+
Pigsty Management Commands
33+
sty Manage Pigsty Installation
34+
35+
Additional Commands:
36+
build Build Postgres Extension
37+
completion Generate the autocompletion script for the specified shell
38+
help Help about any command
39+
status Show Environment Status
40+
update Upgrade pig itself
41+
version Show pig version info
42+
43+
Flags:
44+
--debug enable debug mode
45+
-h, --help help for pig
46+
-i, --inventory string config inventory path
47+
--log-level string log level: debug, info, warn, error, fatal, panic (default "info")
48+
--log-path string log file path, terminal by default
49+
-t, --toggle Help message for toggle
50+
51+
Use "pig [command] --help" for more information about a command.
52+
```
53+
54+
------
55+
56+
## Examples
57+
58+
### Environment Status
59+
60+
```bash
61+
pig status # show os & pg & pig status
62+
pig repo status # show upstream repo status
63+
pig ext status # show pg extensions status
64+
```
65+
66+
### Extension Management
67+
68+
Check [`pig ext`](/cmd/ext/) for details.
69+
70+
```bash
71+
pig ext list [query] # list & search extension
72+
pig ext info [ext...] # get information of a specific extension
73+
pig ext status [-v] # show installed extension and pg status
74+
pig ext add [ext...] # install extension for current pg version
75+
pig ext rm [ext...] # remove extension for current pg version
76+
pig ext update [ext...] # update extension to the latest version
77+
pig ext import [ext...] # download extension to local repo
78+
pig ext link [ext...] # link postgres installation to path
79+
pig ext upgrade # fetch the latest extension catalog
80+
```
81+
82+
### Repo Management
83+
84+
Check [`pig repo`](/cmd/repo/) for details.
85+
86+
```bash
87+
pig repo list # available repo list
88+
pig repo info [repo|module...] # show repo info
89+
pig repo status # show current repo status
90+
pig repo add [repo|module...] # add repo and modules
91+
pig repo rm [repo|module...] # remove repo & modules
92+
pig repo update # update repo pkg cache
93+
pig repo create # create repo on current system
94+
pig repo boot # boot repo from offline package
95+
pig repo cache # cache repo as offline package
96+
```
97+
98+
### Pigsty Management
99+
100+
Check [`pig sty`](/cmd/sty/) for details.
101+
102+
The pig can also be used as a cli tool for Pigsty — the battery-include free PostgreSQL RDS.
103+
Which brings HA, PITR, Monitoring, IaC, and all the extensions to your PostgreSQL cluster.
104+
105+
```bash
106+
pig sty init # install pigsty to ~/pigsty
107+
pig sty boot # install ansible and other pre-deps
108+
pig sty conf # auto-generate pigsty.yml config file
109+
pig sty install # run the install.yml playbook
110+
```
111+
112+
You can use the `pig sty` subcommand to bootstrap pigsty on current node.

0 commit comments

Comments
 (0)