├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── bin └── index.js ├── lib ├── generate.js ├── handler.js ├── message.js ├── parse.js ├── preview │ ├── client.html │ ├── index.js │ └── server.js ├── read.js ├── render │ ├── index.js │ ├── screencast.js │ └── screenshot.js └── static.js ├── package-lock.json ├── package.json └── screenshot └── preview.png /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2024 Yuan Chuan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @css-doodle/cli 2 | 3 | Command-line tool for css-doodle to preview and generate images/videos. 4 | 5 | screenshot 6 | 7 | ## Installation 8 | 9 | ```bash 10 | npm install -g @css-doodle/cli 11 | ``` 12 | 13 | >[!NOTE] 14 | > After installation, you can use `cssd` or `css-doodle` command in the terminal. 15 | 16 | ## Usage 17 | 18 | ```console 19 | Usage: cssd [options] [command] [source] 20 | 21 | Arguments: 22 | source css-doodle source file to preview (same as run command) 23 | 24 | Options: 25 | -V, --version output the version number 26 | -h, --help display help for command 27 | 28 | Commands: 29 | run Open a window to preview the css|cssd file 30 | render Generate an image from a css|cssd|html file or a CodePen link 31 | generate Generate code using css-doodle generators 32 | config Display/set configurations 33 | use Shorthand to fetch and use a custom version of css-doodle 34 | parse Print the parsed tokens, help to debug in development 35 | upgrade Upgrade CLI to latest version 36 | ``` 37 | 38 | ## Commands 39 | 40 | ### run 41 | Open a window to preview the css-doodle source file. The source file can be either `.css` or `.cssd`. 42 | 43 | * `--fullscreen`: Open in fullscreen mode. 44 | 45 | ```bash 46 | cssd run code.css 47 | cssd run code.css --fullscreen 48 | ``` 49 | 50 | The `run` can be omitted if you just want to preview. 51 | 52 | ```bash 53 | cssd somefile.css 54 | ``` 55 | 56 | ### render 57 | Generate an image/video from the css-doodle source file. The source file can be a `.css`, `.cssd`, `.html` file or CodePen link. 58 | 59 | * `-o, --output `: Custom output filename of the generated result 60 | * `-x, --scale `: Scale factor of the generated result, defaults to `2` for images, `1` for videos 61 | * `-s, --selector `: CSS selector to target the rendered node, defaults to `css-doodle` 62 | * `-d, --delay `: Delay time before taking screenshot/screencast, e.g, `2s` 63 | * `-t, --time