{"id":48779063,"url":"https://github.com/devlooped/spectre.yaml","last_synced_at":"2026-04-16T17:01:12.381Z","repository":{"id":350531282,"uuid":"1206437622","full_name":"devlooped/Spectre.Yaml","owner":"devlooped","description":"Display YAML in Spectre.Console","archived":false,"fork":false,"pushed_at":"2026-04-14T00:23:17.000Z","size":227,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T15:30:03.749Z","etag":null,"topics":["dotnet","spectre-console","yaml"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlooped.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"devlooped"}},"created_at":"2026-04-09T23:14:22.000Z","updated_at":"2026-04-13T23:17:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devlooped/Spectre.Yaml","commit_stats":null,"previous_names":["devlooped/spectre.yaml"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/devlooped/Spectre.Yaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2FSpectre.Yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2FSpectre.Yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2FSpectre.Yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2FSpectre.Yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlooped","download_url":"https://codeload.github.com/devlooped/Spectre.Yaml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2FSpectre.Yaml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31848664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","spectre-console","yaml"],"created_at":"2026-04-13T13:33:44.836Z","updated_at":"2026-04-16T17:01:12.327Z","avatar_url":"https://github.com/devlooped.png","language":"C#","funding_links":["https://github.com/sponsors/devlooped","https://github.com/sponsors"],"categories":[],"sub_categories":[],"readme":"# Spectre.Yaml\n\n[![Version](https://img.shields.io/nuget/vpre/Devlooped.Spectre.Yaml.svg?color=royalblue)](https://www.nuget.org/packages/Devlooped.Spectre.Yaml)\n[![Downloads](https://img.shields.io/nuget/dt/Devlooped.Spectre.Yaml.svg?color=darkmagenta)](https://www.nuget.org/packages/Devlooped.Spectre.Yaml)\n[![EULA](https://img.shields.io/badge/EULA-OSMF-blue?labelColor=black\u0026color=C9FF30)](https://github.com/devlooped/oss/blob/main/osmfeula.txt)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/devlooped/oss/blob/main/license.txt)\n\n\u003c!-- include https://github.com/devlooped/.github/raw/main/osmf.md --\u003e\n## Open Source Maintenance Fee\n\nTo ensure the long-term sustainability of this project, users of this package who generate \nrevenue must pay an [Open Source Maintenance Fee](https://opensourcemaintenancefee.org). \nWhile the source code is freely available under the terms of the [License](license.txt), \nthis package and other aspects of the project require [adherence to the Maintenance Fee](osmfeula.txt).\n\nTo pay the Maintenance Fee, [become a Sponsor](https://github.com/sponsors/devlooped) at the proper \nOSMF tier. A single fee covers all of [Devlooped packages](https://www.nuget.org/profiles/Devlooped).\n\n\u003c!-- https://github.com/devlooped/.github/raw/main/osmf.md --\u003e\n\u003c!-- #content --\u003e\n## Overview\n\n**Devlooped.Spectre.Yaml** adds a `YamlText` renderable to [Spectre.Console](https://spectreconsole.net/) \nthat displays YAML with syntax-highlighted tokens (keys, strings, numbers, booleans, nulls, and \ncomments). It also accepts JSON and arbitrary .NET objects, automatically converting them to YAML \nbefore rendering.\n\n![](https://raw.githubusercontent.com/devlooped/Spectre.Yaml/main/assets/img/order.png)\n\n## Usage\n\n### From a YAML string\n\n```csharp\nusing Spectre.Console;\n\nAnsiConsole.Write(new YamlText(\"\"\"\n    server:\n      host: localhost\n      port: 8080\n      tls: true\n    \"\"\"));\n```\n\n### From a .NET object\n\n```csharp\nusing Spectre.Console;\n\nvar config = new\n{\n    Server = new { Host = \"localhost\", Port = 8080, Tls = true },\n    Retries = 3,\n    Tags = new[] { \"web\", \"api\" },\n};\n\nAnsiConsole.Write(new YamlText(config));\n```\n\n`System.Text.Json.JsonSerializer` serializes the object; the resulting JSON is then converted \nto YAML. `JsonNode` and `JsonElement` overloads are also available.\n\n### Inside a Panel\n\n```csharp\nusing Spectre.Console;\n\nAnsiConsole.Write(\n    new Panel(new YamlText(myObject))\n        .Header(\"Configuration\")\n        .BorderColor(Color.Yellow)\n        .Padding(1, 1));\n```\n\n## Customizing colors\n\nEach token type has a configurable `Style`. Use the fluent extension methods for the most \nconcise syntax:\n\n```csharp\nvar text = new YamlText(yaml)\n    .KeyColor(Color.Yellow)\n    .StringColor(Color.Cyan1)\n    .NumberColor(Color.Blue)\n    .BooleanColor(Color.Green)\n    .NullColor(Color.Grey)\n    .CommentColor(Color.DarkSlateGray1);\n\nAnsiConsole.Write(text);\n```\n\nOr assign `Style` objects directly when you need full control (foreground, background, \ndecorations):\n\n```csharp\nvar text = new YamlText(yaml)\n{\n    KeyStyle    = new Style(Color.Yellow, decoration: Decoration.Bold),\n    StringStyle = new Style(Color.Cyan1),\n};\n```\n\n### Default colors\n\n| Token    | Default             |\n|----------|---------------------|\n| Key      | `Color.Grey`        |\n| String   | `Color.Red`         |\n| Number   | `Color.Blue`        |\n| Boolean  | `Color.Green`       |\n| Null     | `Color.Grey`        |\n| Comment  | `Color.Grey` + Dim  |\n\n\u003c!-- #content --\u003e\n---\n\u003c!-- include https://github.com/devlooped/sponsors/raw/main/footer.md --\u003e\n# Sponsors \n\n\u003c!-- sponsors.md --\u003e\n[![Clarius Org](https://avatars.githubusercontent.com/u/71888636?v=4\u0026s=39 \"Clarius Org\")](https://github.com/clarius)\n[![MFB Technologies, Inc.](https://avatars.githubusercontent.com/u/87181630?v=4\u0026s=39 \"MFB Technologies, Inc.\")](https://github.com/MFB-Technologies-Inc)\n[![Khamza Davletov](https://avatars.githubusercontent.com/u/13615108?u=11b0038e255cdf9d1940fbb9ae9d1d57115697ab\u0026v=4\u0026s=39 \"Khamza Davletov\")](https://github.com/khamza85)\n[![SandRock](https://avatars.githubusercontent.com/u/321868?u=99e50a714276c43ae820632f1da88cb71632ec97\u0026v=4\u0026s=39 \"SandRock\")](https://github.com/sandrock)\n[![DRIVE.NET, Inc.](https://avatars.githubusercontent.com/u/15047123?v=4\u0026s=39 \"DRIVE.NET, Inc.\")](https://github.com/drivenet)\n[![Keith Pickford](https://avatars.githubusercontent.com/u/16598898?u=64416b80caf7092a885f60bb31612270bffc9598\u0026v=4\u0026s=39 \"Keith Pickford\")](https://github.com/Keflon)\n[![Thomas Bolon](https://avatars.githubusercontent.com/u/127185?u=7f50babfc888675e37feb80851a4e9708f573386\u0026v=4\u0026s=39 \"Thomas Bolon\")](https://github.com/tbolon)\n[![Kori Francis](https://avatars.githubusercontent.com/u/67574?u=3991fb983e1c399edf39aebc00a9f9cd425703bd\u0026v=4\u0026s=39 \"Kori Francis\")](https://github.com/kfrancis)\n[![Reuben Swartz](https://avatars.githubusercontent.com/u/724704?u=2076fe336f9f6ad678009f1595cbea434b0c5a41\u0026v=4\u0026s=39 \"Reuben Swartz\")](https://github.com/rbnswartz)\n[![Jacob Foshee](https://avatars.githubusercontent.com/u/480334?v=4\u0026s=39 \"Jacob Foshee\")](https://github.com/jfoshee)\n[![](https://avatars.githubusercontent.com/u/33566379?u=bf62e2b46435a267fa246a64537870fd2449410f\u0026v=4\u0026s=39 \"\")](https://github.com/Mrxx99)\n[![Eric Johnson](https://avatars.githubusercontent.com/u/26369281?u=41b560c2bc493149b32d384b960e0948c78767ab\u0026v=4\u0026s=39 \"Eric Johnson\")](https://github.com/eajhnsn1)\n[![Jonathan ](https://avatars.githubusercontent.com/u/5510103?u=98dcfbef3f32de629d30f1f418a095bf09e14891\u0026v=4\u0026s=39 \"Jonathan \")](https://github.com/Jonathan-Hickey)\n[![Ken Bonny](https://avatars.githubusercontent.com/u/6417376?u=569af445b6f387917029ffb5129e9cf9f6f68421\u0026v=4\u0026s=39 \"Ken Bonny\")](https://github.com/KenBonny)\n[![Simon Cropp](https://avatars.githubusercontent.com/u/122666?v=4\u0026s=39 \"Simon Cropp\")](https://github.com/SimonCropp)\n[![agileworks-eu](https://avatars.githubusercontent.com/u/5989304?v=4\u0026s=39 \"agileworks-eu\")](https://github.com/agileworks-eu)\n[![Zheyu Shen](https://avatars.githubusercontent.com/u/4067473?v=4\u0026s=39 \"Zheyu Shen\")](https://github.com/arsdragonfly)\n[![Vezel](https://avatars.githubusercontent.com/u/87844133?v=4\u0026s=39 \"Vezel\")](https://github.com/vezel-dev)\n[![ChilliCream](https://avatars.githubusercontent.com/u/16239022?v=4\u0026s=39 \"ChilliCream\")](https://github.com/ChilliCream)\n[![4OTC](https://avatars.githubusercontent.com/u/68428092?v=4\u0026s=39 \"4OTC\")](https://github.com/4OTC)\n[![domischell](https://avatars.githubusercontent.com/u/66068846?u=0a5c5e2e7d90f15ea657bc660f175605935c5bea\u0026v=4\u0026s=39 \"domischell\")](https://github.com/DominicSchell)\n[![Adrian Alonso](https://avatars.githubusercontent.com/u/2027083?u=129cf516d99f5cb2fd0f4a0787a069f3446b7522\u0026v=4\u0026s=39 \"Adrian Alonso\")](https://github.com/adalon)\n[![torutek](https://avatars.githubusercontent.com/u/33917059?v=4\u0026s=39 \"torutek\")](https://github.com/torutek)\n[![mccaffers](https://avatars.githubusercontent.com/u/16667079?u=110034edf51097a5ee82cb6a94ae5483568e3469\u0026v=4\u0026s=39 \"mccaffers\")](https://github.com/mccaffers)\n[![Seika Logiciel](https://avatars.githubusercontent.com/u/2564602?v=4\u0026s=39 \"Seika Logiciel\")](https://github.com/SeikaLogiciel)\n[![Andrew Grant](https://avatars.githubusercontent.com/devlooped-user?s=39 \"Andrew Grant\")](https://github.com/wizardness)\n[![Lars](https://avatars.githubusercontent.com/u/1727124?v=4\u0026s=39 \"Lars\")](https://github.com/latonz)\n[![prime167](https://avatars.githubusercontent.com/u/3722845?v=4\u0026s=39 \"prime167\")](https://github.com/prime167)\n\n\n\u003c!-- sponsors.md --\u003e\n[![Sponsor this project](https://avatars.githubusercontent.com/devlooped-sponsor?s=118 \"Sponsor this project\")](https://github.com/sponsors/devlooped)\n\n[Learn more about GitHub Sponsors](https://github.com/sponsors)\n\n\u003c!-- https://github.com/devlooped/sponsors/raw/main/footer.md --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlooped%2Fspectre.yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlooped%2Fspectre.yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlooped%2Fspectre.yaml/lists"}