Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/PROJECT_STRUCTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# SRunner Project Structure

## Overview
SRunner is a C# CLI application to run configured services and stacks, built with Terminal.GUI, .NET 10, and System.CommandLine.

## Project Structure

```
SRunner/
├── .github/ # GitHub configuration and AI instructions
│ └── PROJECT_STRUCTURE.md
├── src/ # Source code directory
│ ├── Core/ # Core business logic (non-UI)
│ │ └── ServiceRunner.cs # Service models and management logic
│ └── Cli/ # Command-line interface (entry point)
│ ├── Program.cs # Entry point with System.CommandLine
│ ├── InteractiveUI.cs # Terminal.GUI interactive interface
│ └── Cli.csproj # CLI project file
├── SRunner.slnx # Solution file
├── .gitignore # Git ignore file
└── README.md # Project documentation
```

## Key Technologies

- **Framework**: .NET 10
- **UI Library**: Terminal.Gui 1.19.0
- **CLI Framework**: System.CommandLine 2.0.0-beta4.22272.1 (Note: Using stable beta4 version as it has better compatibility with the current .NET version)
- **Language**: C# with nullable reference types enabled

## Architecture

### Core Project (`src/Core/`)
- **Purpose**: Contains business logic and models independent of the user interface
- **Components**:
- `ServiceRunner.cs`: Contains both ServiceConfig data model and ServiceRunner management logic
- **Target Framework**: net10.0
- **Type**: Class Library

### Cli Project (`src/Cli/`)
- **Purpose**: Entry point and user interface implementation
- **Components**:
- `Program.cs`: Main entry point using System.CommandLine for argument parsing
- `InteractiveUI.cs`: Terminal.GUI-based interactive interface
- **Target Framework**: net10.0
- **Type**: Console Application
- **Dependencies**:
- Core project reference
- Terminal.Gui package
- System.CommandLine package

## Usage

### Build the Project
```bash
dotnet build
```

### Run the CLI
```bash
# Non-interactive mode
dotnet run --project src/Cli

# Interactive mode with Terminal.GUI
dotnet run --project src/Cli -- --interactive
# or
dotnet run --project src/Cli -- -i
```

## Development Guidelines

### Adding New Features

1. **Core Logic**: Add new business logic to `src/Core/`
- Keep UI-independent
- Follow existing patterns
- Add models and services as needed

2. **UI Features**: Add new UI features to `src/Cli/`
- UI code goes in `InteractiveUI.cs` or new UI classes
- CLI argument handling goes in `Program.cs`

3. **Dependencies**:
- Keep Core project minimal with no UI dependencies
- UI packages only in Cli project

### Code Style
- Use nullable reference types
- Follow C# naming conventions
- Keep methods focused and single-purpose
- Add XML documentation comments for public APIs

### Project References
- Cli project references Core project
- Core project has no dependencies on Cli

## Command-Line Options

- `--interactive` or `-i`: Launch the Terminal.GUI interactive interface
- Without flags: Shows basic help information

## Interactive Interface Features

The Terminal.GUI interface provides:
- Service list view
- Add new services with dialog
- Remove services with confirmation
- View service details
- Menu bar with File and Help options
- Keyboard shortcuts for all actions

## Future Enhancements

Potential areas for expansion:
- Actual service execution (start/stop processes)
- Service status monitoring
- Configuration file persistence (JSON/YAML)
- Logging and diagnostics
- Service dependency management
- Multi-stack support
- Environment variable management
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio cache/options directory
.vs/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NuGet
*.nupkg
**/packages/*
!**/packages/build/

# Build folders
**/bin/
**/obj/

# Rider
.idea/
*.sln.iml

# User-specific files
*.rsuser

# Mono Auto Generated Files
mono_crash.*

# Windows thumbnail cache
Thumbs.db

# macOS
.DS_Store

# VS Code
.vscode/
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# SRunner
CLI application to run configured services and stacks

## Overview

SRunner is a C# CLI application built with .NET 10, Terminal.GUI, and System.CommandLine. It provides both a command-line interface and an interactive Terminal UI for managing and running configured services and stacks.

## Features

- **Interactive Terminal UI**: Launch a full-featured Terminal.GUI interface with `--interactive` flag
- **Service Management**: Add, remove, and view configured services
- **Modern Architecture**: Clean separation between Core business logic and CLI interface
- **.NET 10**: Built on the latest .NET framework

## Project Structure

```
SRunner/
├── src/
│ ├── Core/ # Business logic (non-UI)
│ │ └── ServiceRunner.cs
│ └── Cli/ # CLI and UI
│ ├── Program.cs
│ └── InteractiveUI.cs
├── .github/
│ └── PROJECT_STRUCTURE.md # Detailed project documentation
└── SRunner.slnx
```

## Building

```bash
dotnet build
```

## Usage

### Non-Interactive Mode

```bash
dotnet run --project src/Cli
```

This displays basic information about the CLI.

### Interactive Mode

```bash
dotnet run --project src/Cli -- --interactive
# or
dotnet run --project src/Cli -- -i
```

This launches the Terminal.GUI interactive interface where you can:
- View configured services
- Add new services
- Remove existing services
- View service details
- Navigate using keyboard shortcuts

### Help

```bash
dotnet run --project src/Cli -- --help
```

## Technologies

- **.NET 10.0**: Latest .NET framework
- **Terminal.Gui 1.19.0**: Cross-platform Terminal UI toolkit
- **System.CommandLine 2.0.0-beta4**: Command-line parsing
- **C# 13**: With nullable reference types enabled

## Development

See [.github/PROJECT_STRUCTURE.md](.github/PROJECT_STRUCTURE.md) for detailed development guidelines and architecture documentation.

## License

See [LICENSE](LICENSE) file for details.

6 changes: 6 additions & 0 deletions SRunner.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/Cli/Cli.csproj" />
<Project Path="src/Core/Core.csproj" />
</Folder>
</Solution>
19 changes: 19 additions & 0 deletions src/Cli/Cli.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Terminal.Gui" Version="1.19.0" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading