TuskLang.SDK 1.0.0

dotnet add package TuskLang.SDK --version 1.0.0
                    
NuGet\Install-Package TuskLang.SDK -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TuskLang.SDK" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TuskLang.SDK" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TuskLang.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TuskLang.SDK --version 1.0.0
                    
#r "nuget: TuskLang.SDK, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TuskLang.SDK@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TuskLang.SDK&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TuskLang.SDK&version=1.0.0
                    
Install as a Cake Tool

TuskLang C# SDK

A powerful, high-performance C# SDK for TuskLang configuration management and processing.

๐Ÿš€ Features

  • Advanced Configuration Parsing - Parse and validate TSK configuration files
  • Semantic Analysis - Full AST-based semantic analysis with type checking
  • Database Integration - Connection pooling for SQL Server, PostgreSQL, MySQL, and SQLite
  • Hot Reload - Real-time configuration updates with file watching
  • CLI Tools - Comprehensive command-line interface for all operations
  • AI Assistance - Built-in AI-powered configuration assistance
  • Extensible Architecture - Plugin-based operator system and custom adapters

๐Ÿ“ฆ Installation

NuGet Package

dotnet add package TuskLang.SDK

From Source

git clone https://github.com/tusklang/csharp-sdk.git
cd csharp-sdk
dotnet build
dotnet run -- --help

๐Ÿ› ๏ธ Quick Start

Basic Usage

using TuskLang.Core.Configuration;
using TuskLang.Parser;

// Initialize configuration manager
var configManager = new ConfigurationManager();

// Parse TSK file
var parser = new TuskTskParser();
var result = parser.Parse("config.tsk");

// Access configuration
var value = configManager.GetValue<string>("database.connection");

CLI Usage

# Parse a TSK file
tsk parse config.tsk

# Compile configuration
tsk compile config.tsk

# Validate configuration
tsk validate config.tsk

# Initialize new project
tsk init

# Build project
tsk build

# Run tests
tsk test

# Start development server
tsk serve

# AI assistance
tsk ai "help me optimize this config"

๐Ÿ“š Documentation

Configuration Management

The SDK provides a robust configuration management system with:

  • File Watching - Automatic reload on file changes
  • Caching - High-performance configuration caching
  • Validation - Built-in configuration validation
  • Hot Reload - Real-time updates without restart
var configManager = new ConfigurationManager(new ConfigurationManagerOptions
{
    EnableFileWatching = true,
    CacheExpiration = TimeSpan.FromMinutes(5),
    EnableHotReload = true
});

// Subscribe to configuration changes
configManager.ConfigurationChanged += (sender, e) =>
{
    Console.WriteLine($"Configuration updated: {e.FilePath}");
};

Database Integration

Support for multiple database providers with connection pooling:

using TuskLang.Core.Connection;

// SQL Server
var sqlPool = new SqlServerConnectionPool(connectionString, maxConnections: 10);

// PostgreSQL
var pgPool = new PostgreSqlConnectionPool(connectionString, maxConnections: 10);

// MySQL
var mysqlPool = new MySqlConnectionPool(connectionString, maxConnections: 10);

// SQLite
var sqlitePool = new SqliteConnectionPool(connectionString, maxConnections: 5);

Parser and AST

Advanced parsing capabilities with full AST support:

using TuskLang.Parser;
using TuskLang.Parser.Ast;

var parser = new TuskTskParser();
var ast = parser.Parse("config.tsk");

// Semantic analysis
var analyzer = new SemanticAnalyzer();
var result = analyzer.Analyze(ast);

// Visit AST nodes
var visitor = new CustomAstVisitor();
ast.Accept(visitor);

๐Ÿ—๏ธ Architecture

Core Components

  • Parser - TSK file parsing and AST generation
  • Semantic Analyzer - Type checking and validation
  • Configuration Manager - Configuration loading and caching
  • Connection Management - Database connection pooling
  • CLI Framework - Command-line interface
  • Operator System - Extensible operator registry

Project Structure

src/
โ”œโ”€โ”€ CLI/                 # Command-line interface
โ”œโ”€โ”€ Core/               # Core functionality
โ”‚   โ”œโ”€โ”€ Configuration/  # Configuration management
โ”‚   โ””โ”€โ”€ Connection/     # Database connections
โ”œโ”€โ”€ Parser/             # TSK parsing and AST
โ”‚   โ”œโ”€โ”€ Ast/           # Abstract Syntax Tree nodes
โ”‚   โ””โ”€โ”€ Semantic/      # Semantic analysis
โ””โ”€โ”€ Tests/             # Unit tests

๐Ÿ”ง Configuration

TSK File Format

TSK files support a rich configuration format:

# Database configuration
database {
    provider = "sqlserver"
    connection = "Server=localhost;Database=mydb;"
    timeout = 30
}

# Application settings
app {
    name = "MyApp"
    version = "1.0.0"
    debug = true
}

# Include other files
include "secrets.tsk"

Environment Variables

export TUSK_CONFIG_PATH="/path/to/config"
export TUSK_LOG_LEVEL="Debug"
export TUSK_ENABLE_CACHE="true"

๐Ÿงช Testing

# Run all tests
dotnet test

# Run specific test suite
dotnet test --filter "Category=Parser"

# Run with coverage
dotnet test --collect:"XPlat Code Coverage"

๐Ÿค Contributing

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

Development Setup

git clone https://github.com/tusklang/csharp-sdk.git
cd csharp-sdk
dotnet restore
dotnet build
dotnet test

๐Ÿ“„ License

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

๐Ÿ†˜ Support

๐Ÿš€ Roadmap

See ROADMAP.md for detailed development plans and upcoming features.

๐Ÿ“Š Performance

  • Parse Speed: 10,000+ lines/second
  • Memory Usage: <50MB for typical configurations
  • Startup Time: <100ms cold start
  • Hot Reload: <10ms configuration updates

Built with โค๏ธ by the TuskLang Team

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 464 7/21/2025