{"id":27153970,"url":"https://github.com/sveiljs/sveil-cli","last_synced_at":"2025-07-24T17:04:41.636Z","repository":{"id":177945103,"uuid":"661111987","full_name":"sveiljs/sveil-cli","owner":"sveiljs","description":"Sveil - svelte generation tool","archived":false,"fork":false,"pushed_at":"2023-12-28T01:04:03.000Z","size":136,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T21:44:17.504Z","etag":null,"topics":["cli","comand-line","generation","generator","svelte","sveltejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sveiljs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-01T20:35:28.000Z","updated_at":"2023-07-29T18:39:47.000Z","dependencies_parsed_at":"2023-12-28T03:00:01.003Z","dependency_job_id":"0ca0e0ff-bfcf-4c61-8842-acc7c571e182","html_url":"https://github.com/sveiljs/sveil-cli","commit_stats":null,"previous_names":["sveiljs/sveil-cli"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/sveiljs/sveil-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sveiljs%2Fsveil-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sveiljs%2Fsveil-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sveiljs%2Fsveil-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sveiljs%2Fsveil-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sveiljs","download_url":"https://codeload.github.com/sveiljs/sveil-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sveiljs%2Fsveil-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265599326,"owners_count":23795489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","comand-line","generation","generator","svelte","sveltejs"],"created_at":"2025-04-08T16:19:21.397Z","updated_at":"2025-07-24T17:04:41.552Z","avatar_url":"https://github.com/sveiljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sveil-cli\n\n\u003e ⚠️Alpha version. Still under development!\n\n\u003e Required node \u003e= 16\n\n  \u003cdetails\u003e\n    \u003csummary\u003eFAQ\u003c/summary\u003e\n    \n  **What:**\n\nThe sveil. Generation tool for svelte. Sveil will generate svelte resources.\n\n**Why:**\n\nWhy not? Svelte is pretty mature framework, but for some reason have no any generation tool that widely used. Generation tool could save some time, scale application, and set structure. I didn't find any other generation tools for svelte, only nx have one, but it's comes with monorepos only, nx workspace and other configs (and last time I tried it svelte plugin didn't work well). And Lets say, svelte plugin for nx isn't looks official, nx mostly focused on react or angular.\n\nThe Sveil on other hand is standalone tool that you can use without any config files.\n\n  \u003c/details\u003e\n\n---\n\n  \u003cdetails\u003e\n    \u003csummary\u003eTL;DR;\u003c/summary\u003e\n\n**Philosophy:**\n\nFreedom without structure is chaos. Svelte let us decide how to organize project freely, there're only several restrictions/rules. Since svelte trying to bind to native js way without any built in design patterns, we as developers are on our own.\n\nI see 3 main goals of sveil tool:\n\n- Generation\n- Structure\n- Scale\n\nFor now it's limited generation, but with time sveil will get ability to structure svelte project and scale it (like nest or angular cli).\n\n  \u003c/details\u003e\n\n---\n\n# Table of Content\n\n- [sveil-cli](#sveil-cli)\n- [Table of Content](#table-of-content)\n  - [Instalation](#instalation)\n  - [Getting started](#getting-started)\n  - [Usage](#usage)\n    - [Init](#init)\n    - [Generate](#generate)\n      - [Component](#component)\n      - [Component state](#component-state)\n      - [Examples](#examples)\n\n---\n\n## Instalation\n\n    ```\n    npm i @sveil/cli -g\n    ```\n\n---\n\n## Getting started\n\nYou can easily run:\n\n```\nsveil --help\n```\n\nIn any situation to find desired command.\n\n---\n\n## Usage\n\nHere's documentation, that you can run in any time:\n\n```\nsveil\nUsage: sveil [options] [command]\n\nOptions:\n  -v, --version     Show sveil version\n  -h, --help        display help for command\n\nCommands:\n  init|i [options]  Init sveil and create sveil config\n  generate|g        Generate sveil resource\n  help [command]    display help for command\n```\n\n---\n\n### Init\n\nCommand creates _sveil-cli.json_ in root directory.\n\n\u003e Not required in most cases. You need it only if your project using non standart named directories.\n\nFor example common path in svelte for lib is **src/lib/**, but if you have **src/library/**, then you need sveil configuration file (you can create it manually, doesn't matter really). Same for inner lib directories, like \"components\", \"store\", etc. Or even **source/** instead of **src/**, all path values are configurable.\n\nIn all other cases you don't need config file and nobody ever will know that you used sveil (●'◡'●)\n\n```\nsveil i --help\nUsage: sveil init|i [options]\n\nInit sveil and create sveil config\n\nOptions:\n  -d, --dry                    Run command dry-run(no changes will be applied)\n  -y, --skip                   Skip interactive tour and init with default values\n  -srcd, --source-dir \u003cdir\u003e    Set source directory of project\n  -ld, --lib-dir \u003cdir\u003e         Set lib directory of project\n  -cd, --components-dir \u003cdir\u003e  Set components directory of project\n  -h, --help                   display help for command\n```\n\n---\n\n### Generate\n\n#### Component\n\n```\nsveil g c --help\nUsage: sveil generate component|c [options] \u003ccomponentName\u003e\n\nGenerate svelte component\n\nArguments:\n  componentName                      Component name\n\nOptions:\n  -d, --dry                          Run comman dry-run (no changes will be applied)\n  -sl, --script-language \u003clanguage\u003e  Set component script language (choices: \"ts\", \"js\")\n  -ce, --css-external                Put component styles out of component\n  -cl, --css-language \u003clanguage\u003e     Set component style language, e.g. 'scss' (choices: \"scss\", \"postcss\")\n  -o, --overwrite                    WARNING: Overwriting existing component\n  -s, --separate                     Generate component in separate folder\n  -h, --help                         display help for command\n```\n\n#### Component state\n\n\u003e _Typescript only for now_\n\n```\nsveil g cs --help\nUsage: sveil generate component-state|cs [options] [componentName]\n\nGenerate component state\n\nArguments:\n  componentName           Target component name\n\nOptions:\n  -d, --dry               Run command dry-run (no changes will be applied)\n  -s, --state             add target stores\n  -n, --file-name [name]  Custom file name\n  -h, --help              display help for command\n\n```\n\n#### Examples\n\n  \u003cdetails\u003e\n    \u003csummary\u003eGenerate Component\u003c/summary\u003e\n\n   ![sveil generate component](https://github.com/sveiljs/sveil-cli/assets/17780142/d86f4f1a-f6cd-46c0-9d95-a2ed991a8a35=250x250)\n```\n\nsveil g c main\n\n```\n\nOR\n\n```\n\nsveil generate component main\n\n```\n\nOutput:\n\n```\n\n- file main.svelte generated in ...\\src\\lib\\components\\main.svelte\n\n```\n\nBasic svelte component template:\n\n```\n\n\u003cscript\u003e\n  let name = \"main\";\n\u003c/script\u003e\n\n\u003cdiv class=\"main\"\u003e\n  {name}\n\u003c/div\u003e\n\n\u003cstyle\u003e\n  .main {\n    margin: 0;\n    padding: 0;\n  }\n\u003c/style\u003e\n\n```\n\nBy default sveil use plain css and js for component template, but if project use typescript - it automatically add lang=\"ts\".\nIt's possible to overwrite default script/style languages with -sl and -cl options.\n\n\u003e Sveil supports typescript only in script languages and scss/postcss in style preprocessors (for now).\n\u003e\n\u003e Please, be aware there's no auto detection for style preprocessors yet.\n\nYou can move styles out of component with -ce option\n\n```\n\nsveil g c example -ce\n\n```\n\nOr create component in separate folder with -s option\n\n```\n\nsveil g c example -s\n\n```\n\nIf component already existed, then you can use -o option with little confirmation prompt (need to write component name)\n\n```\n\nsveil g c example -o\n\n```\n\n\u003c/details\u003e\n\n  \u003cdetails\u003e\n    \u003csummary\u003eGenerate Component State\u003c/summary\u003e\n\n**[More info about output file](https://github.com/sveiljs/sveil?tab=readme-ov-file#basic-example)**\n\n```\n\nsveil g cs main\n\n```\n\nOR\n\n```\n\nsveil generate component-state main\n\n```\n\nOutput:\n\n```\n\n- file main.ts generated in ...\\src\\lib\\components\\main\\main.ts\n\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsveiljs%2Fsveil-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsveiljs%2Fsveil-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsveiljs%2Fsveil-cli/lists"}