User Guide
The CLI tool that automates setups and installs components.
Installation
Initialize a config for CLI:
npx @hanzo/docs-cliYou can change the output paths of components in the config.
Components
Select and install components.
npx @hanzo/docs-cli addYou can pass component names directly.
npx @hanzo/docs-cli add banner filesHow the magic works?
The CLI fetches the latest version of component from the GitHub repository of Hanzo Docs. When you install a component, it is guaranteed to be up-to-date.
In addition, it also transforms import paths. Make sure to use the latest version of CLI
This is highly inspired by Shadcn UI.
Customise
A simple way to customise Hanzo Docs layouts.
npx @hanzo/docs-cli customiseTree
Generate files tree for Hanzo Docs UI Files component, using the tree command from your terminal.
npx @hanzo/docs-cli tree ./my-dir ./output.tsxYou can output MDX files too:
npx @hanzo/docs-cli tree ./my-dir ./output.mdxSee help for further details:
npx @hanzo/docs-cli tree -hExample Output
import { File, Folder, Files } from '@hanzo/docs/ui/components/files';
export default (
<Files>
<Folder name="app">
<File name="layout.tsx" />
<File name="page.tsx" />
<File name="global.css" />
</Folder>
<Folder name="components">
<File name="button.tsx" />
<File name="tabs.tsx" />
<File name="dialog.tsx" />
</Folder>
<File name="package.json" />
</Files>
);How is this guide?
Last updated on
