Skip to content

CLI

Set a project up, install a theme, and check what is wired.

@blasdoc/cli sets a project up and installs themes. It works out which of the three project kinds it is looking at — Angular CLI, Nx or Analog — and wires accordingly.

npx @blasdoc/cli init

blasdoc init

Detects the project and writes the mechanical parts:

  • src/blasdoc.d.ts, so .md imports and templateMD are typed;

  • loader: { ".md": "text" } on the build target, or the Vite plugin reminder;

  • the editor plugin in tsconfig, so the Angular Language Service agrees with the build.

text
✓ Detected an Angular CLI project.
✓ Configuring "demo".
✓ Wrote src/blasdoc.d.ts.
✓ Added the .md loader to angular.json.
✓ Added the editor plugin to tsconfig.json.
→ Add the providers to your application config: …
OptionMeaning
--project <name>which application to configure; defaults to the first
--dry-runsay what would change, change nothing

blasdoc theme init [name]

Writes a starter theme with the tokens most themes change, and imports it from the global stylesheet.

npx @blasdoc/cli theme init sunset

The @import is inserted where CSS allows one — after @charset, @layer and the other imports, before the first rule. Appended at the end it would be silently ignored.

blasdoc theme install <file.css>

Installs a theme you generated — on the theme generator, or with the MCP server's blasdoc_theme tool.

npx @blasdoc/cli theme install my-theme.css

It copies the file into the source root and imports it.

blasdoc doctor

Reports what is wired up and what is not, without changing anything.

text
✓ Nx project.
✓ Types declared in apps/docs/src/blasdoc.d.ts.
✓ The .md loader is configured.
✓ Building through @blasdoc/build, so templateMD works.
✓ A theme is imported: apps/docs/src/sunset.css.

A theme is recognised by what the file contains — a --blasdoc- token — rather than by its name, so a theme is free to be called anything.

What it will not do

  • It will not install packages for you; it prints the command, because which optional packages a project wants is a decision.

  • It will not edit a Vite config; it prints the two lines to add, because a Vite config is code and rewriting code is how a tool breaks a project.