oclif plugin for Object UI — Build applications from JSON schemas.
Previously published as
@object-ui/cli. See MIGRATION.md for upgrade details.
npm install -g @objectstack/cli @objectstack/plugin-ui
# Commands are auto-discovered under `os ui`
os ui dev
os ui build --helpnpm install -g @objectstack/plugin-ui
# Legacy bin still works
objectui dev app.jsonCreate a new Object UI application with a sample schema.
objectui init my-app
objectui init my-app --template form
objectui init . --template dashboardOptions:
-t, --template <template>- Template to use:simple,form, ordashboard(default:dashboard)
Templates:
- simple: A minimal getting started template
- form: A contact form with validation
- dashboard: A full dashboard with metrics and charts
Start a development server with hot reload. Opens browser automatically.
objectui dev app.json
objectui dev my-schema.json --port 8080
objectui dev --no-openArguments:
[schema]- Path to JSON/YAML schema file (default:app.json)
Options:
-p, --port <port>- Port to run the server on (default:3000)-h, --host <host>- Host to bind the server to (default:localhost)--no-open- Do not open browser automatically
Build your application for production deployment.
objectui build app.json
objectui build --out-dir build
objectui build --cleanArguments:
[schema]- Path to JSON/YAML schema file (default:app.json)
Options:
-o, --out-dir <dir>- Output directory (default:dist)--clean- Clean output directory before build
Serve the production build locally.
objectui start
objectui start --port 8080
objectui start --dir buildOptions:
-p, --port <port>- Port to run the server on (default:3000)-h, --host <host>- Host to bind the server to (default:0.0.0.0)-d, --dir <dir>- Directory to serve (default:dist)
Start a development server (legacy command, use dev instead).
objectui serve app.json
objectui serve my-schema.json --port 8080Arguments:
[schema]- Path to JSON schema file (default:app.json)
Options:
-p, --port <port>- Port to run the server on (default:3000)-h, --host <host>- Host to bind the server to (default:localhost)
Lint the generated application code using ESLint.
objectui lint
objectui lint --fixOptions:
--fix- Automatically fix linting issues
Note: Run objectui dev first to generate the application before linting.
Run tests for the application using Vitest.
objectui test
objectui test --watch
objectui test --coverage
objectui test --uiOptions:
-w, --watch- Run tests in watch mode-c, --coverage- Generate test coverage report--ui- Run tests with Vitest UI
Note: Run objectui dev first to generate the application before testing.
-
Create a new application:
objectui init my-dashboard --template dashboard cd my-dashboard -
Start the development server:
objectui dev app.json
-
Lint your code (optional):
objectui lint
-
Run tests (optional):
objectui test -
Build for production:
objectui build app.json
-
Serve the production build:
objectui start
Your app will be running at http://localhost:3000!
{
"type": "div",
"className": "min-h-screen flex items-center justify-center",
"body": {
"type": "card",
"title": "Hello World",
"body": {
"type": "text",
"content": "Welcome to Object UI!"
}
}
}MIT