ploicloud (short alias: pcctl) is the official command-line interface for Ploi Cloud. Every REST endpoint is exposed as a subcommand, auto-generated from the platform's OpenAPI spec.
ploicloud login
ploicloud applications list
ploicloud applications deploy 42
pcctl whoamiHomebrew:
brew install ploicloud/tap/ploicloudDirect binary: grab the right archive for your OS/arch from Releases and drop ploicloud (and pcctl) somewhere on your $PATH.
brew upgrade ploicloudOr re-download the latest binary from the Releases page.
You need Go 1.25+ and make.
git clone [email protected]:ploicloud/cli.git
cd cli
make build
./bin/ploicloud --helpmake build does three things: regenerates the cobra command tree from the committed OpenAPI spec, compiles cmd/ploicloud, and copies the result to a second binary named pcctl.
Useful targets:
make build # regenerate + compile into ./bin/{ploicloud,pcctl}
make generate # only regenerate ./internal/commands/zz_generated.go
make sync-spec # curl https://ploi.cloud/docs/api.json -> gen/spec.json
make test # go test ./...
make clean # rm -rf bin/ dist/ zz_generated.goPoint the CLI at a non-production API (e.g. local dev or a staging deploy):
./bin/ploicloud --api-url=https://ploi.test applications listThe --api-url flag is honored on every subcommand. To persist it:
mkdir -p ~/.ploicloud
cat > ~/.ploicloud/config.toml <<EOF
api_url = "https://ploi.test"
EOFCustom OAuth client_id at build time (the production UUID is hardcoded as the default):
make build CLIENT_ID=<some-other-passport-client-uuid>Running a single test package:
go test ./internal/auth/ -vOne command, no prompts:
make releaseWhat it does:
- Aborts if the working tree has uncommitted changes.
- Pulls latest from
origin(if upstream is set). - Runs
make sync-specto pull the freshest OpenAPI spec fromhttps://ploi.cloud/docs/api.json. - Regenerates commands, builds, runs tests. Fails fast if anything breaks.
- Auto-bumps the patch version from the latest git tag (
v0.0.4 → v0.0.5). - Commits
gen/spec.jsonif it changed. - Tags the commit and pushes with
--follow-tags.
The tag push triggers .github/workflows/release.yml, which runs goreleaser:
- Builds darwin/linux/windows × amd64/arm64 binaries.
- Uploads archives containing both
ploicloudandpcctlto a new GitHub Release. - Updates the
ploicloud/homebrew-tapformula, sobrew upgrade ploicloudimmediately sees the new version.
Required GitHub secrets (configured in repo settings):
HOMEBREW_TAP_GITHUB_TOKEN— PAT withreposcope onploicloud/homebrew-tapso goreleaser can push the formula update.OAUTH_CLIENT_ID— the Passport public client UUID (019e5393-…); baked into release binaries via ldflags.
The OpenAPI spec at gen/spec.json is the source of truth. gen/cmdgen/main.go parses it at build time and emits internal/commands/zz_generated.go — one cobra Command per operation, with path params as positional args and query/body params as typed flags. The CLI sends bearer-authenticated HTTPS requests via internal/client/transport.go and prints JSON. No runtime spec parsing, no reflection.
When the platform API changes, make release re-fetches the spec and regenerates everything in lockstep with the version bump.