Skip to content

Deimos CLI is a command-line tool designed to manage and version different configurations for .NET projects. It allows developers to easily save, restore, and switch between various configuration setups, making it ideal for handling multiple development environments or scenarios.

Notifications You must be signed in to change notification settings

leo-bloise/Deimos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deimos CLI

.NET License

Deimos CLI is a command-line tool designed to manage and version different configurations for .NET projects. It allows developers to easily save, restore, and switch between various configuration setups, making it ideal for handling multiple development environments or scenarios.

Features

  • Project Mapping: Automatically discover and map .NET projects in a directory
  • Configuration Management: Save and restore project configurations
  • Template Support: Organize configurations into named templates
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Simple CLI: Intuitive command-line interface

Installation

Prerequisites

Building from Source

  1. Clone the repository:

    git clone https://github.com/yourusername/deimos.git
    cd deimos
  2. Build the project:

    dotnet build Deimos.Cli/Deimos.Cli.csproj
  3. (Optional) Publish for easier distribution:

    dotnet publish Deimos.Cli/Deimos.Cli.csproj -c Release -r <runtime-identifier> --self-contained

    Replace <runtime-identifier> with your target platform (e.g., win-x64, linux-x64, osx-x64).

Usage

After building, you can run the CLI from the output directory or add it to your PATH.

Commands

map <sln-dir>

Maps all available .NET projects in the specified directory.

Arguments:

  • sln-dir: The directory containing the project files (searches recursively for .csproj files)

Example:

deimos map /path/to/your/solution

load-current-configuration <project-name> [--template-name <name>]

Loads and saves the current configuration of a mapped project.

Arguments:

  • project-name: The name of the project (without .csproj extension)

Options:

  • --template-name: Name of the template (default: default)

Supported Configuration Files:

  • appsettings*.json (including environment-specific variants)
  • launchSettings.json
  • App.config

Example:

deimos load-current-configuration MyApi --template-name development

restore-project-configuration <project-name> [--template-name <name>]

Restores a previously saved configuration to a project.

Arguments:

  • project-name: The name of the project

Options:

  • --template-name: Name of the template to restore (default: default)

Example:

deimos restore-project-configuration MyApi --template-name production

delete-configuration <project-name> [--template-name <name>]

Deletes a saved configuration template.

Arguments:

  • project-name: The name of the project

Options:

  • --template-name: Name of the template to delete (default: default)

Example:

deimos delete-configuration MyApi --template-name old-config

Workflow Example

  1. Map your projects:

    deimos map .
  2. Save current configuration:

    deimos load-current-configuration Deimos.Example.Api --template-name local-dev
  3. Modify configuration files (e.g., change database connection strings, API keys, etc.)

  4. Save another configuration:

    deimos load-current-configuration Deimos.Example.Api --template-name staging
  5. Switch between configurations:

    deimos restore-project-configuration Deimos.Example.Api --template-name local-dev
    # or
    deimos restore-project-configuration Deimos.Example.Api --template-name staging

Configuration Storage

Configurations are stored in the user's application data directory:

  • Windows: %APPDATA%\deimos\
  • macOS: ~/Library/Application Support/deimos/
  • Linux: ~/.config/deimos/

The data is stored in JSON format in projects-map.json.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Deimos CLI is a command-line tool designed to manage and version different configurations for .NET projects. It allows developers to easily save, restore, and switch between various configuration setups, making it ideal for handling multiple development environments or scenarios.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages