remix_cli
See pinned GitHub registries for namespaces, revision updates, migration, and independent registry releases.
remix_cli installs editable component source into a Flutter application.
Choose a preset offered by your pinned registry. The official catalog serves
vanilla, fortal, and the HeroUI-inspired heroui. Remix remains the
behavior dependency; the application owns its tokens, theme values, component
recipes, and generated adapters.
The Vanilla and Fortal catalogs include an opt-in icons seam and cover the
core Remix component surface: accordion, app_bar, avatar, badge, button, callout, card,
checkbox, data_list, data_table, dialog, disclosure, divider,
icon_button, link, menu, popover, progress, radio,
segmented_control, select, sidebar, sidebar_layout, skeleton,
slider, spinner, switch, tabs, text_field, toast, toggle,
toggle_group, and tooltip, each with a theme dependency. Vanilla also
ships combobox, with theme and text_field dependencies;
breadcrumbs, a hand-written trail of link recipes with no generated
adapter; search_field, a hand-written stateful field over text_field
and icon_button with a built-in clear button; heading, text, and
code from shadcn/ui's Typography examples; and kbd, a key cap with a
<Prefix>KbdGroup for shortcuts.
The Fortal
preset also includes base_button, code, heading, kbd, text,
typography, avatar_group, a spaced row of avatars, breadcrumbs,
a one-line trail of links, search_field, a text_field with a search
glyph and clear button, and surface, a card at four levels of emphasis.
Vanilla also provides range_slider, which installs
slider and generates a two-bound <Prefix>RangeSlider. The data_table item
uses checkbox, icon_button, and select for its controls; toast uses button and icon_button for its
action and close control. The default sidebar item uses the application's
toggle recipe for destinations. sidebar_layout is a plain shell layout
with no Spec or generated adapter: it composes an installed sidebar into
a row above its compact breakpoint and a start-edge sheet below it.
The grouped dashboard_shell recipe builds on those pieces with host-owned
navigation, page content, optional search, and brand/account/action slots. It
has no generated adapter and does not install charts, tables, Agent surfaces,
or an application entry point.
The catalog also offers chart as an optional extension over
mix_chart; it does not depend on remix_fortal. Registry content is published independently on GitHub and pinned in remix.yaml.
Registry updates change pins only; installed source remains application-owned.
Commit remix.ownership.json with the configuration and installed source.
Target ownership is checked across separate installs; overlapping registries
are rejected even with --overwrite. Existing installations without ownership
records require verified, explicit add theme button --adopt migration; see
legacy ownership migration.
The heroui preset follows HeroUI's names, adding alert, avatar_group,
breadcrumbs, button_group, checkbox_group, chip, close_button,
dropdown, field_layout, input_group, modal, radio_group,
search_field, separator, surface, switch_group, table, text_area,
toggle_button, and toggle_button_group to shared names such as button and
select.
Vanilla, Fortal, and HeroUI distribute Agent recipe bundles under
lib/ui/recipes/, styling the experimental widgets in
package:remix/agent.dart. The widgets, models, and controllers come from
Remix; apps own the installed recipes and orchestration. Install
agent_glyphs_recipe for preset glyphs. See Agent migration
for the old-to-new map and commands. Previously installed behavior source
keeps compiling because it belongs to the app.
Install
The CLI requires Flutter 3.44 or later (Dart 3.12). With an older SDK, activation fails during version solving.
Install the CLI once globally; remix.yaml separately pins registry content:
dart pub global activate remix_cli '^1.0.0-rc.3'
remix init --prefix Acme --preset fortal
remix add button
Add Pub's bin directory to PATH if needed; Pub prints the instructions.
The constraint includes the 1.0 release candidate. CLI 0.1.0 reads only schema 1
icon tables and cannot use the official registry's schema 2 icons.yaml.
Projects upgrading from 0.1.0 also lack an ownership record, so their first
add needs the
legacy ownership migration.
For teams that want the CLI pinned in the app's lockfile, use
flutter pub add dev:remix_cli:^1.0.0-rc.3 instead. Prefix each command with
dart run remix_cli:, for example dart run remix_cli:remix init.
To run an unreleased build, point at a checkout or staged package path:
dart pub add "dev:remix_cli@{path: /path/to/remix/packages/remix_cli}"
The pinned catalog declares its required Remix version, which add records
for you. Updating the CLI alone does not advance a project's catalog pin.
remix_cli is versioned independently of remix, so its version does not
match Remix's. Its registry is authored against one remix
version; add reports when your resolved remix is newer than that one.
Activate an unreleased CLI from Git
To activate an unreleased revision from Git:
dart pub global activate --source git https://github.com/btwld/remix.git \
--git-path packages/remix_cli --git-ref main
remix --help
Add Pub's bin directory to PATH if prompted. To pin a specific revision,
replace main with a full commit SHA. Run the activation command again to update
a branch-based install. The CLI revision is independent of the registry commit in
remix.yaml. Activating a newer CLI does not advance that registry pin.
Git activation resolves CLI dependencies independently of a local checkout. In
contrast, --source path activates the live checkout using its
resolution: workspace configuration. That command can update the monorepo
lockfile to match your active Dart SDK. If you later restore or change that
lockfile, remix commands fail before the CLI starts:
The current activation of `remix_cli` cannot resolve to the same set of dependencies.
To recover the global command, run the Git activation command above. This replaces the path activation without modifying checkout manifests or lockfiles. To test local CLI edits, use a project-local path dependency instead.
Initialize a project
Run from a Flutter package root:
remix init
The default configuration is:
schema: 3
prefix: Ui
preset: vanilla
paths:
ui: lib/ui
defaultRegistry: "@remix"
registries:
"@remix":
repository: btwld/remix
path: registry
ref: registry-stable
revision: "<resolved-full-commit-sha>"
Customize it only at initialization:
remix init --prefix Acme --preset fortal --ui-path lib/design_system
init validates the Flutter project, writes remix.yaml, and creates a barrel
with a managed export block. Repeating the same command is safe. A different
configuration is refused instead of silently rewriting an existing project.
The preset defaults to vanilla when omitted and cannot be changed after
initialization.
Switch icon libraries
Set iconLibrary in remix.yaml to remix (the default, Outline), rounded
(Rounded), or lucide. The first two use remix_ui_icons; lucide uses
lucide_flutter. The setting affects installs, not existing source.
- Run
remix list --jsonfor the preset, registry revisions, item IDs, and target paths. Find installed items inremix.ownership.json, where each existing target's owner ends in#<preset>/<item-id>. Include installed dependencies, not just items you added explicitly. - Open the registry's
repositoryandpathat the exactrevisioninremix.yaml. Follow the preset's entry inindex.yamlto its catalog. Select installed items whose ownfiles[].sourcetemplates contain{{icon:; depending on an icon-owning item is not enough. - Change
iconLibraryand preview all selected items in oneadd --diffcommand (for example,remix add @remix/icons --diffificonsis the only owner). Review the diffs and save any local edits you need to reapply. Then rerun the command with--overwrite. Only named items are overwritten; icon references in your application are not rewritten.
A registry's icons.yaml maps each icon to a constant in every library. From
schema 2, an icon a library does not draw names a fallback library instead:
installing it on that library renders the fallback's constant and adds the
fallback's package too. All three libraries in the current official table
cover every icon; older pins retain their own mappings and dependencies.
Fortal as owned source
With preset: fortal, add button installs the full local theme layer,
base_button.dart, button.dart, and the generated adapter. The configured
prefix replaces Fortal throughout: --prefix Acme creates AcmeTheme,
AcmeTokens, AcmeButton, and acmeButtonStyle. The installed application
does not depend directly on mix, naked_ui, or remix_fortal; it can edit
the generated palette data, tokens, recipes, and instance overrides as ordinary app
source.
Place AcmeTheme below the application host. For a routed WidgetsApp, wrap
the child of WidgetsApp.builder with AcmeTheme. Routes and dialogs then
inherit its tokens and text defaults. See lib/ui/theme/theme_scope.dart for
the scope example.
Every preset supports theme, darkTheme, and mode on its generated scope.
The old scope data and brightness parameters and config createScope
shortcut are removed. Update application-owned callers to this API.
With no configuration, roots use the generated light/dark pair and follow the
system. Nested scopes inherit the pair and active selection. A custom theme
without darkTheme is used in both modes; supplying darkTheme alone keeps the
base default. Every preset generates AcmeThemeData.light(), .dark(), and
AcmeThemeMode (system, light, dark). Use AcmeTheme with your
configured prefix.
Place the scope in WidgetsApp.builder above the Navigator. The CLI installs
theme files, not a complete app host or appearance picker. See the
application host standard.
The prefixes Remix and Mix are reserved for runtime dependencies.
Use an application prefix such as Ui or Acme.
List the items you can add
remix list
list prints every item the pinned registries offer for the project's preset,
grouped by the directory it installs to, with the items each one needs. Names
print the way add accepts them: bare for the default registry, qualified
(@acme/card) for every other registry in remix.yaml. list reads the
pinned catalogs and changes nothing.
For scripts and agents, --json prints one JSON document on stdout with
qualified ids, registryDependencies, and the files each item installs:
remix list --json
Add a component
remix add button
Several items can be named in one command:
remix add button card checkbox
A batch installs as one unit. The items and everything they depend on are ordered once, so a dependency two of them share is written once, and the resolve, format, generation, and analysis steps run once for the whole batch rather than once per item. Naming an unknown item, or the same item twice, fails before anything is written.
The command installs Theme before Button, adds missing compatible hosted
dependencies, formats the authored files, and analyzes the installed UI path.
When the declared adapters need generation, the CLI runs an unfiltered
dart run build_runner build so unrelated generated outputs are not dropped
when the build cache is invalidated. The build can update outputs outside
the UI path; --dry-run, --diff, and the install summary call out that scope.
Recipe-only installs do not need build.yaml.
Installing an item with @MixableSpec source enables Mix's opt-in spec-styler
builder there, scoped to the installed files. The CLI preserves comments and
unrelated settings; it refuses explicit builder disablement, excluded source,
or conflicting target ownership before writing. --dry-run reports the
required configuration and --diff shows it without changing the application.
Adapters generated by mix_generator 2.3.0 pass the default flutter_lints;
leave them included in flutter analyze. If you're pinned to an older
generator and see unnecessary_this infos in its output, you can silence them
by excluding just the generated files in analysis_options.yaml. Match the
pattern to your paths.ui:
analyzer:
exclude:
- lib/ui/**/*.g.dart
With the Vanilla preset and path, the application receives:
lib/ui/
ui.dart
theme/
tokens.dart
theme_data.dart
theme_scope.dart
effects.dart
components/
button.dart
button.g.dart
One add installs every named item plus shared dependencies once.
Default component items add an authored file and a
generated part to components/. Fortal also has shared source items without
generated parts, such as base_button and typography.
Existing authored source stays untouched. When generation runs, the CLI checks
that the requested and already-installed adapters exist after the build.
Add a dashboard shell
remix add dashboard_shell
This installs the preset's sidebar, responsive sidebar layout, app bar, icon button,
text field, icons, and theme dependency closure plus two editable files under
lib/ui/recipes/dashboard/. The public UiDashboardShell<T> API is the same
for vanilla and fortal. The host supplies RemixSidebarSection<T> values,
the selected value and callback, the current page body, title (with an
optional headerTitle widget to override the default title widget), and brand
slot. Account and header-action slots are optional. Search is absent unless the
host provides onSearchChanged.
The shell composes inside the existing application. It does not create a
MaterialApp, WidgetsApp, Navigator, route table, authentication layer, or
persistence mechanism. Place it below the preset theme scope and keep those
host responsibilities in the application. A normal reinstall preserves edits;
use --diff and explicit --overwrite for template updates.
Add the full dashboard demo
Initialize any preset, then use the same item and public dashboard API:
remix init --prefix Ui --preset vanilla
# Or initialize a separate app with: --preset fortal or --preset heroui
remix add dashboard_demo
dashboard_demo installs UiDashboardDemo, UiDashboardOverview, the
usable shell, and the product destinations from the reference dashboard
(Overview, Chat, Customers, Orders, and Settings; Fortal adds Analytics,
Schedule, Collection, and Themes). Product pages and navigation
match across presets while rendering each preset's native components and
variants. It is a sample application, not part of the kit, so ui.dart does
not export it: import lib/ui/recipes/dashboard/dashboard_demo.dart, which
also exports the types UiDashboardDemo takes. The sample records live in
editable source: lib/ui/recipes/dashboard/dashboard_sample_data.dart
(uiDashboardSampleData) in Vanilla and HeroUI, and
lib/ui/recipes/dashboard/dashboard_demo_data.dart (uiDashboardSampleData)
in Fortal. Replace them there, or pass your own UiDashboardSampleData
(Vanilla, HeroUI) or UiDashboardData (Fortal) to UiDashboardDemo(data: ...).
The host supplies its Flutter application, directionality, brand, and theme
scope. Default uses UiTheme(theme: UiThemeData.light(), child: ...);
Fortal uses UiTheme(child: ...). The installer does not rewrite main.dart,
routes, authentication, persistence, or search behavior. Pass a real
onSearchChanged callback to show search; omit it to remove the field.
Installed recipe source follows the normal update contract. Re-running add dashboard_demo preserves local edits. Inspect a newer template with --diff, and
use --overwrite only when deliberately replacing the installed recipe.
Contributors can reproduce the isolated dashboard consumer gates for Vanilla
and Fortal. Add --keep to keep the generated app; its path is printed.
dart run tool/check_open_code.dart --preset vanilla --source checkout --item dashboard_demo --keep
dart run tool/check_open_code.dart --preset fortal --source checkout --item dashboard_demo --keep
remix add icons is the deliberate exception. It adds
lib/ui/icons.dart, declares the selected icon package and any per-icon
fallback packages, and exposes a small, application-owned UiIcons alias set
with no generated adapter. The current default Remix selection uses
remix_ui_icons without a fallback package. Add or rename aliases there as
your interface evolves. Every Remix icon remains one direct
package:remix_ui_icons/remix_ui_icons.dart import away.
All presets ship calendar, range_calendar, date_picker and
date_range_picker. They are hand-written composites with no generated part.
In Vanilla, the calendars wire IconButton and Select recipes; the pickers add
outline Button and elevated Popover recipes around the matching calendar.
Each child styler override merges last. Calendar selectors grow with text scaling.
Both pickers install date_picker_styles automatically as an internal dependency.
Most Vanilla component items generate one widget. Four generate several:
checkbox also generates
UiCheckboxGroupItem, text_field generates UiTextField and UiTextArea,
tabs generates UiTabBar, UiTab, and UiTabView, and chart generates
UiLineChart, UiBarChart, and UiPieChart.
Add application-owned charts
remix add chart
This installs one editable components/chart.dart recipe and adds
mix_chart. The generated adapters cover line and area charts, grouped,
stacked, and floating bars, and pie and donut charts. They use the existing
application theme and never import Fortal.
Import mix_chart directly for chart data. The UI barrel exports the generated
widgets and the application-owned style functions, but it does not re-export a
dependency's API:
import 'package:mix_chart/mix_chart.dart';
import 'ui/ui.dart';
final chart = SizedBox(
height: 240,
child: UiLineChart(
semanticsLabel: 'Weekly revenue',
series: [
LineSeries(
id: 'revenue',
label: 'Revenue',
points: [
ChartPoint(id: 'mon', x: 0, y: 18),
ChartPoint(id: 'tue', x: 1, y: 31),
],
),
],
),
);
Charts have no intrinsic height, so give line and bar charts a bounded height
and pie charts a bounded size. A pie does not scale to its box: each slice
ring is 80px wide unless the chart's style sets PieSliceStyler().radius,
so size a donut's ring to fit. The palette is the theme's chart1 to chart5
tokens, a neutral gray ramp: edit them in theme/theme_data.dart to restyle
every chart, or pass palette or a chart style for one instance.
RemixCheckboxGroup, RemixRadioGroup, RemixTabs, and
RemixAccordionGroup are behavioral and carry no style, so the registry has
nothing to render for them: import them from package:remix/remix.dart and put
the installed adapters inside. toggle_group, segmented_control, menu, and
select are the opposite case — their rows are data rather than widgets, so
the parent's recipe carries the row style and one add covers both.
The authored files are application source. A normal rerun preserves them. The generated part is owned by the consumer's resolved generator and should be committed, but not edited by hand.
Review and overwrite
Preview a new install without changing the project or running package tools:
remix add button --dry-run
Compare the requested item with the pinned registry source using Git's no-index diff:
remix add button --diff
--diff exits 0 whether or not it finds differences. To fail a CI step when
installed source drifts from the pin, add --exit-code:
remix add button --diff --exit-code
The command then exits 2 when authored source differs, and 1 still means a
failure.
After reviewing the difference, replace only the requested item's authored files:
remix add button --overwrite
Overwriting Button preserves locally edited Theme files. With several items
named, --overwrite covers each of them and still preserves every dependency
that came in behind them; overwrite a dependency by naming it explicitly. Compatible existing
hosted, path, Git, custom-hosted, and override dependency declarations are also
preserved. An incompatible resolved dependency fails before authored-source
writes.
Section placement is checked but never rewritten. Packages the installed source
imports at runtime (remix, mix_annotations, mix_chart for chart,
remix_ui_icons and its lucide_flutter fallback for icons, and
remix_ui_fonts for the Vanilla theme)
must be declared under
dependencies; build-only packages (build_runner, mix_generator) may sit in
either section. Declaring the same package in both sections is rejected. A
misplaced declaration fails before any process runs or file is written, and the
CLI names the package and the section to move it to rather than editing your
pubspec.yaml.
If generation or analysis fails after installation, the authored source stays
in place for inspection. Generation failures can come from any configured
builder, not just Mix. After fixing a builder issue, run
dart run build_runner build from the application root before retrying
remix add: the retry can skip generation if the adapters already exist.
For an analysis failure, fix the reported issue and rerun the same command.
Install agent skills
Remix publishes two agent skills: using-remix for app UI and
building-remix-design-system for registry authors. Copy them into your
project from the commit your project is pinned to:
remix skills install
The command reads the @remix revision in remix.yaml and writes:
.agents/skills/<skill>/: the skill files from that commit.AGENTS.md: oneremix_cli:skillsblock that tells an agent when to read each skill. Text outside the block is not changed.remix.skills.json: the revision and a digest of each file.
Commit all three. Run the command again after remix registry update @remix.
Claude Code loads project skills from .claude/skills. Name the directory
once; later runs remember it:
remix skills install --dir .claude/skills
To keep the block in CLAUDE.md or another instruction file, move the block
there. The next run updates it in place.
The command owns the files it vendors. If one was changed, the next run stops and names it. Restore or delete the file, then run the command again.
Exit codes
0: success, including help, version, dry-run, diff, and no-op reruns64: invalid command or command-line arguments1: project/configuration, registry, dependency, process, generation, analysis, or filesystem failure2:--diff --exit-codefound authored-source differences
Errors print as plain messages on stderr. An unexpected internal error prints a
bug report with the remix_cli version and a stack trace instead. add prints
one progress line on stderr before each slow phase, and list prints
Fetching registry items... the same way, so stdout keeps only the plan, the
diff, the listing, and the result. A successful run can still write to stderr,
so check the exit code, not whether stderr is empty.
Manual updates
The MVP's update workflow is explicit. Upgrading remix_cli does not change
the source you install; the registry pin in remix.yaml does:
- run
registry update @remixto move the pin to the newest promoted commit (@remixis the namespaceinitgives the official registry); - run
add button --diff; - review the template changes against local customizations;
- use
add button --overwriteonly when replacement is intended; - reapply or refine application-specific changes and commit
remix.yamland the regenerated adapter.
There is no automatic merge or migration layer.
If your app was installed before the registry moved to text_field and
HeroUI's text_area, follow the #511 registry migration guide
before reinstalling those items or their dependents. The guide also covers the
dashboard demo exports removed in the same cutover.
Because --overwrite replaces only files present in the incoming registry item
and updateManagedBarrel preserves existing exports without pruning, removing
an obsolete template file during an upgrade requires manual cleanup. Before
upgrading an existing Vanilla project installed prior to token consolidation,
complete legacy ownership adoption
for every existing item and dependency. Commit remix.ownership.json with the
configuration and source, then update the theme:
- run
remix add theme --overwriteto updatetokens.dart,theme_data.dart, andtheme_scope.dart; - update installed components to use
<Prefix>Tokensinstead ofscale.dartby re-adding them with--overwrite(for example,remix add <component> --overwrite) or updating local component imports and references fromscale.dartand its retired helper classes (<Prefix>Space,<Prefix>Size,<Prefix>Stroke,<Prefix>Opacity, and<Prefix>Motion) to<Prefix>Tokens; - delete
lib/ui/theme/scale.dart; - remove
export 'theme/scale.dart';fromlib/ui/ui.dart.
All scale constants (s0_5 .. s16, controlSm .. pill, strokeHairline,
strokeIndicator, strokeRing, disabledOpacity, and motion) now reside on
<Prefix>Tokens in lib/ui/theme/tokens.dart.
Available styled items: agent_glyphs_recipe, answer_recipe, composer_recipe, conversation_recipe,
message_recipe, sources_recipe, steps_recipe, suggestions_recipe, and
tool_call_recipe. Each styles one widget of package:remix/agent.dart with the
preset's own components.
Libraries
- remix_cli
- Marker library for the
remix_clipackage.