{"id":29177721,"url":"https://github.com/totvs/thf-cli","last_synced_at":"2025-07-01T18:07:51.473Z","repository":{"id":57148862,"uuid":"164707760","full_name":"totvs/thf-cli","owner":"totvs","description":"THF Command Line Interface","archived":false,"fork":false,"pushed_at":"2020-09-04T14:50:33.000Z","size":21,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-05-22T04:46:13.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/totvs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T18:18:27.000Z","updated_at":"2019-07-03T20:51:48.000Z","dependencies_parsed_at":"2022-08-31T20:02:41.084Z","dependency_job_id":null,"html_url":"https://github.com/totvs/thf-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/totvs/thf-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Fthf-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Fthf-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Fthf-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Fthf-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totvs","download_url":"https://codeload.github.com/totvs/thf-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Fthf-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263013723,"owners_count":23399813,"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":[],"created_at":"2025-07-01T18:07:50.612Z","updated_at":"2025-07-01T18:07:51.419Z","avatar_url":"https://github.com/totvs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# THF CLI\n\nThe THF CLI is a command-line interface tool that you use to initialize and develop Angular applications with THF already configured.\nYou can use the tool directly in a command shell.\n\n## Installation\n\nMake sure Node, NPM and GIT are installed.\n\nThen, install the CLI globally:\n\n```\n$ npm install -g @totvs/thf-cli\n```\n\n## Getting Started\n\nStart a new project using the THF CLI and add components dynamically in your project.\n\nTo run an application, follow the steps below:\n\n```\nthf new SampleProject\ncd SampleProject\nng serve\n```\n\n![Getting Started](https://media.giphy.com/media/3FbGebspps6pxlIUFr/giphy.gif)\n\nTo check the commands list of THF CLI, invoke --help:\n\n```\nthf --help\n```\n\n## Commands\n\nCommand | Alias | Description\n--- | --- | ---\n*[add](#add)* | a | Add a module that has a dynamic component of your choice.\n*[new](#new)* | n | Creates a new project based in a template.\n*[convert-imports](#convert-imports)* | ci | Converts imports from THF version 3 to THF version 4.\n\n```\nthf add \u003cnewComponentName\u003e\n```\n\n```\nthf new \u003cprojectName\u003e\n```\n\n\n```\nthf convert-imports\n```\n\n### add\n\nThis command adds in your project a module that has a dynamic component of your choice with internal routes configured, simply adding in your main application path or another module to run.\n\n\u003e Must be in project root folder.\n\n```\nthf add \u003cnewComponentName\u003e\n```\n\n![Add Command](https://media.giphy.com/media/ksb6TvzeH4dcDSRMi8/giphy.gif)\n\nIf the project was built through the \"sidemenu\" template, you need to configure the new module by adding it in the route and in the menu list of the project.\n\n\u003e app.component.ts\n```\nreadonly menus: Array\u003cThfMenuItem\u003e = [\n  { label: 'Home', link: '/home' },\n  { label: 'Users', link: '/users' },\n  // add here\n  { label: 'newComponent', link: '/newComponent' },\n];\n```\n\n\u003e app-routing.component.ts\n```\nconst routes: Routes = [\n  { path: 'home', loadChildren: './home/home.module#HomeModule' },\n  { path: 'users', loadChildren: './users/users.module#UsersModule' },\n  // add here\n  { path: 'newComponent', loadChildren: './newComponent/newComponent.module#NewComponentModule' },\n  { path: '', redirectTo: '/home', pathMatch: 'full'}\n];\n```\n\n\u003e If is a common Angular project, it's necessary import the new module in app module or adding it in lazy load route.\n\n### new\n\nThis command initialize a project to you start your development more quickly with the THF already set up ready to run!\n\n```\nthf new \u003cprojectName\u003e --template \u003ctemplate\u003e --title \u003ctitle\u003e\n```\n\n![New Command](https://media.giphy.com/media/2A3FtMzAVfGQArw5i5/giphy.gif)\n\n#### -t / --template\n\nAll templates have the THF configured, the templates that you can start are:\n\nTemplate | Description\n--- | ---\n*blank* | Creates a simple project with THFModule and THF css configured.\n*sidemenu* | Creates a project containing the menu and modules using lazy loading to start development.\n\n\u003e The default template is `sidemenu`.\n\n```\nthf new \u003cprojectName\u003e --template \u003ctemplate\u003e\n```\n\n#### --title\n\nThe informed value in this option will be used by the `thf-toolbar` title, if you don't use this option, the project name will be used.\n\n```\nthf new \u003cprojectName\u003e --title \u003ctitle\u003e\n```\n\n### convert-imports\n\nNew version of THF 4 has a new and easier way to import components. Now all you need is the project name.\n\nFor example this:\n\n```\nimport { ThfPageLogin } from '@totvs/thf-templates/components/thf-page-login';\n```\n\nIs now is changed to:\n\n```\nimport { ThfPageLogin } from '@totvs/thf-templates';\n```\n\nUsing this command in your project Angular or Ionic folder changes those imports automatically.\n\n```\nthf convert-imports\n```\n\n### Add Git remote repository\n\nTo add a remote repository to your new project, run in folder project the command:\n\n```\ngit remote add origin \u003cpath\u003e\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotvs%2Fthf-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotvs%2Fthf-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotvs%2Fthf-cli/lists"}