You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 47f0856
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cli): `os deploy` — one command from a local checkout to your ObjectOS Cloud environment; installs pick the organization's only environment, keep it across `os cloud login`, and refuse before any write when none resolves
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
**`os deploy`** (new). With no flags it builds the app (the same compile `os build` runs), publishes it as `<manifest.version>-dev.<YYYYMMDDHHMMSS>` (a UTC semver pre-release, so deploying again never needs a version bump and never collides with an existing version), installs exactly that version into your organization's environment, and waits until the environment serves it (it reads the control plane's served-version report for the package and, since an environment rebuilds only when it gets a request, sends the environment one on every poll). A failed local build prints its errors and exits 1 having published nothing; a build the environment reports as failed prints the environment's reason and exits 1. Flags only for the uncommon case: `--env <id>` when your account reaches several environments, `--no-wait`, `--wait-timeout <seconds>` (default 600: a failing build is reported only after three failed rounds in a row). Against a control plane that does not yet report which version an environment serves, the command says so and does not claim the version is live.
12
+
13
+
**`os package publish --install`** keeps its meaning (a release version, the manifest's own), and now resolves its environment like `os deploy`: `--env` / `$OS_ENVIRONMENT_ID`, then the environment `os environments switch` recorded for this control plane, then the organization's only environment, asked of the control plane and printed. With none, several, or an unreadable list it exits 1 **before registering the package or publishing anything**, naming how to pass one. It used to print "Skipping auto-install", publish anyway and exit 0.
14
+
15
+
**`os cloud login`** no longer drops the active environment: re-logging in to the same control plane as the same account keeps `activeEnvironmentId` in `~/.objectstack/cloud.json`. A different control plane or a different account still starts without one.
16
+
17
+
**`os dev`** offers the deploy on a key once the local server is up: press `d` to run `os deploy` in the same terminal; when not logged in to ObjectOS Cloud, the same key logs in first. There is no deploy on save. **`os build`** ends with the next step (`os deploy`), and bare `os` lists the everyday commands first. New projects from `create-objectstack` (and `os init`'s app template) ship `npm run deploy`.
Copy file name to clipboardExpand all lines: content/docs/deployment/cli.mdx
+65-3Lines changed: 65 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,6 +166,11 @@ Starts development mode. Three usage shapes:
166
166
2.**With a pre-built artifact** (`--artifact <path|url>`) — skips auto-compile and boots the artifact directly. No `objectstack.config.ts` needed in cwd. Useful for *trying out a published app in dev mode without cloning its source.*
167
167
3.**Monorepo root** (cwd has `pnpm-workspace.yaml`) — orchestrates `pnpm -r dev` across packages.
168
168
169
+
Once the local server is up, `os dev` in an interactive terminal offers
170
+
**`d` to deploy**: it runs [`os deploy`](#os-deploy) in the same terminal, and
171
+
when you are not logged in to ObjectOS Cloud the same key runs `os cloud login`
172
+
first. Saving a file never deploys.
173
+
169
174
```bash
170
175
os dev # Auto-compile cwd config, then start
171
176
os dev my-package # Workspace package (monorepo orchestration mode)
@@ -3063,7 +3068,9 @@ os cloud login --email me@acme.com --password secret # CI
3063
3068
Like `os login`, in an interactive terminal it uses the browser-based device
3064
3069
flow: it prints a one-time verification URL and polls until you approve. If
3065
3070
cloud credentials already exist it exits successfully with "Already logged in";
3066
-
pass `--force` to re-authenticate.
3071
+
pass `--force` to re-authenticate. Re-authenticating to the same control plane
3072
+
as the same account keeps the active environment recorded in `cloud.json`; a
3073
+
different control plane or account starts without one.
3067
3074
3068
3075
##### `os cloud login --json` is NDJSON — the same exception as `os login`
| `--visibility <level>` | — | `org` (installable across your organization) · `private` (explicit grants only) · `marketplace` (public after review). Omitted: not sent, so the control plane decides — an existing package keeps its visibility, a new one gets the control plane's default (`org` on ObjectOS Cloud) |
3207
3269
|`--org <id>`|`OS_ORG_ID`|`owner_org_id`. Requiredwith a bearer key in service mode; ignored in user mode |
3208
-
| `--env <id>` | `OS_ENVIRONMENT_ID` | Environment to install the new version into. Defaults to the environment [`os environments switch`](#cloud-environments) — or `os environments create --activate` — recorded **for this control plane** in `~/.objectstack/cloud.json` |
3209
-
| `--install` | — | Auto-install into `--env` after publishing. With no `--env`, no `$OS_ENVIRONMENT_ID` and no active environment for this control plane, it reports that and publishes without installing |
3270
+
|`--env <id>`|`OS_ENVIRONMENT_ID`| Environment to install the newversioninto. Defaults to the environment [`os environments switch`](#cloud-environments) — or `os environments create --activate` — recorded **forthis control plane**in`~/.objectstack/cloud.json`, then to your organization's only environment |
3271
+
| `--install` | — | Install the new version after publishing, into `--env` or the environment it defaults to. With no environment to name — none, several, or a list the control plane would not give — it exits `1` **before publishing anything**, naming how to pass one |
3210
3272
| `--seed-sample-data` | — | Include sample data in that auto-install |
3211
3273
| `--pre-release` | — | Mark the version as a pre-release (also inferred — see below) |
3212
3274
| `--submit` | — | Submit the new version for marketplace review. Needs the package's visibility to be `marketplace` (already stored, or set with`--visibility marketplace`) and a complete listing |
0 commit comments