Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ github.token }}
# Writes Formula/modapi.rb to moderation-api/homebrew-tap: a
# fine-grained token with Contents read and write on that repo.
# Without it the release skips the Homebrew step.
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
- name: Set the release notes
if: steps.version.outputs.release == 'true'
env:
Expand Down
17 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,20 @@ release:

checksum:
name_template: "checksums.txt"

brews:
- name: modapi
repository:
owner: moderation-api
name: homebrew-tap
branch: main
token: '{{ envOrDefault "HOMEBREW_TAP_GITHUB_TOKEN" "" }}'
directory: Formula
skip_upload: '{{ if eq (envOrDefault "HOMEBREW_TAP_GITHUB_TOKEN" "") "" }}true{{ end }}'
homepage: "https://github.com/moderation-api/cli"
description: "Moderation API CLI: moderate content and manage your setup from the terminal"
license: "Apache-2.0"
install: |
bin.install "modapi"
test: |
system "#{bin}/modapi", "--version"
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ management:
docVersion: 1.1.0
speakeasyVersion: internal
generationVersion: internal
releaseVersion: 0.3.1
configChecksum: 99f8043a4f200e744b343a38011b23da
releaseVersion: 0.3.2
configChecksum: 2f6db893bc71d7bdbd1a7219264cc100
repoURL: https://github.com/moderation-api/cli
installationURL: https://github.com/moderation-api/cli
published: true
Expand Down Expand Up @@ -127,7 +127,7 @@ trackedFiles:
internal/cli/root.go:
last_write_checksum: sha1:d00799a3804f87479242f16bf520cb593f79ba8e
internal/cli/version.go:
last_write_checksum: sha1:f2e17462a6cd320d11a4233eee5b94fcf845824b
last_write_checksum: sha1:65375a19e7575da07cebb5a962f6a9f3d0f0aba8
internal/cli/webhooks/create.go:
last_write_checksum: sha1:98c73266c8954efcf0da2493ae41909df45a38f0
internal/cli/webhooks/delete.go:
Expand Down Expand Up @@ -367,7 +367,7 @@ trackedFiles:
internal/sdk/models/sdkerrors/sdkdefaulterror.go:
last_write_checksum: sha1:437b3a3eacb54d8648a68f80b3cd38fa5019f006
internal/sdk/moderationapi.go:
last_write_checksum: sha1:0f7dd6f3d5490e62e41da356113c57328f1caa79
last_write_checksum: sha1:762e382d4349381c9005341e5d9c3bd27124f3bb
internal/sdk/optionalnullable/optionalnullable.go:
last_write_checksum: sha1:b828c94c45116e632925027e4e2c211e971e04e2
internal/sdk/optionalnullable/optionalnullable_test.go:
Expand Down Expand Up @@ -429,7 +429,7 @@ trackedFiles:
internal/usage/bodyschemas.go:
last_write_checksum: sha1:06404c8b3b7c87ea76f8722c2aeaa1d17baac650
internal/usage/schema.go:
last_write_checksum: sha1:7765bf7055ca5f4f99e853f313768f00d0b748bc
last_write_checksum: sha1:22776c578f96949fb1677f6078c62fdea445de1f
scripts/install.ps1:
last_write_checksum: sha1:bd3a52c28f647ed881c6e8d72abf2d84216976c9
scripts/install.sh:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: false
cli:
version: 0.3.1
version: 0.3.2
additionalDependencies: {}
agentEnvironmentDetection: true
arrayFlagFormat: repeatable
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.3.2 (2026-10-23)

