dtr-cli
v1.2.6
Published
DTR is an open source developer helping CLI tool build on typescript
Downloads
15
Readme
DTR CLI tool
Introduction
DTR-CLI is a command-line interface tool designed to help manage and interact with code files in your directory. It includes various commands to initialize configurations, add code files, create new code files, read existing files, delete files, and manage boilerplate templates.
Installation
DTR-CLI already published on npm
npm install -g dtr-cliFor Linux and Mac user
Install package from npm:
sudo npm install -g dtr-cliFind
dtr-cliglobal location:which dtr # it will return like `/usr/local/bin/dtr` cd /usr/local/binShow
dtr-cliall files:ls -laIt will return something like this:
lrwxrwxrwx 1 root root 42 Jul 17 23:09 dtr -> ../lib/node_modules/dtr-cli/build/index.jsGo to this
node_modulesfolder:cd ../lib/node_modules/Add read write permission:
sudo chmod 775 -R dtr-cli/
Now you are ready to use dtr-cli by dtr command
Usage
After installation, you can use the dtr command followed by the specific subcommand.
dtr <command> [argument] [flags]Commands
Init command
Initialize the dtr-config.json configuration file.
dtr initFlags
-c, --code <codeFolder>: Path for the code file directory. This isoptional. This isoptional.
Add command
Add a code file to your directory.
dtr addArguments
[codeName]: Name of the code file you want to add. This isoptional. This isoptional.
Create command
Create a new code file.
dtr createArgument
[codeName]: Name of the code file. This isoptional.
Flags
-f, --from <codeFrom>: Source of the code file. Accepts'local'|'internet'. This isoptional.-u, --url <internetURL>: GitHub code URL if you select 'codeFrom' as 'internet'. This isoptional.-p, --path <localPath>: Current directory file path if you select 'codeFrom' as 'local'. This isoptional.
Read command
Read all code files.
dtr readArgument
[codeName]: Name of the code file. This isoptional.
Delete command
Delete a global code file.
dtr deleteCreate template command
Create a new boilerplate template.
dtr create-templateArgument
[templateName]: Name of the template. This isoptional.
Options
-s, --source <source>: Source folder of the template. This isoptional.
Template command
Add a boilerplate template in the current directory.
dtr templateArgument
[templateName]: Name of the template. This isoptional.
Configuration
The dtr-config.json file will be initialized by init command. This file stores the configuration settings of current working directory.
Example dtr-config.json:
{
"codeFolder": "code", // code folder name
"addedCode": [
{
"fileName": "",
"path": ""
}
// all code files
]
}Global configuration
The configData.json file will be initialized in the global root directory. This file stores the configuration settings for the CLI tool.
Example configData.json:
{
"allFiles": [
{
"fileName": "",
"path": ""
}
// all code files
],
"allTemplates": [
{
"templateName": "",
"templateFolder": ""
}
// all templates
]
}Install for development
Clone the repository:
git clone https://github.com/saiful7778/dtr-cli.git cd dtr-cliInstall dependencies:
npm install # or yarn install # or pnpm install # or bun install
Note: Here I use
bunyou can any of them
Build the package:
npm run build # or yarn run build # or pnpm run build # or bun run build
