63 lines
1.5 KiB
Markdown
63 lines
1.5 KiB
Markdown
# preseem
|
|
|
|
Small Go CLI for the [Preseem Model API](https://api.preseem.com/model/v1).
|
|
Read-only fan-out across every resource in `preseem.yaml` (the bundled
|
|
OpenAPI spec).
|
|
|
|
## Build
|
|
|
|
```bash
|
|
go build .
|
|
go test ./...
|
|
```
|
|
|
|
## Auth
|
|
|
|
```bash
|
|
export PRESEEM_KEY=<api key> # required
|
|
export PRESEEM_URL=https://api.preseem.com # optional override
|
|
```
|
|
|
|
Add to `.envrc` for direnv auto-load. The key is sent as HTTP Basic
|
|
username with an empty password, per the Preseem spec.
|
|
|
|
## Usage
|
|
|
|
```
|
|
preseem <resource> <verb> [args] [flags]
|
|
```
|
|
|
|
Resources: `accounts`, `ap`, `ap-config`, `ap-scores`, `cpe-scores`,
|
|
`packages`, `services`, `routers`, `olts`, `sites`.
|
|
|
|
List flags: `--json`, `--page N`, `--limit 100..1000`. Without
|
|
`--page`, list endpoints auto-paginate; with `--json`, the merged
|
|
output keeps the API's `{data, paginator}` envelope.
|
|
|
|
```bash
|
|
preseem accounts list
|
|
preseem accounts get 100
|
|
preseem ap list
|
|
preseem ap get 123
|
|
preseem ap-config get 123
|
|
preseem ap-scores
|
|
preseem cpe-scores
|
|
preseem packages list
|
|
preseem services list
|
|
preseem services get 23
|
|
preseem routers list
|
|
preseem olts list
|
|
preseem sites list
|
|
|
|
preseem accounts list --json | jq '.data | length'
|
|
preseem ap list --page 1 --limit 100
|
|
```
|
|
|
|
IDs containing `/` are URL-encoded automatically
|
|
(`accounts/john/doe` → `accounts/john%2Fdoe`).
|
|
|
|
## Scope
|
|
|
|
Read-only (GET) for the whole spec. PUT/DELETE wrappers are
|
|
intentionally not implemented — the spec is small and stable, so add
|
|
them in `cmd_*.go` when an actual write workflow shows up.
|