carlos / platform Public

cli: domains cert import and remove (#1429)

carlos domains cert import --app <a> --cert <file> --key <file>
[--allow-wildcard] <hostname> reads the two files locally (refusing one
over 64 KiB), sends them to the console's import door and prints the
issuer, expiry date and SHA-256, then the curl --resolve check to run on
a non-hub edge before moving DNS. carlos domains cert remove stops
serving the import. File contents are never printed. Platform operators
only (clireg Operator audience, parity row domains-cert).

Strings in domains_cert_copy.go. docs/site/cli.md gains a heading per
verb; the golden corpus gains the cert cases and the domains usage
paragraph.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev fd85dd91f8d78cbf3e61c8cac0a391d9fffb81a8 parent 01a8140
9 files changed, +500 −8
  • docs/parity.md +1 −0
  • docs/site/cli.md +47 −0
  • domains_cert_cli.go +201 −0
  • domains_cert_cli_test.go +163 −0
  • domains_cert_copy.go +66 −0
  • domains_cli.go +3 −2
  • parity/cli.tsv +2 −0
  • parity/parity.tsv +1 −0
  • testdata/clireg-golden.jsonl +16 −6

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-WltoU6
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/superfly/ltx v0.5.1
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23
go: downloading github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1

amadan: job cancelled — a newer push superseded it
diff --git a/docs/parity.md b/docs/parity.md
index bded9f82c..97a8ca7ad 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -420,6 +420,7 @@ Discussion #1289.
| Row | Area | CLI | Console | Note |
|---|---|---|---|---|
| apps-show | apps | `apps show` | | Operator only: the policy read needs a system operator (apiSystemRoller). Reads the instance policy (egress, size). |
+| domains-cert | domains | `domains cert import`<br>`domains cert remove` | | Operator only: a platform operator imports a certificate and key they already hold for an attached hostname, so it is served before its DNS moves, and removes it. |
| email-pause | email | `email pause`<br>`email resume` | | Operator only: pause and resume need a console operator on the mail-operator allowlist (CARLOS_MAIL_OPERATORS). |
| op-pages | operator | | `GET /fleet`<br>`GET /fleet/activity`<br>`GET /fleet/index`<br>`GET /fleet/people`<br>`GET /fleet/people/{address}`<br>`GET /fleet/metrics` | Operator pages with no CLI read. |
| op-alerts | operator | | `GET /fleet/alerts`<br>`GET /fleet/alerts/history`<br>`/fleet/alerts/connectors`<br>`/fleet/alerts/connectors/{id}/test`<br>`/fleet/alerts/connectors/{id}/confirm-link`<br>`/fleet/alerts/connectors/{id}/delete`<br>`/fleet/alerts/rules/{rule}` | Fleet alert connectors and rules, operator pages only. |
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 4224e8340..b97b42289 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -1989,6 +1989,53 @@ With configured ingress, DNS guidance uses A records for both apexes and subdoma
The root CLI help still says that `carlos domains placements` shows the addresses to point DNS at for each region. That help remains unchanged. The configured-ingress refusal limits that promise until regional placement readiness is available.
+#### carlos domains cert import
+
+A hostname whose DNS zone you don't control gets its certificate only after
+its DNS points here, so moving it means a few minutes of certificate errors.
+If you already hold a valid certificate and key for the name, import them
+first. Every edge then serves that certificate before DNS moves. Platform
+operators only.
+
+```sh
+carlos domains cert import --app shop --cert fullchain.pem --key key.pem shop.example.com
+```
+
+The hostname must already be attached to the app. `--cert` is the
+certificate for the hostname followed by its intermediates, and `--key` is
+its private key, both in PEM form and without a passphrase. The console
+checks them before it stores anything:
+
+- the key is RSA with 2048 to 4096 bits, or ECDSA on P-256 or P-384, and
+ matches the certificate;
+- the certificate leads to a publicly trusted authority and names the
+ hostname;
+- it is valid now and for more than seven more days.
+
+Revocation is not checked. A certificate that covers the hostname only
+through a wildcard, such as `*.example.com`, needs `--allow-wildcard`, and is
+still served for this one hostname only.
+
+Every box must run a release that serves imported certificates before you
+import. Then, before you move DNS, check an edge other than the hub:
+
+```sh
+curl -v --resolve shop.example.com:443:<edge address> https://shop.example.com/ -o /dev/null
+```
+
+Once DNS points here, the deployment orders its own certificate and serves
+it to every client that supports it. The imported certificate keeps serving
+the rest until it expires. To replace it, import the renewed one. Detaching
+the hostname removes its import within a minute.
+
+#### carlos domains cert remove
+
+```sh
+carlos domains cert remove --app shop shop.example.com
+```
+
+Stops serving the imported certificate. Every edge drops it within seconds.
+
### carlos features
Sets or lists an app's own feature flags — switches the app defines, the
diff --git a/domains_cert_cli.go b/domains_cert_cli.go
new file mode 100644
index 000000000..9939e6b6b
--- /dev/null
+++ b/domains_cert_cli.go
@@ -0,0 +1,201 @@
+// `carlos domains cert import|remove` (#1429): a platform operator imports
+// a certificate and key they already hold for an attached hostname, so
+// every edge serves it before the name's DNS points here, and removes it.
+// The CLI reads the two files and sends them over the console's HTTPS
+// connection; the console validates and stores them
+// (internal/console/apidomaincert.go). Nothing here prints a byte of
+// either file. Strings: domains_cert_copy.go.
+package main
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "flag"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "time"
+
+ "github.com/carlosframework/platform/internal/clireg"
+)
+
+// certFileMax is the console's body cap: a file larger than this cannot be
+// sent, so it is refused here before anything is read past it.
+const certFileMax = 64 << 10
+
+// domainsCertCommand is `carlos domains cert`: import and remove, for
+// platform operators.
+func domainsCertCommand() *clireg.Node {
+ const op = clireg.Operator
+ return &clireg.Node{
+ Name: "cert",
+ Audience: op,
+ Children: []*clireg.Node{
+ rawErr("import", op, runDomainsCertImport),
+ rawErr("remove", op, runDomainsCertRemove),
+ },
+ FallbackErr: func(args, consumed []string) error { return errors.New(domainsCertUsage) },
+ }
+}
+
+func runDomainsCertImport(args []string) error {
+ fs := flag.NewFlagSet("domains cert import", flag.ContinueOnError)
+ app := appFlag(fs, certFlagApp)
+ certPath := fs.String("cert", "", certFlagCert)
+ keyPath := fs.String("key", "", certFlagKey)
+ allowWildcard := fs.Bool("allow-wildcard", false, certFlagAllowWildcard)
+ consoleFlag := consoleOption(fs, certFlagConsole)
+ acctRaw := fs.String("account", "", certFlagAccount)
+ acctIDRaw := fs.String("account-id", "", certFlagAccountID)
+ fs.Usage = flagUsage(fs, domainsCertImportUsage)
+ pos, err := parseInterspersed(fs, args)
+ if err != nil {
+ return err
+ }
+ if len(pos) != 1 || strings.TrimSpace(pos[0]) == "" {
+ return errors.New(domainsCertImportUsage)
+ }
+ if strings.TrimSpace(*certPath) == "" || strings.TrimSpace(*keyPath) == "" {
+ return errors.New(certFilesRequired)
+ }
+ sess := requireAPISession("cert import", *consoleFlag)
+ printUsing(stdout, sess)
+ acct := resolvedAccount(sess, acctRaw, acctIDRaw)
+ app2 := resolvedApp(sess, acct, strings.TrimSpace(*app), domainsCertImportUsage)
+ return domainsCertImport(context.Background(), sess, acct, app2, strings.TrimSpace(pos[0]), *certPath, *keyPath, *allowWildcard)
+}
+
+func runDomainsCertRemove(args []string) error {
+ fs := flag.NewFlagSet("domains cert remove", flag.ContinueOnError)
+ app := appFlag(fs, certFlagApp)
+ consoleFlag := consoleOption(fs, certFlagConsole)
+ acctRaw := fs.String("account", "", certFlagAccount)
+ acctIDRaw := fs.String("account-id", "", certFlagAccountID)
+ fs.Usage = flagUsage(fs, domainsCertRemoveUsage)
+ pos, err := parseInterspersed(fs, args)
+ if err != nil {
+ return err
+ }
+ if len(pos) != 1 || strings.TrimSpace(pos[0]) == "" {
+ return errors.New(domainsCertRemoveUsage)
+ }
+ sess := requireAPISession("cert remove", *consoleFlag)
+ printUsing(stdout, sess)
+ acct := resolvedAccount(sess, acctRaw, acctIDRaw)
+ app2 := resolvedApp(sess, acct, strings.TrimSpace(*app), domainsCertRemoveUsage)
+ return domainsCertRemove(context.Background(), sess, acct, app2, strings.TrimSpace(pos[0]))
+}
+
+// readCertFile reads one of the two files, refusing one larger than the
+// console accepts. Its errors name the flag and the path, never contents.
+func readCertFile(path, flagName string) ([]byte, error) {
+ f, err := os.Open(path)
+ if err != nil {
+ return nil, fmt.Errorf(certFileUnreadable, flagName, err)
+ }
+ defer f.Close()
+ raw, err := io.ReadAll(io.LimitReader(f, certFileMax+1))
+ if err != nil {
+ return nil, fmt.Errorf(certFileUnreadable, flagName, err)
+ }
+ if len(raw) > certFileMax {
+ return nil, fmt.Errorf(certFileTooLarge, flagName)
+ }
+ return raw, nil
+}
+
+// domainsCertImport reads the files, sends them, and prints the console's
+// summary of what it stored, then the check to run before moving DNS.
+func domainsCertImport(ctx context.Context, s *apiSession, acct apiAcct, app, host, certPath, keyPath string, allowWildcard bool) error {
+ cert, err := readCertFile(certPath, "--cert")
+ if err != nil {
+ return err
+ }
+ key, err := readCertFile(keyPath, "--key")
+ if err != nil {
+ return err
+ }
+ res, err := s.domainCertImport(ctx, acct, app, host, cert, key, allowWildcard)
+ if err != nil {
+ return fmt.Errorf(certImportFailed, err)
+ }
+ expires := res.NotAfter
+ if t, err := time.Parse(time.RFC3339, res.NotAfter); err == nil {
+ expires = t.UTC().Format(time.DateOnly)
+ }
+ fmt.Fprintf(stdout, certImported+"\n", res.Host, res.Issuer, expires, res.SHA256)
+ if res.Wildcard {
+ fmt.Fprintf(stdout, certImportedWildcard+"\n", res.Host)
+ }
+ mutedf(stdout, certCheckBeforeDNS, res.Host, res.Host)
+ return nil
+}
+
+// domainsCertRemove removes host's import and says whether there was one.
+func domainsCertRemove(ctx context.Context, s *apiSession, acct apiAcct, app, host string) error {
+ removed, err := s.domainCertRemove(ctx, acct, app, host)
+ if err != nil {
+ return fmt.Errorf(certRemoveFailed, err)
+ }
+ if removed {
+ fmt.Fprintf(stdout, certRemoved+"\n", host)
+ } else {
+ mutedf(stdout, certNotPresent, host)
+ }
+ return nil
+}
+
+// apiImportedCert is the console's summary of an imported certificate:
+// the import answer, and the per-host read's imported_cert.
+type apiImportedCert struct {
+ Host string `json:"host"`
+ SHA256 string `json:"sha256"`
+ Issuer string `json:"issuer"`
+ SANs int `json:"sans"`
+ NotAfter string `json:"not_after"`
+ Wildcard bool `json:"wildcard"`
+}
+
+func certAPIPath(a apiAcct, app, host string) string {
+ return apiPath(a, app, "/domains/"+url.PathEscape(host)+"/cert")
+}
+
+// domainCertImport is PUT .../domains/{host}/cert.
+func (s *apiSession) domainCertImport(ctx context.Context, a apiAcct, app, host string, cert, key []byte, allowWildcard bool) (apiImportedCert, error) {
+ status, body, err := s.putJSON(ctx, certAPIPath(a, app, host), map[string]any{
+ "cert": string(cert), "key": string(key), "allow_wildcard": allowWildcard,
+ })
+ if err != nil {
+ return apiImportedCert{}, err
+ }
+ if status != http.StatusOK {
+ return apiImportedCert{}, apiErrorFromBody(status, body)
+ }
+ var out apiImportedCert
+ if err := json.Unmarshal(body, &out); err != nil {
+ return apiImportedCert{}, fmt.Errorf(certUnreadable, err)
+ }
+ return out, nil
+}
+
+// domainCertRemove is DELETE .../domains/{host}/cert.
+func (s *apiSession) domainCertRemove(ctx context.Context, a apiAcct, app, host string) (bool, error) {
+ status, body, err := s.deleteJSON(ctx, certAPIPath(a, app, host))
+ if err != nil {
+ return false, err
+ }
+ if status != http.StatusOK {
+ return false, apiErrorFromBody(status, body)
+ }
+ var out struct {
+ Removed bool `json:"removed"`
+ }
+ if err := json.Unmarshal(body, &out); err != nil {
+ return false, fmt.Errorf(certUnreadable, err)
+ }
+ return out.Removed, nil
+}
diff --git a/domains_cert_cli_test.go b/domains_cert_cli_test.go
new file mode 100644
index 000000000..16d4a77ab
--- /dev/null
+++ b/domains_cert_cli_test.go
@@ -0,0 +1,163 @@
+package main
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+)
+
+// The file contents are markers, not PEM: the CLI sends what it read and
+// the console judges it. What matters here is that they reach the console
+// unchanged and never reach the terminal.
+const (
+ certFileMarker = "certificate text, cert-marker-1429\n"
+ keyFileMarker = "key text, key-marker-1429\n"
+)
+
+func writeCertFiles(t *testing.T) (certPath, keyPath string) {
+ t.Helper()
+ dir := t.TempDir()
+ certPath, keyPath = filepath.Join(dir, "fullchain.pem"), filepath.Join(dir, "key.pem")
+ if err := os.WriteFile(certPath, []byte(certFileMarker), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(keyPath, []byte(keyFileMarker), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ return certPath, keyPath
+}
+
+func TestDomainsCertImportSendsFilesAndPrintsSummary(t *testing.T) {
+ for _, wildcard := range []bool{false, true} {
+ t.Run(fmt.Sprint(wildcard), func(t *testing.T) {
+ mux := http.NewServeMux()
+ mux.HandleFunc("PUT /api/cli/apps/bab/kass/domains/tickets.example.com/cert", func(w http.ResponseWriter, r *http.Request) {
+ var in struct {
+ Cert string `json:"cert"`
+ Key string `json:"key"`
+ AllowWildcard bool `json:"allow_wildcard"`
+ }
+ if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
+ t.Errorf("body: %v", err)
+ }
+ if in.Cert != certFileMarker || in.Key != keyFileMarker || in.AllowWildcard != wildcard {
+ t.Errorf("console saw cert %q key %q allow_wildcard %v", in.Cert, in.Key, in.AllowWildcard)
+ }
+ json.NewEncoder(w).Encode(map[string]any{
+ "host": "tickets.example.com", "sha256": "ab12", "issuer": "R11", "sans": 2,
+ "not_after": "2027-02-01T12:00:00Z", "wildcard": wildcard,
+ })
+ })
+ ts := httptest.NewServer(mux)
+ defer ts.Close()
+ certPath, keyPath := writeCertFiles(t)
+ out := captureStdout(t)
+ if err := domainsCertImport(context.Background(), newTestSession(ts.URL), apiAcct{Seg: "bab"}, "kass",
+ "tickets.example.com", certPath, keyPath, wildcard); err != nil {
+ t.Fatal(err)
+ }
+ got := out.String()
+ for _, want := range []string{
+ "imported a certificate for tickets.example.com: issued by R11, expires 2027-02-01, sha256 ab12",
+ "curl -v --resolve tickets.example.com:443:<edge address> https://tickets.example.com/",
+ } {
+ if !strings.Contains(got, want) {
+ t.Fatalf("missing %q:\n%s", want, got)
+ }
+ }
+ if wildcard != strings.Contains(got, "through a wildcard") {
+ t.Fatalf("wildcard=%v output:\n%s", wildcard, got)
+ }
+ if strings.Contains(got, "marker-1429") {
+ t.Fatalf("output carries file contents:\n%s", got)
+ }
+ })
+ }
+}
+
+func TestDomainsCertImportRefusalIsTheError(t *testing.T) {
+ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusBadRequest)
+ fmt.Fprint(w, `{"error":"the key does not match the certificate"}`)
+ }))
+ defer ts.Close()
+ certPath, keyPath := writeCertFiles(t)
+ out := captureStdout(t)
+ err := domainsCertImport(context.Background(), newTestSession(ts.URL), apiAcct{Seg: "bab"}, "kass",
+ "tickets.example.com", certPath, keyPath, false)
+ if err == nil || !strings.Contains(err.Error(), "the key does not match the certificate") {
+ t.Fatalf("err = %v, want the console's sentence", err)
+ }
+ if strings.Contains(out.String()+err.Error(), "marker-1429") {
+ t.Fatal("file contents printed")
+ }
+}
+
+func TestDomainsCertImportLocalRefusals(t *testing.T) {
+ // Missing file flags are refused before any session is needed.
+ for _, args := range [][]string{
+ {"--app", "kass", "tickets.example.com"},
+ {"--app", "kass", "--cert", "c.pem", "tickets.example.com"},
+ {"--app", "kass", "--key", "k.pem", "tickets.example.com"},
+ } {
+ if err := runDomainsCertImport(args); err == nil || err.Error() != certFilesRequired {
+ t.Errorf("%v: err = %v, want %q", args, err, certFilesRequired)
+ }
+ }
+ if err := runDomainsCertImport([]string{"--app", "kass", "--cert", "c", "--key", "k"}); err == nil || err.Error() != domainsCertImportUsage {
+ t.Errorf("no hostname: err = %v, want the usage", err)
+ }
+
+ // A file over 64 KiB, or one that is missing, never reaches the console.
+ called := false
+ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { called = true }))
+ defer ts.Close()
+ certPath, keyPath := writeCertFiles(t)
+ big := filepath.Join(t.TempDir(), "big.pem")
+ if err := os.WriteFile(big, []byte(strings.Repeat("A", 65<<10)), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ sess := newTestSession(ts.URL)
+ if err := domainsCertImport(context.Background(), sess, apiAcct{Seg: "bab"}, "kass", "tickets.example.com", big, keyPath, false); err == nil ||
+ !strings.Contains(err.Error(), "larger than 64 KiB") {
+ t.Errorf("oversized cert: err = %v", err)
+ }
+ if err := domainsCertImport(context.Background(), sess, apiAcct{Seg: "bab"}, "kass", "tickets.example.com", certPath,
+ filepath.Join(t.TempDir(), "absent.pem"), false); err == nil || !errors.Is(err, os.ErrNotExist) {
+ t.Errorf("missing key file: err = %v, want not-exist", err)
+ }
+ if called {
+ t.Fatal("the console was called for a local refusal")
+ }
+}
+
+func TestDomainsCertRemovePrintsOutcome(t *testing.T) {
+ for _, removed := range []bool{true, false} {
+ t.Run(fmt.Sprint(removed), func(t *testing.T) {
+ mux := http.NewServeMux()
+ mux.HandleFunc("DELETE /api/cli/apps/bab/kass/domains/tickets.example.com/cert", func(w http.ResponseWriter, r *http.Request) {
+ json.NewEncoder(w).Encode(map[string]any{"host": "tickets.example.com", "removed": removed})
+ })
+ ts := httptest.NewServer(mux)
+ defer ts.Close()
+ out := captureStdout(t)
+ if err := domainsCertRemove(context.Background(), newTestSession(ts.URL), apiAcct{Seg: "bab"}, "kass", "tickets.example.com"); err != nil {
+ t.Fatal(err)
+ }
+ want := fmt.Sprintf(certNotPresent, "tickets.example.com")
+ if removed {
+ want = fmt.Sprintf(certRemoved, "tickets.example.com")
+ }
+ if !strings.Contains(out.String(), want) {
+ t.Fatalf("output %q, want %q", out.String(), want)
+ }
+ })
+ }
+}
diff --git a/domains_cert_copy.go b/domains_cert_copy.go
new file mode 100644
index 000000000..1ed151777
--- /dev/null
+++ b/domains_cert_copy.go
@@ -0,0 +1,66 @@
+package main
+
+// Every sentence `carlos domains cert` prints (domains_cert_cli.go, #1429),
+// in one place for review. None of them prints a byte of the certificate
+// or key files.
+
+const domainsCertUsage = `usage: carlos domains cert <import|remove> [flags] <hostname>
+
+ import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>
+ serve a certificate you already hold for an attached
+ hostname, so it works on every edge before its DNS points
+ here. --cert is the certificate followed by its
+ intermediates, --key its private key, both PEM.
+ --allow-wildcard accepts a certificate that covers the
+ hostname only through a wildcard. Platform operators only.
+ remove --app <a> [flags] <hostname>
+ stop serving the imported certificate.
+
+ --account <a> account (sqid or name; default "ops")
+ --account-id <id> account sqid, matched as a sqid ONLY
+ --console <origin> console to act through (default: the only logged-in one)
+`
+
+// domainsCertHelp is cert's paragraph in carlos domains's usage.
+const domainsCertHelp = ` cert <import|remove> --app <a> [flags] <hostname>
+ serve a certificate you already hold for an attached
+ hostname before its DNS points here, or stop serving it.
+ Platform operators only. See: carlos domains cert.
+`
+
+const domainsCertImportUsage = `usage: carlos domains cert import --app <a> --cert <file> --key <file> [--allow-wildcard] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>
+`
+
+const domainsCertRemoveUsage = `usage: carlos domains cert remove --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <hostname>
+`
+
+const (
+ certFlagApp = "app the hostname belongs to"
+ certFlagCert = "PEM file holding the certificate, then its intermediates"
+ certFlagKey = "PEM file holding the certificate's private key"
+ certFlagAllowWildcard = "accept a certificate that covers the hostname only through a wildcard"
+ certFlagConsole = "console to act through (default: the only logged-in one)"
+ certFlagAccount = "account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)"
+ certFlagAccountID = "account sqid, matched as a sqid ONLY. Supersedes --account"
+
+ // certFilesRequired is the refusal when either file flag is missing.
+ certFilesRequired = "domains cert import: --cert and --key are both required"
+ // certFileUnreadable is a local read failure: %s is the flag, %w the
+ // error, which names the path and never the contents.
+ certFileUnreadable = "domains cert import: could not read the %s file: %w"
+ // certFileTooLarge: %s is the flag.
+ certFileTooLarge = "domains cert import: the %s file is larger than 64 KiB, which is more than a certificate or key needs"
+ certImportFailed = "domains cert import: %w"
+ certRemoveFailed = "domains cert remove: %w"
+ certUnreadable = "unreadable response: %w"
+
+ // certImported: host, issuer, expiry date, sha256.
+ certImported = "imported a certificate for %s: issued by %s, expires %s, sha256 %s"
+ // certImportedWildcard follows certImported for a wildcard import.
+ certImportedWildcard = "It covers %s through a wildcard and is served for this hostname only."
+ // certCheckBeforeDNS is the reminder after every import: host twice.
+ certCheckBeforeDNS = "Before you move DNS, check that an edge other than the hub serves it:\n curl -v --resolve %s:443:<edge address> https://%s/ -o /dev/null"
+
+ certRemoved = "removed the imported certificate for %s"
+ certNotPresent = "%s had no imported certificate"
+)
diff --git a/domains_cli.go b/domains_cli.go
index 03679abd0..f15396590 100644
--- a/domains_cli.go
+++ b/domains_cli.go
@@ -59,7 +59,7 @@ const domainsUsage = `usage: carlos domains <check|buy|transfer|attach|verify|de
it, and a request is never sent to another region. give
the whole set every time. --wildcard and --catchall take
effect only when the domain is created.
-
+` + domainsCertHelp + `
--account <a> account (sqid or name; default "ops")
--account-id <id> account sqid, matched as a sqid ONLY
--console <origin> console to act through (default: the only logged-in one)
@@ -110,11 +110,12 @@ func domainsCommand() *clireg.Node {
domainsContactsCommand(),
raw("paths", cust, runDomainsPaths),
raw("placements", cust, runDomainsPlacements),
+ domainsCertCommand(),
},
Fallback: func(args, consumed []string) {
domainsExit(errors.New(domainsUsage))
},
- // The verbs that return their errors (point, contacts) end here.
+ // The verbs that return their errors (point, contacts, cert) end here.
OnError: func(path []string, err error) { domainsExit(err) },
}
}
diff --git a/parity/cli.tsv b/parity/cli.tsv
index 5fc20de88..ef7f0f3ed 100644
--- a/parity/cli.tsv
+++ b/parity/cli.tsv
@@ -67,6 +67,8 @@ devbox share customer - - - - -
devbox unshare customer - - - - -
domains attach customer - - - - -
domains buy customer - - - - -
+domains cert import operator - - - - -
+domains cert remove operator - - - - -
domains check customer - - - - -
domains contacts add customer - - - - -
domains contacts edit customer - - - - -
diff --git a/parity/parity.tsv b/parity/parity.tsv
index d7e504c9d..2671e1202 100644
--- a/parity/parity.tsv
+++ b/parity/parity.tsv
@@ -93,6 +93,7 @@ domains-transfer domains both domains transfer GET /a/{sqid}/domains/transfer/{d
domains-point domains both domains point POST /a/{sqid}/apps/{app}/domains/point
domains-paths domains gap domains paths wp-settings
domains-placements domains gap domains placements wp-settings
+domains-cert domains operator domains cert import ; domains cert remove Operator only: a platform operator imports a certificate and key they already hold for an attached hostname, so it is served before its DNS moves, and removes it.
gate domains both gate set ; gate clear ; gate list POST /a/{sqid}/apps/{app}/gate ; GET /a/{sqid}/apps/{app}/settings/{section}
ratelimit domains both ratelimit show ; ratelimit set ; ratelimit clear POST /a/{sqid}/apps/{app}/ratelimit ; GET /a/{sqid}/apps/{app}/settings/{section}
assets domains gap assets status ; assets purge wp-settings
diff --git a/testdata/clireg-golden.jsonl b/testdata/clireg-golden.jsonl
index 9631203c5..3b6d9b176 100644
--- a/testdata/clireg-golden.jsonl
+++ b/testdata/clireg-golden.jsonl
@@ -222,6 +222,16 @@
{"case":"domains attach | -h","argv":["domains","attach","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account\n --app, -a <string> app the hostname belongs to\n --catchall derive a *.<host> catch-all alias to the same route (needs --wildcard)\n --console <string> console to attach through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --platform attach a hostname in this deployment's own domains (platform operators only)\n --route <string> route hostname to attach to\n --wildcard enable a delegated wildcard cert for this hostname (needs a CNAME — see the 422 message if refused)\n"}
{"case":"domains buy | --zz-unknown-flag","argv":["domains","buy","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [--account <a>] [--account-id <id>] [--console <origin>]\n carlos domains buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [--account <a>] [--account-id <id>] [--console <origin>]\nbuy needs --app or --not-yet. either accepts --contact <id> in place of --contact-file\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --app <string> app the domain will serve\n --console <string> console to use (default: the only logged-in one)\n --contact <string> saved contact to use when registering the domain; list contacts with carlos domains contacts\n --contact-file <string> JSON file containing your contact details\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --no-wait print the checkout link and return without waiting\n --not-yet buy the domain without pointing it at an app yet\n --yes confirm the purchase without prompting\n"}
{"case":"domains buy | -h","argv":["domains","buy","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [--account <a>] [--account-id <id>] [--console <origin>]\n carlos domains buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [--account <a>] [--account-id <id>] [--console <origin>]\nbuy needs --app or --not-yet. either accepts --contact <id> in place of --contact-file\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --app <string> app the domain will serve\n --console <string> console to use (default: the only logged-in one)\n --contact <string> saved contact to use when registering the domain; list contacts with carlos domains contacts\n --contact-file <string> JSON file containing your contact details\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --no-wait print the checkout link and return without waiting\n --not-yet buy the domain without pointing it at an app yet\n --yes confirm the purchase without prompting\n"}
+{"case":"domains cert import | --zz-unknown-flag","argv":["domains","cert","import","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains cert import --app <a> --cert <file> --key <file> [--allow-wildcard] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY. Supersedes --account\n --allow-wildcard accept a certificate that covers the hostname only through a wildcard\n --app, -a <string> app the hostname belongs to\n --cert <string> PEM file holding the certificate, then its intermediates\n --console <string> console to act through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --key <string> PEM file holding the certificate's private key\nflag provided but not defined: -zz-unknown-flag\n"}
+{"case":"domains cert import | -h","argv":["domains","cert","import","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains cert import --app <a> --cert <file> --key <file> [--allow-wildcard] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY. Supersedes --account\n --allow-wildcard accept a certificate that covers the hostname only through a wildcard\n --app, -a <string> app the hostname belongs to\n --cert <string> PEM file holding the certificate, then its intermediates\n --console <string> console to act through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --key <string> PEM file holding the certificate's private key\n"}
+{"case":"domains cert remove | --zz-unknown-flag","argv":["domains","cert","remove","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains cert remove --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY. Supersedes --account\n --app, -a <string> app the hostname belongs to\n --console <string> console to act through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\nflag provided but not defined: -zz-unknown-flag\n"}
+{"case":"domains cert remove | -h","argv":["domains","cert","remove","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains cert remove --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY. Supersedes --account\n --app, -a <string> app the hostname belongs to\n --console <string> console to act through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"}
+{"case":"domains cert | --help","argv":["domains","cert","--help"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
+{"case":"domains cert | --zz-unknown-flag","argv":["domains","cert","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
+{"case":"domains cert | -h","argv":["domains","cert","-h"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
+{"case":"domains cert | bare","argv":["domains","cert"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
+{"case":"domains cert | help","argv":["domains","cert","help"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
+{"case":"domains cert | zz-unknown","argv":["domains","cert","zz-unknown"],"exit":1,"stdout":"","stderr":"usage: carlos domains cert <import|remove> [flags] <hostname>\n\n import --app <a> --cert <file> --key <file> [--allow-wildcard] [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname, so it works on every edge before its DNS points\n here. --cert is the certificate followed by its\n intermediates, --key its private key, both PEM.\n --allow-wildcard accepts a certificate that covers the\n hostname only through a wildcard. Platform operators only.\n remove --app <a> [flags] <hostname>\n stop serving the imported certificate.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n"}
{"case":"domains check | --zz-unknown-flag","argv":["domains","check","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains check <name> [--country <cc>] [--account <a>] [--account-id <id>] [--console <origin>]\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --console <string> console to use (default: the only logged-in one)\n --country <string> country for the price check when no billing currency is set (two letters)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"}
{"case":"domains check | -h","argv":["domains","check","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains check <name> [--country <cc>] [--account <a>] [--account-id <id>] [--console <origin>]\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --console <string> console to use (default: the only logged-in one)\n --country <string> country for the price check when no billing currency is set (two letters)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"}
{"case":"domains contacts add | --zz-unknown-flag","argv":["domains","contacts","add","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [--account <a>] [--account-id <id>] [--console <origin>]\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --console <string> console to use (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --file <string> JSON file containing your contact details\nflag provided but not defined: -zz-unknown-flag\n"}
@@ -252,12 +262,12 @@
{"case":"domains transfer | -h","argv":["domains","transfer","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [--account <a>] [--account-id <id>] [--console <origin>]\nflags:\n --account <string> account (sqid or name)\n --account-id <string> account sqid, matched as a sqid only\n --auth-code <string> the transfer code from the current registrar, or - to read it from stdin\n --console <string> console to use (default: the only logged-in one)\n --contact <string> saved contact to use when registering the domain; list contacts with carlos domains contacts\n --contact-file <string> JSON file containing your contact details\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --no-wait print the checkout link and return without waiting\n --yes confirm the transfer without prompting\n"}
{"case":"domains verify | --zz-unknown-flag","argv":["domains","verify","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos domains verify --app <a> [--channel <c>] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account\n --app, -a <string> app the hostname belongs to\n --channel <string> channel a first-route hostname serves (only needed when the app follows several)\n --console <string> console to verify through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"}
{"case":"domains verify | -h","argv":["domains","verify","-h"],"exit":0,"stdout":"","stderr":"usage: carlos domains verify --app <a> [--channel <c>] [--account <a>] [--account-id <id>] [--console <origin>] <hostname>\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account\n --app, -a <string> app the hostname belongs to\n --channel <string> channel a first-route hostname serves (only needed when the app follows several)\n --console <string> console to verify through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"}
-{"case":"domains | --help","argv":["domains","--help"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
-{"case":"domains | --zz-unknown-flag","argv":["domains","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
-{"case":"domains | -h","argv":["domains","-h"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
-{"case":"domains | bare","argv":["domains"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
-{"case":"domains | help","argv":["domains","help"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
-{"case":"domains | zz-unknown","argv":["domains","zz-unknown"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | --help","argv":["domains","--help"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | --zz-unknown-flag","argv":["domains","--zz-unknown-flag"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | -h","argv":["domains","-h"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | bare","argv":["domains"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | help","argv":["domains","help"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
+{"case":"domains | zz-unknown","argv":["domains","zz-unknown"],"exit":1,"stdout":"","stderr":"usage: carlos domains <check|buy|transfer|attach|verify|detach|list|point|contacts|paths|placements> [flags]\n\n check <name> [--country <cc>] [flags]\n check availability and the price for one year\n buy <name> --app <a> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy <name> --not-yet [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n buy a domain and wait for it to serve the app. with\n --not-yet, buy a domain without pointing it at an app yet.\n buy needs one of --app or --not-yet. --contact <id>\n registers it to that saved contact; with neither contact\n flag, buy uses the one used last\n\n transfer <name> --auth-code <code|-> [--contact <id> | --contact-file contact.json] [--yes] [--no-wait] [flags]\n move a domain registered elsewhere here. it keeps the\n nameservers it uses today, so its DNS and email do not\n change. --auth-code - reads the transfer code from stdin.\n waits until the move is done or fails. it can take up to\n five days, or longer if the registrar does not answer.\n owners only\n attach --app <a> [--route <r>] [--wildcard] [--catchall] [--platform] [flags] <hostname>\n claim a customer's hostname for the app, pointed at\n --route (default: the app's single instance record, if it\n has exactly one — otherwise --route is required).\n --wildcard/--catchall are capability flips: naming either\n one changes it, an unset flag leaves it as it was.\n --platform attaches a hostname in this deployment's own\n domains. Platform operators only.\n Where the deployment requires proof of control, the\n hostname is not served until you add the TXT record\n attach prints.\n attach --app <a> '*.<parent>'\n an instance catch-all: each of the app's instances also\n answers at <label>.<parent>, where <label> is its host's\n first label. <parent> must already be attached to an app\n in this account. Signed-in people only; takes no other\n flag. Detach it with: detach --app <a> '*.<parent>'.\n verify --app <a> [--channel <c>] [flags] <hostname>\n check the TXT record and, once it is there, make the\n hostname live. --channel is for a hostname that will be\n the app's first route, when the app follows several.\n detach --app <a> [flags] <hostname>\n release a hostname claim\n list [--app <a> | --all] [flags]\n an app's hostname claims, joined to the fleet's own\n readings sweep (DNS/CERT-EXPIRES/WILDCARD/CATCHALL/DELEGATION).\n without --app, the configured app or the account's only\n app. with --all, or when no app is found, every domain\n the account uses: bought here, being bought, or\n registered elsewhere, each with its addresses\n point <domain> --app <a> [flags]\n point a domain bought here at an app. its domain and its\n www serve the app. owners only\n contacts [list | add --file contact.json | edit <id> --file contact.json | remove <id>] [flags]\n the contacts saved for registering domains. owners only\n paths --app <a> [flags] <hostname>\n the leading path segments this hostname's traffic is split\n by, as PUBLISHED. Read-only: the platform that owns the\n hostname republishes the whole map, so there is no verb\n here that writes one.\n placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname>\n without --set, shows which instance serves the hostname in\n each region, whether it is ready, and the addresses to\n point DNS at. with --set, makes the hostname a regional\n domain. each region serves it from the instance named for\n it, and a request is never sent to another region. give\n the whole set every time. --wildcard and --catchall take\n effect only when the domain is created.\n cert <import|remove> --app <a> [flags] <hostname>\n serve a certificate you already hold for an attached\n hostname before its DNS points here, or stop serving it.\n Platform operators only. See: carlos domains cert.\n\n --account <a> account (sqid or name; default \"ops\")\n --account-id <id> account sqid, matched as a sqid ONLY\n --console <origin> console to act through (default: the only logged-in one)\n\nSigned-in only (carlos auth login): a claim is a console-authorized write —\nthe console checks the hostname against the deploy's deny list, resolves the\nroute, and writes it. The hostname comes live on the box that owns the route\nat its next domains pass.\n"}
{"case":"economics backhaul | --zz-unknown-flag","argv":["economics","backhaul","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos economics backhaul [--period mtd|last|7d] [--console <origin>]\n\nShows what serving through region edges costs the platform this period:\nthe part of every account's egress that was backhauled from its home box\n(usage.EdgeRow's hop subset — inside the egress totals, never on top),\npriced at the rate card's inter-region $/GB (the extra leg; the home box's\nbytes are already egress) and ABSORBED — it is in nobody's bill (#284).\nOperator only; a non-operator's token gets the same bare 404 an unknown\nroute gets.\nflags:\n --console <string> console to ask (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --period <string> mtd (default), last, or 7d\n"}
{"case":"economics backhaul | -h","argv":["economics","backhaul","-h"],"exit":0,"stdout":"","stderr":"usage: carlos economics backhaul [--period mtd|last|7d] [--console <origin>]\n\nShows what serving through region edges costs the platform this period:\nthe part of every account's egress that was backhauled from its home box\n(usage.EdgeRow's hop subset — inside the egress totals, never on top),\npriced at the rate card's inter-region $/GB (the extra leg; the home box's\nbytes are already egress) and ABSORBED — it is in nobody's bill (#284).\nOperator only; a non-operator's token gets the same bare 404 an unknown\nroute gets.\nflags:\n --console <string> console to ask (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --period <string> mtd (default), last, or 7d\n"}
{"case":"economics bill | --zz-unknown-flag","argv":["economics","bill","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos economics bill --month <YYYY-MM> --total <usd> [--line Service=usd ...] [--basis account|whole] [--console <origin>]\n carlos economics backhaul [--period mtd|last|7d] [--console <origin>]\n\nRecords one month's AWS bill for the economics dashboard. Operator only: the\nconsole answers a non-operator's token with the same bare 404 it gives an\nunknown route (it must not be probeable), so \"not found\" here almost always\nmeans your account lacks the fleet-operator bit.\n\nA manual entry always overwrites whatever the console already holds for that\nmonth — a previous Cost Explorer pull or an earlier manual entry alike.\nflags:\n --basis <string> what the total covers: account (the whole account, which runs only CARLOS) or whole (the whole account, CARLOS and other things)\n --console <string> console to record through (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --line <value> one line item, repeatable: Service=usd\n --month <string> billing month, YYYY-MM (required)\n --total <float> invoice total in US dollars (required)\n"}