Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit 7581d40

Browse files
committed
docs: update README and add Type Generation Command documentation
- Enhanced the README with a new section on features, improving clarity on the capabilities of the Storyblok CLI. - Added a comprehensive documentation file for the Type Generation Command, detailing prerequisites, usage examples, architecture, and testing strategies to ensure type safety in Storyblok components. - Improved visual elements in the README, including badge colors and layout adjustments for better readability.
1 parent d193e81 commit 7581d40

2 files changed

Lines changed: 384 additions & 86 deletions

File tree

README.md

Lines changed: 64 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,67 @@
1-
![](/.github/assets/repo-banner.png)
2-
31
<div align="center">
4-
<h1>Storyblok CLI</h1>
5-
<p align="center">A powerful CLI for scaffolding <a href="https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok" target="_blank">Storyblok</a> projects and fieldtypes.</p>
2+
3+
![Storyblok ImagoType](https://raw.githubusercontent.com/storyblok/.github/refs/heads/main/profile/public/github-banner.png)
4+
5+
<h1>Storyblok CLI</h1>
6+
<p>A powerful CLI tool to improve the DX of your <a href="https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok" target="_blank">Storyblok</a> projects.</p>
67
<br />
78
</div>
89

910
<p align="center">
1011
<a href="https://npmjs.com/package/storyblok">
11-
<img src="https://img.shields.io/npm/v/storyblok/latest.svg?style=flat-square" alt="Storyblok JS" />
12+
<img src="https://img.shields.io/npm/v/storyblok/latest.svg?style=flat-square&color=8d60ff" alt="Storyblok JS Client" />
1213
</a>
1314
<a href="https://npmjs.com/package/storyblok" rel="nofollow">
14-
<img src="https://img.shields.io/npm/dt/storyblok.svg?style=flat-square" alt="npm">
15+
<img src="https://img.shields.io/npm/dt/storyblok.svg?style=appveyor&color=8d60ff" alt="npm">
1516
</a>
16-
</p>
17-
18-
<p align="center">
1917
<a href="https://discord.gg/jKrbAMz">
20-
<img src="https://img.shields.io/discord/700316478792138842?label=Join%20Our%20Discord%20Community&style=appveyor&logo=discord&color=09b3af">
18+
<img src="https://img.shields.io/discord/700316478792138842?label=Join%20Our%20Discord%20Community&style=appveyor&logo=discord&color=8d60ff">
2119
</a>
2220
<a href="https://twitter.com/intent/follow?screen_name=storyblok">
23-
<img src="https://img.shields.io/badge/Follow-%40storyblok-09b3af?style=appveyor&logo=twitter" alt="Follow @Storyblok" />
24-
</a>
25-
<a href="https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-richtext">
26-
<img src="https://img.shields.io/badge/Try%20Storyblok-Free-09b3af?style=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAHqADAAQAAAABAAAAHgAAAADpiRU/AAACRElEQVRIDWNgGGmAEd3D3Js3LPrP8D8WXZwSPiMjw6qvPoHhyGYwIXNAbGpbCjbzP0MYuj0YFqMroBV/wCxmIeSju64eDNzMBJUxvP/9i2Hnq5cM1devMnz984eQsQwETeRhYWHgIcJiXqC6VHlFBjUeXgav40cIWkz1oLYXFmGwFBImaDFBHyObcOzdW4aSq5eRhRiE2dgYlpuYoYSKJi8vw3GgWnyAJIs/AuPu4scPGObd/fqVQZ+PHy7+6udPOBsXgySLDfn5GRYYmaKYJcXBgWLpsx8/GPa8foWiBhuHJIsl2DkYQqWksZkDFgP5PObcKYYff//iVAOTIDlx/QPqRMb/YSYBaWlOToZIaVkGZmAZSQiQ5OPtwHwacuo4iplMQEu6tXUZMhSUGDiYmBjylFQYvv/7x9B04xqKOnQOyT5GN+Df//8M59ASXKyMHLoyDD5JPtbj42OYrm+EYgg70JfuYuIoYmLs7AwMjIzA+uY/zjAnyWJpDk6GOFnCvrn86SOwmsNtKciVFAc1ileBHFDC67lzG10Yg0+SjzF0ownsf/OaofvOLYaDQJoQIGix94ljv1gIZI8Pv38zPvj2lQWYf3HGKbpDCFp85v07NnRN1OBTPY6JdRSGxcCw2k6sZuLVMZ5AV4s1TozPnGGFKbz+/PE7IJsHmC//MDMyhXBw8e6FyRFLv3Z0/IKuFqvFyIqAzd1PwBzJw8jAGPfVx38JshwlbIygxmYY43/GQmpais0ODDHuzevLMARHBcgIAQAbOJHZW0/EyQAAAABJRU5ErkJggg==" alt="Follow @Storyblok" />
21+
<img src="https://img.shields.io/badge/Follow-%40storyblok-8d60ff?style=appveyor&logo=twitter" alt="Follow @Storyblok" />
22+
</a><br/>
23+
<a href="https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-cli">
24+
<img src="https://img.shields.io/badge/Try%20Storyblok-Free-8d60ff?style=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAHqADAAQAAAABAAAAHgAAAADpiRU/AAACRElEQVRIDWNgGGmAEd3D3Js3LPrP8D8WXZwSPiMjw6qvPoHhyGYwIXNAbGpbCjbzP0MYuj0YFqMroBV/wCxmIeSju64eDNzMBJUxvP/9i2Hnq5cM1devMnz984eQsQwETeRhYWHgIcJiXqC6VHlFBjUeXgav40cIWkz1oLYXFmGwFBImaDFBHyObcOzdW4aSq5eRhRiE2dgYlpuYoYSKJi8vw3GgWnyAJIs/AuPu4scPGObd/fqVQZ+PHy7+6udPOBsXgySLDfn5GRYYmaKYJcXBgWLpsx8/GPa8foWiBhuHJIsl2DkYQqWksZkDFgP5PObcKYYff//iVAOTIDlx/QPqRMb/YSYBaWlOToZIaVkGZmAZSQiQ5OPtwHwacuo4iplMQEu6tXUZMhSUGDiYmBjylFQYvv/7x9B04xqKOnQOyT5GN+Df//8M59ASXKyMHLoyDD5JPtbj42OYrm+EYgg70JfuYuIoYmLs7AwMjIzA+uY/zjAnyWJpDk6GOFnCvrn86SOwmsNtKciVFAc1ileBHFDC67lzG10Yg0+SjzF0ownsf/OaofvOLYaDQJoQIGix94ljv1gIZI8Pv38zPvj2lQWYf3HGKbpDCFp85v07NnRN1OBTPY6JdRSGxcCw2k6sZuLVMZ5AV4s1TozPnGGFKbz+/PE7IJsHmC//MDMyhXBw8e6FyRFLv3Z0/IKuFqvFyIqAzd1PwBzJw8jAGPfVx38JshwlbIygxmYY43/GQmpais0ODDHuzevLMARHBcgIAQAbOJHZW0/EyQAAAABJRU5ErkJggg==" alt="Follow @Storyblok" />
2725
</a>
2826
</p>
2927

28+
## Features
29+
30+
- 🛡️ **Type Safety** - Generate TypeScript type definitions for your Storyblok components, ensuring type safety in your frontend applications
31+
- 🔐 **Authentication** - Secure login system with support for different regions and CI environments
32+
- 🧩 **Component Management** - Pull and push component schemas, groups, presets, and internal tags between spaces
33+
- 🔄 **Migration System** - Generate and run migrations to transform or update field values across your Storyblok content
34+
- 🌐 **Language Management** - Pull and manage languages for your Storyblok space
35+
- 📁 **File Organization** - Organized file structure with the `.storyblok` directory as default
36+
- 🛠️ **Customizable Paths** - Flexible path configuration for all generated files
37+
- 📝 **Naming Conventions** - Consistent file naming with customizable suffixes and prefixes
38+
- 📂 **Separate Files Support** - Option to work with individual component files or consolidated files
39+
- 👀 **Dry Run Mode** - Preview migrations changes before applying them to your Storyblok space
40+
- 🔍 **Filtering Capabilities** - Filter components and stories using glob patterns and Storyblok query syntax
41+
- 📊 **Verbose Logging** - Improved error handling and detailed logging options for debugging and monitoring
42+
3043
## Pre-requisites
3144

3245
- [Node.js >= 18.0.0](https://nodejs.org/en/download/)
3346
- Storyblok account (sign up [here](https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-cli))
3447
- Personal access token from Storyblok (get it [here](https://app.storyblok.com/#/me/account?tab=token))
3548

36-
## 🚀 Usage
37-
38-
### Installation
39-
40-
```bash
41-
npm install storyblok -g
42-
```
43-
44-
If you prefer not to install the package globally you can use `npx`:
45-
46-
```bash
47-
npx storyblok <command>
48-
```
49-
50-
## Breaking Changes ⚠️
51-
52-
### `.storyblok` directory as default
53-
54-
All the commands that generate files will now use the `.storyblok` directory as the default directory to interact with those files. This aims to encapsulate all Storyblok CLI operations instead of filling them on the root. Users would be able to customize the directory by using the `--path` flag.
55-
56-
Example:
57-
58-
```bash
59-
storyblok pull-languages --space=12345
60-
```
61-
62-
Will generate the languages in the `.storyblok/languages` directory.
63-
64-
> [!TIP]
65-
> If you prefer to avoid pushing the `.storyblok` directory to your repository you can add it to your `.gitignore` file.
66-
67-
### Generated filename syntax conventions
68-
69-
The generated files will now follow a more consistent naming convention. The files will be named using the following syntax:
70-
71-
```
72-
<filename>.<suffix>.<extension>
73-
```
74-
75-
Where:
76-
77-
- `<filename>` is the name of the file. Customizable by the user with the `--filename` flag
78-
- `<suffix>` is an optional suffix to differentiate the files. By default is going to be the `spaceId` and is customizable by the user with the `--suffix` flag
79-
- `<extension>` is the file extension. By default is `json` (Not configurable)
80-
81-
Example:
82-
83-
```bash
84-
storyblok pull-languages --space=12345 --filename=my-languages --suffix=dev
85-
```
49+
## Documentation
8650

87-
Will generate the languages in the following path `.storyblok/languages/my-languages.dev.json`
88-
89-
If you would like to use a timestamp as the suffix you can use:
90-
91-
```bash
92-
storyblok pull-languages --space=12345 --filename=my-languages --suffix="$(date +%s)"
93-
```
94-
95-
> [!WARNING]
96-
> The `--filename` will be ignored in the case that `--separate-files` is used on the commands that supports it.
51+
For complete documentation, please visit [https://storyblok.com/docs](https://storyblok.com/docs/packages/my-joyful-package)
9752

9853
## Setup
9954

100-
First clone the repository and install the dependencies:
55+
This package relies on [pnpm](https://pnpm.io/) to manage dependencies. For instructions on how to install pnpm, please visit [pnpm.io](https://pnpm.io/installation).
10156

10257
```bash
10358
pnpm install
10459
```
10560

106-
Then you can stub and run the CLI with:
107-
108-
```bash
109-
pnpm run dev <command>
110-
```
111-
112-
For example:
61+
## Build
11362

11463
```bash
115-
pnpm run dev login
64+
pnpm build
11665
```
11766

11867
### Testing
@@ -145,7 +94,36 @@ Then you can set breakpoints directly to the typescript files and the debugger w
14594

14695
![Debugging](/.github/assets/breakpoints.png)
14796

148-
### Contributing
14997

150-
Please see our [contributing guidelines](https://github.com/storyblok/.github/blob/main/contributing.md) and our [code of conduct](https://www.storyblok.com/trust-center#code-of-conduct?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-js).
151-
This project use [semantic-release](https://semantic-release.gitbook.io/semantic-release/) for generate new versions by using commit messages and we use the Angular Convention to naming the commits. Check [this question](https://semantic-release.gitbook.io/semantic-release/support/faq#how-can-i-change-the-type-of-commits-that-trigger-a-release) about it in semantic-release FAQ
98+
## Community
99+
100+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
101+
102+
- [Discuss Storyblok on Github Discussions](https://github.com/storyblok/storyblok/discussions)
103+
104+
For community support, chatting with other users, please visit:
105+
106+
- [Discuss Storyblok on Discord](https://discord.gg/jKrbAMz)
107+
108+
## Support
109+
110+
For bugs or feature requests, please [submit an issue](https://github.com/storyblok/my-joyful-package/issues/new/choose).
111+
112+
> [!IMPORTANT]
113+
> Please search existing issues before submitting a new one. Issues without a minimal reproducible example will be closed. [Why reproductions are Required](https://antfu.me/posts/why-reproductions-are-required).
114+
115+
### I can't share my company project code
116+
117+
We understand that you might not be able to share your company's project code. Please provide a minimal reproducible example that demonstrates the issue by using tools like [Stackblitz](https://stackblitz.com) or a link to a Github Repo lease make sure you include a README file with the instructions to build and run the project, important not to include any access token, password or personal information of any kind.
118+
119+
### I only have a question
120+
121+
If you have a question, please ask in the [Discuss Storyblok on Discord](https://discord.gg/jKrbAMz) channel.
122+
123+
## Contributing
124+
125+
If you're interested in contributing to my-joyful-package, please read our [contributing docs](https://github.com/storyblok/.github/blob/main/CONTRIBUTING.md) before submitting a pull request.
126+
127+
## License
128+
129+
[License](/LICENSE)

0 commit comments

Comments
 (0)