Skip to content

Configuration

Thomas M. Schöller edited this page Feb 6, 2022 · 11 revisions

Configuration Files

RepoStatusTable is configured via a JSON file. The configuration is merged from two different locations:

  1. Higher priority: A file called rstconfig.json in the current working directory
  2. Lower priority: $XDG_HOME/.config/RepoStatusTable/config.json

Any setting declared in the working directory configuration file will override settings declared in the global configuration file.

A minimal configuration file contains at least one reference to a Git repository:

{
    "Repos": {
        "RepoDirs": [ "/Path/To/A/Repo" ]
}

A complete example file is provided with the release ZIP package or can be found in the repository: exampleconfig.json

Configuration Sections

Repo Options

Declares the repos that RepoStatusTable should process

Properties

  • ReposRoot (string array): List of directories that may contain multiple VCS repositories
  • RepoDirs (string array): List of paths to directories. Each directory must contain a VCS repository
  • OrderBy (string): Order aspect according to which the repos should be sorted in the table
    • Alphabetically: Order repos according to the alphabet
    • LastModified: Order repos depending to when they were last modified
  • Order (string): Order according to which the repos should be sorted in the table. Can be either Ascending or Descending

Example

"Repos": {
    "ReposRoot": [
        "/Path/To/A/Dir/Containing/Repos/1",
        "/Path/To/A/Dir/Containing/Repos/2",
    ],
    "RepoDirs": [ 
        "/Path/To/A/Repo/1",
        "/Path/To/A/Repo/2"
    ]
}

Headline Options

Allows to optionally display a headline above the table

Properties

  • Enable (bool): Declares whether a headline should be displayed.
  • Text (string): Text of the headline
  • SpectreConsoleFiglet (SpectreConsoleFiglet): Alignment and color

Example

"Headline": {
    "Enable": true,
    "Text": "My Projects",
    "Alignment": "Center",
        "Color": {
	    "Notation": "RGB",
	    "Value": "255,0,0"
    }
}

Table Options

Allows to customize the table

Properties

  • RenderMethod (string): Either "Spectre Table Live" or "Spectre Table". The live version will dynamically create the table rows as the data gets available. This does not work in all terminal emulators. Therefore the second method is provided as fallback.
  • SpectreConsoleTable (SpectreConsoleTable): Alignment, borders, expansion and color

Example

"Table": {
    "RenderMethod": "Spectre Table Live",
    "SpectreConsoleTable": {
        "Alignment": "Center",
        "Border": "Horizontal",
        "Expand": false,
        "Color": {
            "Notation": "RGB",
            "Value": "255,0,0"
        }
    }
}

CellProviders

A cell provider supplies a column for the table. Each cell represents the information the cell provider collected from a single repository.

General options

Some options are available for all cell providers

Properties

  • Position (int): Determines the position of the resulting column.
  • Enable (boolean): Determines whether the information provided by the cell provider is shown
  • Heading (string): Alternative heading title for the column
    • If you use a terminal font supporting icons, you can use icons here as well
    • Spectre Console Markup is also supported

Directory Name Provider

Shows the directory name as a column in the table

Properties

No additional properties

Example

"CellProviders": {
    "DirectoryNameProvider": {
        "Position": 0,
        "Enable": true
}

Git Branch Provider

Shows to which branch the HEAD of the repository currently points to.

Properties

No additional properties

Example

"CellProviders": {
    "GitBranchProvider": {
        "Position": 0,
        "Enable": true
}

Git Status Provider

Shows the status of the repository as a column in the table.

Properties

No additional properties

Example

"CellProviders": {
    "GitStatusProvider": {
        "Position": 0,
        "Enable": true
}

File Content Provider

Shows the content of a file as a column in the table. I.e. a file must exist in each repository under the same path.

Properties

  • Path (string): Path to the file.
  • NumberOfLines (int): Number of lines that should be read from the file
  • IgnoreMissingFiles (boolean): Leave the cell empty if set to true and no file exists. If set to false and no file exists, an error will be shown.

Example

"FileContentProvider": {
    "Position": 2,
    "Enable": true,
    "Heading": "Version",
    "NumberOfLines": 1,
    "IgnoreMissingFiles": true,
    "Path": "VersionFile.txt"
}

Spectre Console Options

Customization of the headline and table look

Spectre Console Figlet

Properties

  • Alignment (string): "Left"/"Right"/"Center"
  • Color (Color): Color of the headline

Example

"SpectreConsoleFiglet": {
    "Alignment": "Center",
    "Color": {
        "Notation": "RGB",
        "Value": "255,0,0"
    }
}

Spectre Console Table

Properties

  • Alignment (string): "Left"/"Right"/"Center"
  • Expand (boolean): If set to true, the table will fill the complete terminal window width. Otherwise it will be as wide as the content needs it to be.
  • Border (string): See the Spectre Console documentation. E.g. "Horizontal", "Minimal"
  • Color (Color): Color of the headline

Example

"SpectreConsoleTable": {
    "Alignment": "Center",
    "Border": "Horizontal",
    "Expand": true,
    "Color": {
        "Notation": "RGB",
        "Value": "255,0,0"
    }
}

Color

Properties

  • Notation (string): "RGB"/"Hexadecimal"/"Name"
  • Value (string): Depending on the notation.

Example

"Color": {
    "Notation": "RGB",
    "Value": "255,0,0"
}