Full Changelog: [v0.3.1...v0.3.2](https://github.com/moderation-api/cli/compare/v0.3.1...v0.3.2)

### Chores

- Update the generated code.

## 0.3.1 (2026-10-23)

Full Changelog: [v0.3.0...v0.3.1](https://github.com/moderation-api/cli/compare/v0.3.0...v0.3.1)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ More information about the API can be found at https://docs.moderationapi.com
<!-- Start CLI Installation [installation] -->
## CLI Installation

### Homebrew (macOS/Linux)

```bash
brew install moderation-api/tap/modapi
```

### Quick Install (Linux/macOS)

```bash
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// which propagates the value here (see cmd/modapi/main.go):
//
// go build -ldflags "-X main.version=x.y.z" ./cmd/modapi
var Version = "0.3.1"
var Version = "0.3.2"

// BuildTime is optionally set at build time via ldflags targeting the main package.
var BuildTime string
Expand Down
6 changes: 3 additions & 3 deletions internal/sdk/moderationapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ func WithTimeout(timeout time.Duration) SDKOption {
// New creates a new instance of the SDK with the provided options
func New(opts ...SDKOption) *ModerationAPI {
sdk := &ModerationAPI{
SDKVersion: "0.3.1",
SDKVersion: "0.3.2",
sdkConfiguration: config.SDKConfiguration{
UserAgent: "speakeasy-sdk/go 0.3.1 internal 1.1.0 github.com/moderation-api/cli/internal/sdk",
SDKVersion: "0.3.1",
UserAgent: "speakeasy-sdk/go 0.3.2 internal 1.1.0 github.com/moderation-api/cli/internal/sdk",
SDKVersion: "0.3.2",
GenVersion: "internal",
OpenAPIDocVersion: "1.1.0",
ServerList: ServerList,
Expand Down
2 changes: 1 addition & 1 deletion internal/usage/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type usageNode struct {
}

var usageNodes = map[string]usageNode{
"": {head: "name \"modapi\"\nbin \"modapi\"\nabout \"Moderation API: Moderate text, images, video and audio in real time, manage authors, review queues and actions, and receive webhooks.\"\nversion \"0.3.1\"\nconfig {\n file \"~/.config/modapi/config.yaml\"\n}", flags: []usageItem{{key: "usage", text: "flag \"--usage\" help=\"Print the CLI Usage schema in KDL format\" global=#true"}, {key: "version", text: "flag \"-v --version\" help=\"Print the CLI version\""}, {key: "output-format", text: "flag \"-o --output-format <format>\" help=\"Specify the output format. Options: pretty, json, yaml, table, toon.\" global=#true config=\"output_format\" default=\"pretty\""}, {key: "color", text: "flag \"--color <color>\" help=\"Control colored output: auto (color when output is a TTY), always, or never. Respects NO_COLOR and FORCE_COLOR env vars.\" global=#true default=\"auto\""}, {key: "jq", text: "flag \"-q --jq <jq>\" help=\"Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id')\" global=#true"}, {key: "raw-output", text: "flag \"--raw-output\" help=\"Write --jq string results as raw text instead of JSON strings (like jq -r); non-string results stay JSON\" global=#true default=#false"}, {key: "server-url", text: "flag \"--server-url <url>\" help=\"Override the default server URL\" global=#true"}, {key: "server", text: "flag \"--server <server>\" help=\"Select a server by index (for indexed servers) or name (for named servers)\" global=#true"}, {key: "header", text: "flag \"-H --header <header...>\" help=\"Set a custom HTTP request header (format: \\\"Key: Value\\\"). Can be specified multiple times.\" global=#true var=#true"}, {key: "include-headers", text: "flag \"--include-headers\" help=\"Include HTTP response headers in the output\" global=#true default=#false"}, {key: "timeout", text: "flag \"--timeout <duration>\" help=\"HTTP request timeout (e.g., 30s, 5m, 100ms)\" global=#true config=\"timeout\""}, {key: "interactive", text: "flag \"--interactive\" help=\"Prompt for missing inputs and open guided configure/auth forms (forms fall back to line prompts on stdin off-TTY)\" global=#true default=#true"}, {key: "no-interactive", text: "flag \"--no-interactive\" help=\"Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms)\" global=#true default=#false"}, {key: "dry-run", text: "flag \"--dry-run\" help=\"Preview API requests without sending them (no network, no OS keychain). Human preview on stderr; with -o json or --jq, one JSON object per request on stdout. Local mutation commands (auth login, auth logout and configure) make no request: they skip prompts and writes and report a no-op (stderr, or one JSON object on stdout in the machine form)\" global=#true default=#false"}, {key: "debug", text: "flag \"-d --debug\" help=\"Log request and response diagnostics to stderr\" global=#true default=#false"}, {key: "agent-mode", text: "flag \"--agent-mode\" help=\"Enable structured errors and default TOON output for AI coding agents. Automatically enabled when a known agent environment is detected (CLAUDECODE, CURSOR_AGENT, etc.). Use --agent-mode=false to disable.\" global=#true default=#false"}, {key: "secret-key", text: "flag \"--secret-key <secret_key>\" help=\"HTTP Bearer\" global=#true env=\"MODAPI_SECRET_KEY\" config=\"security.secret_key\""}, {key: "no-keyring", text: "flag \"--no-keyring\" help=\"Never read or write the OS keychain; store secrets in the config file instead\" global=#true env=\"MODAPI_NO_KEYRING\" config=\"no_keyring\" default=#false"}}, children: []string{"account", "actions", "auth", "authors", "channels", "completion", "configure", "content", "explore", "help", "projects", "queue", "version", "webhook-secret", "webhooks", "whoami", "wordlist"}},
"": {head: "name \"modapi\"\nbin \"modapi\"\nabout \"Moderation API: Moderate text, images, video and audio in real time, manage authors, review queues and actions, and receive webhooks.\"\nversion \"0.3.2\"\nconfig {\n file \"~/.config/modapi/config.yaml\"\n}", flags: []usageItem{{key: "usage", text: "flag \"--usage\" help=\"Print the CLI Usage schema in KDL format\" global=#true"}, {key: "version", text: "flag \"-v --version\" help=\"Print the CLI version\""}, {key: "output-format", text: "flag \"-o --output-format <format>\" help=\"Specify the output format. Options: pretty, json, yaml, table, toon.\" global=#true config=\"output_format\" default=\"pretty\""}, {key: "color", text: "flag \"--color <color>\" help=\"Control colored output: auto (color when output is a TTY), always, or never. Respects NO_COLOR and FORCE_COLOR env vars.\" global=#true default=\"auto\""}, {key: "jq", text: "flag \"-q --jq <jq>\" help=\"Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id')\" global=#true"}, {key: "raw-output", text: "flag \"--raw-output\" help=\"Write --jq string results as raw text instead of JSON strings (like jq -r); non-string results stay JSON\" global=#true default=#false"}, {key: "server-url", text: "flag \"--server-url <url>\" help=\"Override the default server URL\" global=#true"}, {key: "server", text: "flag \"--server <server>\" help=\"Select a server by index (for indexed servers) or name (for named servers)\" global=#true"}, {key: "header", text: "flag \"-H --header <header...>\" help=\"Set a custom HTTP request header (format: \\\"Key: Value\\\"). Can be specified multiple times.\" global=#true var=#true"}, {key: "include-headers", text: "flag \"--include-headers\" help=\"Include HTTP response headers in the output\" global=#true default=#false"}, {key: "timeout", text: "flag \"--timeout <duration>\" help=\"HTTP request timeout (e.g., 30s, 5m, 100ms)\" global=#true config=\"timeout\""}, {key: "interactive", text: "flag \"--interactive\" help=\"Prompt for missing inputs and open guided configure/auth forms (forms fall back to line prompts on stdin off-TTY)\" global=#true default=#true"}, {key: "no-interactive", text: "flag \"--no-interactive\" help=\"Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms)\" global=#true default=#false"}, {key: "dry-run", text: "flag \"--dry-run\" help=\"Preview API requests without sending them (no network, no OS keychain). Human preview on stderr; with -o json or --jq, one JSON object per request on stdout. Local mutation commands (auth login, auth logout and configure) make no request: they skip prompts and writes and report a no-op (stderr, or one JSON object on stdout in the machine form)\" global=#true default=#false"}, {key: "debug", text: "flag \"-d --debug\" help=\"Log request and response diagnostics to stderr\" global=#true default=#false"}, {key: "agent-mode", text: "flag \"--agent-mode\" help=\"Enable structured errors and default TOON output for AI coding agents. Automatically enabled when a known agent environment is detected (CLAUDECODE, CURSOR_AGENT, etc.). Use --agent-mode=false to disable.\" global=#true default=#false"}, {key: "secret-key", text: "flag \"--secret-key <secret_key>\" help=\"HTTP Bearer\" global=#true env=\"MODAPI_SECRET_KEY\" config=\"security.secret_key\""}, {key: "no-keyring", text: "flag \"--no-keyring\" help=\"Never read or write the OS keychain; store secrets in the config file instead\" global=#true env=\"MODAPI_NO_KEYRING\" config=\"no_keyring\" default=#false"}}, children: []string{"account", "actions", "auth", "authors", "channels", "completion", "configure", "content", "explore", "help", "projects", "queue", "version", "webhook-secret", "webhooks", "whoami", "wordlist"}},
"account": {head: "cmd \"account\" help=\"Operations for account\"", children: []string{"retrieve"}},
"account retrieve": {head: "cmd \"retrieve\" help=\"Get account details\"", flags: []usageItem{{key: "project-id", text: " flag \"-p --project-id <project_id>\" help=\"The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.\""}}},
"actions": {head: "cmd \"actions\" help=\"Operations for actions\"", children: []string{"create", "delete", "execute", "list", "retrieve", "update"}},
Expand Down
Loading