CLI

DartStream CLI 0.0.12 provides the dartstream executable for the open-source framework, including local configuration, CI setup, code generation and extension discovery. The managed DartStream application has separate account, tenant and provider requirements.

Install and Inspect Commands

dart pub global activate ds_dartstream 0.0.12
dartstream --version
dartstream --help
dartstream init --help
dartstream configure --help
dartstream setup --help
dartstream generate --help
dartstream discover --help
dartstream validate --help

Use the help output for the installed version. Run scaffold commands in a new directory and preserve existing project files. Do not put credentials in source control, chat, screenshots or shared command history.

Login and Project Validation

dartstream login --client-id <id> --token <secret>
dartstream validate --project "<project name, id or slug>"

Use a machine credential from the selected DartStream project. Login saves credentials in ~/.dartstream/credentials.json, with mode 600 on Unix and a restricted user ACL on Windows. Keep that file private. In CI, use protected secret variables DARTSTREAM_CLIENT_ID and DARTSTREAM_CLIENT_SECRET; validate exchanges them without requiring an interactive login. Production is the default; no --env flag or DARTSTREAM_ENV variable is needed. Use a production credential. Do not mix credentials between environments.

Version 0.0.12 accepts the exact project name, project id or project slug returned by the workspace API. Validation checks access to that workspace project; it does not create a project or provision a provider.

Create and Configure a Local Project

Run these commands in a new directory:

dartstream init --name dartstream_demo
dart pub get
dartstream configure --vendor local --cicd gitlab
dartstream setup

init creates starter source, a smoke test, a package manifest and dartstream.yaml. configure updates only options supplied on the command line, preserving other configuration and comments. setup creates local validation CI for the selected provider: .gitlab-ci.yml for GitLab, or .github/workflows/dartstream-validation.yml when --cicd github is selected. The generated CI resolves dependencies, analyzes Dart source and runs tests. Existing CI files are retained; review and integrate the generated configuration through your normal repository process.

For a local Shelf middleware adapter:

dart pub add shelf
dartstream setup --middleware

This creates lib/src/middleware/dartstream_middleware.dart. Supply your application’s actual authentication and authorization handlers; generating the adapter does not enable an access policy.

Generate Code and Discover Extensions

dartstream generate --type model --name User
dartstream generate --type extension --name Payment
cd packages/ds_payment_extension
dart pub get
cd ../..
dartstream discover
dartstream discover --register
dart analyze --fatal-infos
dart test

The model command writes lib/src/models/user.dart. The extension command creates a private package at packages/ds_payment_extension; resolve its dependencies with dart pub get in that directory before using it. discover reads local extension manifests without executing extension code or changing the registry. discover --register merges their metadata while preserving disabled states and customer metadata. Register and authorize runtime behavior in your application.

generate also supports local API routing, provider adapters, CRUD scaffolds and OpenAPI clients. Use generate --help for the required arguments; API routing requires direct shelf and shelf_router dependencies, while client generation requires an OpenAPI JSON file. Supply actual handlers for storage and business operations. Existing files and linked output paths are preserved or refused.

These commands create local files. They do not create cloud resources, configure a managed deployment or connect a production database. SaaS setup, advanced feature/tool setup and custom CI providers remain unsupported.

Managed Runtime Access

An installed CLI does not establish a managed-runtime credential or deployment. Verify the account, tenant, project, environment and command result before using a managed integration. A failed command is an error to investigate; it does not prove the requested configuration was applied.

See the released package documentation for the framework boundary and customer support for account access.