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
Copy file name to clipboardExpand all lines: content/docs/deployment/cli.mdx
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,14 +138,29 @@ os dev --database file:./data/test.db --auth-secret $(openssl rand -hex 32)
138
138
|`-p, --port <n>`|`OS_PORT` / `PORT`| Listen port (default `3000`). In dev a busy port auto-hops to the next free one; the banner shows the actual port. |
139
139
|`--ui`| — | Force Console UI on (already on by default in dev) |
140
140
|`--compile`| — | Force compiling `objectstack.config.ts` → `dist/objectstack.json` before starting (auto when the artifact is missing; ignored with `--artifact`) |
141
-
|`--fresh`| — | Ephemeral `OS_HOME` in the OS tempdir (clean DB, uploads, storage), auto-deleted on exit; implies `--seed-admin`|
141
+
|`--fresh`| — | Ephemeral `OS_HOME` in the OS tempdir (clean DB, uploads root, and other `OS_HOME`-keyed state), auto-deleted on exit; implies `--seed-admin`. See the scope note below|
142
142
|`--seed-admin` / `--no-seed-admin`| — | Seed a dev admin (`admin@objectos.ai` / `admin123`) on an empty DB — default on; override with `--admin-email` / `--admin-password`|
143
143
|`-v, --verbose`| — | Verbose output |
144
144
145
145
By default `os dev` keeps your data between restarts in a project-local SQLite
146
146
file at `.objectstack/data/dev.db` (created on first run). Pass `--database`,
147
147
set `OS_DATABASE_URL`, or use `--fresh` for a throwaway run.
148
148
149
+
<Callouttype="info"title="What `--fresh` covers">
150
+
`--fresh` isolates the state **the CLI places for the run**: everything keyed
151
+
off the ephemeral `OS_HOME` (the dev SQLite DB, the uploads root, plugin state
152
+
under `OS_HOME`) plus the env channels `os dev` publishes for it —
153
+
`OS_DATABASE_URL` and `OS_STORAGE_LOCAL_ROOT`. That tempdir is deleted on exit.
154
+
155
+
It does **not** relocate state your app reaches by a **relative path it
156
+
declares itself** — for example a datasource with
157
+
`config: { filename: '.objectstack/data/my.db' }`. Such a path is resolved by
158
+
its own consumer against the process working directory, which `--fresh` does
159
+
not change, so the file is written into your project tree and is still there
160
+
after the run ends. Declare an absolute path (or one derived from `OS_HOME`)
161
+
when you want a datasource to follow `--fresh`.
162
+
</Callout>
163
+
149
164
With a file-backed SQLite database, dev also provisions a sibling
150
165
`<db>.telemetry.<ext>` file registered as the `telemetry` datasource —
151
166
lifecycle-classed system data (activity streams, job runs, notifications,
// `--fresh` creates an isolated tempdir for OS_HOME / DB / uploads
101
-
// so every run starts from a clean slate. Combine with `--seed-admin`
100
+
// `--fresh` creates an isolated tempdir for OS_HOME / DB / uploads, so
101
+
// every run starts from a clean slate for the OS_HOME-keyed state the
102
+
// CLI itself places (see the block in `run()` for the exact covered
103
+
// surface, and for what an app-declared relative path escapes — #5594).
104
+
// Combine with `--seed-admin`
102
105
// (default-on when --fresh) to also provision a logged-in admin
103
106
// account, so backend debugging never blocks on first-run wizards.
104
107
// The seeded admin uses FIXED, well-known credentials by default
105
108
// (admin@objectos.ai / admin123) so tooling never has to guess them —
106
109
// override with --admin-email / --admin-password when needed.
107
110
fresh: Flags.boolean({
108
-
description: 'Start with an ephemeral OS_HOME under the OS tempdir (clean DB, uploads, storage); auto-deletes on exit. Implies --seed-admin (admin@objectos.ai / admin123) unless --no-seed-admin is given.',
111
+
description: 'Start with an ephemeral OS_HOME under the OS tempdir — clean DB, uploads root and other OS_HOME-keyed state for this run, auto-deleted on exit. State an app reaches by its own cwd-relative path (e.g. a datasource `filename: .objectstack/...`) is NOT covered and survives exit. Implies --seed-admin (admin@objectos.ai / admin123) unless --no-seed-admin is given.',
109
112
default: false,
110
113
}),
111
114
'seed-admin': Flags.boolean({
@@ -180,10 +183,29 @@ export default class Dev extends Command {
0 commit comments