@malloydata/malloyyo 0.2.30 → 0.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -74,6 +74,21 @@ malloyyo publish main --dry-run # show what would be sent
74
74
  malloyyo status main # what's live: version, commit, compile state
75
75
  ```
76
76
 
77
+ The target dataset must already exist; publishing to a missing one fails rather than
78
+ inventing it (a config typo would otherwise spawn junk datasets). To provision it from the
79
+ CLI instead of the UI, opt in explicitly:
80
+
81
+ ```bash
82
+ malloyyo publish main --create-dataset # create the dataset if it isn't there yet
83
+ ```
84
+
85
+ The dataset is created **only after the model compiles**, so a rejected publish still
86
+ creates nothing, and it is created **private** — visibility is a deliberate act in the UI,
87
+ and publishing never changes it. On an existing dataset the flag does nothing: you just get
88
+ the next version. The dataset name comes from the target's `dataset` in the config, and must
89
+ already be a valid name (lowercase letters, digits, underscores) — the CLI won't silently
90
+ create it under a slugified variant that later publishes wouldn't find.
91
+
77
92
  `publish` exits non-zero on a server-side compile failure, so it's safe to gate CI on.
78
93
 
79
94
  **Token precedence:** `--token` flag → the `malloyyo_token` env var from config (for CI) →
@@ -81,3 +96,63 @@ your `malloyyo login` session. So interactively you just `login` once; in CI you
81
96
  var and never touch the browser.
82
97
 
83
98
  See `docs/model-publishing-design.md` in the repo for the full design.
99
+
100
+ ## Malloyyo-hosted instances (`malloyyo cloud`)
101
+
102
+ For instances Malloyyo runs for you. Everything above works the same on one — a hosted
103
+ instance is a URL you `login` to and `publish` at — and these commands are how you get one
104
+ and configure it.
105
+
106
+ ```bash
107
+ malloyyo cloud instance create acme # provision acme.malloyyo.com, wait for it to come up
108
+ malloyyo cloud instance list
109
+ malloyyo cloud instance status acme
110
+ malloyyo cloud instance delete acme # reversible until it is destroyed
111
+ ```
112
+
113
+ Name the instance the way you already know it — `acme`, the name in its URL and the one you
114
+ `malloyyo login` to. Its ID works too, and is the one to use for an instance that has been
115
+ fully destroyed, since its name is free for someone else to take.
116
+
117
+ `create` prints each provisioning step as it finishes and ends with the URL to sign in at,
118
+ which is the same URL you then `malloyyo login`. It provisions real infrastructure, so it
119
+ takes minutes; if the command stops waiting, the work continues and `instance status` picks
120
+ it up. Every command takes `--json` for a parseable answer instead of progress lines.
121
+
122
+ ### Warehouse secrets
123
+
124
+ The credentials your Malloy models resolve connections from — the values behind
125
+ `{ "env": "NAME" }` in `malloy-config.json`. Several in one command are applied together, and
126
+ the command returns once they are live (your instance restarts briefly).
127
+
128
+ ```bash
129
+ malloyyo cloud secrets set acme PG_HOST=db.example.com PG_USER=app PG_PASSWORD
130
+ op read op://vault/pg/password | malloyyo cloud secrets set acme --stdin
131
+ ```
132
+
133
+ A value typed as `NAME=value` lands in your shell history and is visible in `ps` while the
134
+ command runs, so there are two ways not to type one: a **bare `NAME`** is prompted for with
135
+ the input hidden, and **`--stdin`** reads `NAME=value` lines from a file, a CI variable, or a
136
+ password manager. `NAME=value` stays for the parts that are not secrets — a host, a port, a
137
+ user. Values are write-only: nothing in this CLI, and no endpoint behind it, reads one back.
138
+
139
+ ### Credentials
140
+
141
+ `malloyyo cloud` authenticates with a machine credential Malloyyo issues when your account is
142
+ created, read from the environment:
143
+
144
+ ```bash
145
+ export MALLOYYO_CLIENT_ID=...
146
+ export MALLOYYO_CLIENT_SECRET=...
147
+ ```
148
+
149
+ That is the whole of it — there is nothing else to configure.
150
+
151
+ It is separate from `malloyyo login`, which authenticates *you* to one instance. This one
152
+ identifies your account to Malloyyo, and each command trades it for a short-lived access
153
+ token carrying only the permissions that command needs: a `list` cannot create, and only
154
+ `secrets set` can write secrets. The trade happens against Malloyyo's own API, so the CLI
155
+ talks to nothing else. Your secret is held in memory for that request and is never logged,
156
+ printed, or written to disk.
157
+
158
+ `MALLOYYO_API_URL` overrides the built-in API address; you should not need to set it.