{"id":41261202,"url":"https://github.com/bearcove/styx","last_synced_at":"2026-06-10T22:00:28.069Z","repository":{"id":331883210,"uuid":"1132154990","full_name":"bearcove/styx","owner":"bearcove","description":"STYX: at least it's not YAML","archived":false,"fork":false,"pushed_at":"2026-06-10T17:38:36.000Z","size":86028,"stargazers_count":57,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-10T19:11:28.021Z","etag":null,"topics":["configuration","document","language","markup","not-yaml"],"latest_commit_sha":null,"homepage":"https://styx.bearcove.eu/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bearcove.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2026-01-11T12:42:53.000Z","updated_at":"2026-06-08T11:35:07.000Z","dependencies_parsed_at":"2026-01-30T18:04:41.979Z","dependency_job_id":null,"html_url":"https://github.com/bearcove/styx","commit_stats":null,"previous_names":["bearcove/styx"],"tags_count":107,"template":false,"template_full_name":null,"purl":"pkg:github/bearcove/styx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fstyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fstyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fstyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fstyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearcove","download_url":"https://codeload.github.com/bearcove/styx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fstyx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34172196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["configuration","document","language","markup","not-yaml"],"created_at":"2026-01-23T01:59:49.356Z","updated_at":"2026-06-10T22:00:28.004Z","avatar_url":"https://github.com/bearcove.png","language":"Rust","funding_links":["https://github.com/sponsors/fasterthanlime","https://patreon.com/fasterthanlime"],"categories":["🌐 Languages"],"sub_categories":[],"readme":"# facet-styx\n\n[![crates.io](https://img.shields.io/crates/v/facet-styx.svg)](https://crates.io/crates/facet-styx)\n[![documentation](https://docs.rs/facet-styx/badge.svg)](https://docs.rs/facet-styx)\n[![MIT/Apache-2.0 licensed](https://img.shields.io/crates/l/facet-styx.svg)](./LICENSE)\n\n# Styx\n\nAt least it's not YAML!\n\n## Styx the straightforward\n\nImagine JSON\n\n```json\n{\n  \"key\": \"value\"\n}\n```\n\nBut you remove everything that's getting in the way: the double quotes,\nthe colon, even the comma:\n\n```styx\n{\n  key value\n}\n```\n\nOf course you can have the comma back if you want to put everything in a single line:\n\n```styx\n{key value, koi tuvalu}\n```\n\nNot far enough? Wanna get rid of the brackets? Okay, but only for the top-level object:\n\n```styx\nkey value\nkoi tuvalu\n```\n\nWhat about arrays? They're called sequences and they use parentheses:\n\n```styx\nmethods (GET POST PUT)\n```\n\nThey're always whitespace-separated, never comma-separated.\n\n## Styx the typed\n\n```styx\nname \"John Doe\"\nage 97\nretired true\n```\n\nHey, which type are those values? Any type you want them to.\n\nScalars are just text atoms, `97` is not any more a number\nthan `https://example.org/` is.\n\nTypes matter at exactly two times:\n\n- Validation via [schemas](https://styx.bearcove.eu/reference/spec/schema/) (which are also Styx documents)\n- Deserialization, in either flavor (dynamic or static typing)\n\nIn dynamic typing flavor, your Styx document gets parsed into a tree,\nand then you get to request \"field name as type string\" — and if it can't\nbe coerced into a string, you get an error at that point.\n\nIn static typing flavor, you may for example deserialize to:\n\n```rust\n#[derive(Facet)]\nstruct Does {\n    name: String,\n    age: number,\n    retired: bool,\n}\n```\n\nAnd then the type mapping is, well, what you'd expect.\n\nThis solves the Norway problem:\n\n```styx\ncountry no\n```\n\nThis `no` is not a boolean, not a string, not a number, it's everything, everywhere,\nall at once, until you _need_ it to be something.\n\n## Styx the nerd\n\nSometimes a value isn't quite enough, and you want to tag it:\n\n```styx\nthis (is an untagged list)\nthat @special(list I hold dear)\n```\n\nRemember `()` are for sequences. They're not for grouping/precedence/calls.\n\nYou can tag objects, too:\n\n```styx\nrule @path_prefix{\n  prefix /api\n  route_to localhost:9000 // still no need to double-quote anything\n  // oh yeah also comments just work\n}\n```\n\nThat's because Styx was designed to play nice with sum types,\nlike Rust enums:\n\n```rust\nenum Alternatives {\n    NoPayload,\n    TuplePayload(u32, u32),\n    StructPayload { name: String },\n}\n```\n\nAnd so, tags are a natural way to _select_ a variant:\n\n```styx\nalts (\n    @no_payload@\n    @tuple_payload(3 7)\n    @struct_payload{name Gisèle}\n)\n```\n\nDid you notice the `@` at the end of `@no_payload@`? Not a typo:\nthat's the unit value. It means \"nothing\", \"none\", kinda like \"null\"\nbut a little superior.\n\n`@` is a value like any other:\n\n```styx\nsparse_seq (1 2 @ 8 9)\n```\n\nAnd in fact, wanna know a secret? `@` is not even the canonical form\nof unit: `@@` is.\n\nAn empty tag degenerates to `@`, and a tag without a paylod defaults to\na payload of `@`.\n\nTherefore:\n\n```styx\n@            // tag=@,   payload=@ (implied)\n@@           // tag=@,   payload=@\n@tag         // tag=tag, payload=@ (implied)\n@tag@        // tag=tag, payload=@\n@tag\"must\"   // tag=tag, payload=must\n@tag()       // tag=tag, payload=() aka empty sequence\n```\n\nImportantly, there is NEVER ANY SPACE between a tag and its payload.\nSpaces separate seq elements or key-value pairs in object context:\n\n```styx\n// this is a key-value pair:\n@tag ()     // key(tag=tag, payload=@) value(tag=@, payload=())\n\n// this is a DIFFERENT key-value pair\n@tag()      // key(tag=tag, payload=()) value(tag=@, payload=@)\n```\n\nIs it confusing? Maybe. Little bit.\n\n## Styx the objective\n\nWe've just seen this in the last gotcha:\n\n```styx\n@tag()      // key(tag=tag, payload=()) value(tag=@, payload=@)\n```\n\nWhich, okay, `@tag()` is the entire key. But where's the value?\n\nIt's omitted. It defaults to `@`:\n\n```styx\nkey @ // explicitly set to unit\nkoi   // implicitly set to unit\n```\n\nSo, key-value pairs can be missing a value. And dotted keys create nested structure:\n\n```styx\nserver.host localhost\n// equivalent to\nserver {host localhost}\n```\n\nAnd object attribute syntax provides a compact way to build objects:\n\n```styx\n{\n    web domain\u003eexample.org      port\u003e9000\n    api domain\u003eapi.example.org  port\u003e9001\n}\n```\n\nAnd that's /it/ with the weirdness. (Don't worry, there are comprehensive\nspecifications and test suites).\n\nSome unfamiliar bits, but hopefully not too many, which lets us...\n\n## Styx the schematic\n\n...define Styx schemas in Styx itself.\n\n```styx\nschema {\n  /// The root structure of a schema file.\n  @ @object{\n    /// Schema metadata (required).\n    meta @Meta\n    /// External schema imports (optional).\n    imports @optional(@map(@string @string))\n    /// Type definitions: @ for document root, strings for named types.\n    schema @map(@union(@string @unit) @Schema)\n  }\n  \n  // etc.\n}\n```\n\nAre those doc comments? Yes. Parsers are taught to keep them and attach them to\nthe next element. This means your styx documents can be validated against a\nschema:\n\n  * by a CLI, locally, in CI\n  * by an LSP, in your code editor\n  * honestly anytime for any reason\n\nAnd that your code editor (mine's [Zed](https://zed.dev)) can have the full\ncode editing experience: autocomplete, documentation on hover, jump to definition\n(in schema), hover for field documentation, etc.\n\nIt's... so nice.\n\n## Styx the one last thing\n\nOh! Also, HEREDOCs:\n\n```styx\nexamples (\n    {\n        name hello.rs\n        source \u003c\u003cSRC,rust\n        fn main() {\n          println!(\"Hello from Rust!\")\n        }\n        SRC\n    }\n)\n```\n\nThe `,rust` is just a hint which is used by your editor to inject syntax\nhighlighting from the embedded language :)\n\n## Implementations\n\nThere is a spec for parsing, schema validation, and error reporting,\ntracked with [Tracey](https://github.com/bearcove/tracey) and available\non the [styx website](https://styx.bearcove.eu).\n\nThe flagship implementation is, of course, the Rust one — across multiple\ncrates like `facet-styx` and `serde_styx`, but not just.\n\nThere's a TypeScript implementation in the repository, and probably more\nto come.\n\n## Editor Support\n\n\u003cp\u003e\n\u003ca href=\"https://zed.dev\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./static/sponsors/zed-dark.svg\"\u003e\n\u003cimg src=\"./static/sponsors/zed-light.svg\" height=\"40\" alt=\"Zed\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\nStyx has first-class support for [Zed](https://zed.dev) with syntax highlighting, LSP integration, and more.\n\n## Documentation\n\nSee [styx.bearcove.eu](https://styx.bearcove.eu) for full documentation.\n\n## Sponsors\n\nThanks to all individual sponsors:\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/sponsors/fasterthanlime\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./static/sponsors/github-dark.svg\"\u003e\n\u003cimg src=\"./static/sponsors/github-light.svg\" height=\"40\" alt=\"GitHub Sponsors\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003ca href=\"https://patreon.com/fasterthanlime\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./static/sponsors/patreon-dark.svg\"\u003e\n\u003cimg src=\"./static/sponsors/patreon-light.svg\" height=\"40\" alt=\"Patreon\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n...along with corporate sponsors:\n\n\u003cp\u003e\n\u003ca href=\"https://zed.dev\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./static/sponsors/zed-dark.svg\"\u003e\n\u003cimg src=\"./static/sponsors/zed-light.svg\" height=\"40\" alt=\"Zed\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003ca href=\"https://depot.dev?utm_source=styx\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./static/sponsors/depot-dark.svg\"\u003e\n\u003cimg src=\"./static/sponsors/depot-light.svg\" height=\"40\" alt=\"Depot\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\nCI runs on [Depot](https://depot.dev/) runners.\n\n## License\n\nMIT OR Apache-2.0\n\n## Sponsors\n\nThanks to all individual sponsors:\n\n\u003cp\u003e \u003ca href=\"https://github.com/sponsors/fasterthanlime\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/github-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/github-light.svg\" height=\"40\" alt=\"GitHub Sponsors\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003ca href=\"https://patreon.com/fasterthanlime\"\u003e\n    \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/patreon-dark.svg\"\u003e\n    \u003cimg src=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/patreon-light.svg\" height=\"40\" alt=\"Patreon\"\u003e\n    \u003c/picture\u003e\n\u003c/a\u003e \u003c/p\u003e\n\n...along with corporate sponsors:\n\n\u003cp\u003e \u003ca href=\"https://aws.amazon.com\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/aws-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/aws-light.svg\" height=\"40\" alt=\"AWS\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003ca href=\"https://zed.dev\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/zed-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/zed-light.svg\" height=\"40\" alt=\"Zed\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003ca href=\"https://depot.dev?utm_source=facet\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/depot-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/bearcove/styx/raw/main/static/sponsors-v3/depot-light.svg\" height=\"40\" alt=\"Depot\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003c/p\u003e\n\n...without whom this work could not exist.\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/bearcove/styx/blob/main/LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](https://github.com/bearcove/styx/blob/main/LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Fstyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearcove%2Fstyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Fstyx/lists"}