Configuration Guide
NestCLI allows you to customize its behavior through a configuration file. This guide will help you understand and configure NestCLI to suit your workflow.
Configuration File#
NestCLI uses a JSON configuration file to store your preferences. By default, this file is located at ~/.nestcli/config.json.
Default Configuration#
When you first run NestCLI, it generates a default configuration file. Here's an example of what it might look like:
{ "depth": "infinite", "extensions": "all", "lineNumbers": false, "showSize": false, "includeHidden": false, "treeOnly": false, "fileOnly": false, "lineLimit": 200, "syntaxHighlight": false, "keyboardNav": false}Configuration Options#
depth#
- Type:
stringornumber - Default:
"infinite" - Description: Limits the depth of the directory tree displayed. Use
"infinite"for no limit.
extensions#
- Type:
string - Default:
"all" - Description: Filters files by extensions. Use a comma-separated list (e.g.,
"js,ts,md").
lineNumbers#
- Type:
boolean - Default:
false - Description: Enables line numbers in file content display.
showSize#
- Type:
boolean - Default:
false - Description: Displays file sizes in the directory tree.
includeHidden#
- Type:
boolean - Default:
false - Description: Includes hidden files and directories in the display.
treeOnly#
- Type:
boolean - Default:
false - Description: Shows only the directory structure, hiding file contents.
fileOnly#
- Type:
boolean - Default:
false - Description: Shows only file contents, hiding the directory tree.
lineLimit#
- Type:
number - Default:
200 - Description: Sets the number of lines to display per page in file content.
syntaxHighlight#
- Type:
boolean - Default:
false - Description: Enables syntax highlighting for file content.
keyboardNav#
- Type:
boolean - Default:
false - Description: Enables interactive keyboard navigation.
Saving and Resetting Configuration#
You can save your current command-line options as the default configuration using the --save-config flag:
nest_cli --depth 3 --line-numbers --syntax-highlight --save-configTo reset the configuration to its default settings, use the --reset-config flag:
nest_cli --reset-configExample Configuration#
Here's an example of a customized configuration file:
{ "depth": 3, "extensions": "js,ts", "lineNumbers": true, "showSize": true, "includeHidden": true, "treeOnly": false, "fileOnly": false, "lineLimit": 100, "syntaxHighlight": true, "keyboardNav": true}