TuskLang.SDK
1.0.0
dotnet add package TuskLang.SDK --version 1.0.0
NuGet\Install-Package TuskLang.SDK -Version 1.0.0
<PackageReference Include="TuskLang.SDK" Version="1.0.0" />
<PackageVersion Include="TuskLang.SDK" Version="1.0.0" />
<PackageReference Include="TuskLang.SDK" />
paket add TuskLang.SDK --version 1.0.0
#r "nuget: TuskLang.SDK, 1.0.0"
#:package TuskLang.SDK@1.0.0
#addin nuget:?package=TuskLang.SDK&version=1.0.0
#tool nuget:?package=TuskLang.SDK&version=1.0.0
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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - 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
- Documentation: docs.tusklang.dev
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Discord: TuskLang Community
๐ 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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
- System.CodeDom (>= 8.0.0)
- System.CommandLine (>= 2.0.0-beta4.22272.1)
- System.Text.Json (>= 8.0.5)
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 |