{"id":21296585,"url":"https://github.com/coordinate-cat/cue_e_g","last_synced_at":"2026-05-19T02:02:55.242Z","repository":{"id":113941877,"uuid":"452945331","full_name":"Coordinate-Cat/cue_e_g","owner":"Coordinate-Cat","description":"A REPOSITORY FOR A COMPLETE UNDERSTANDING OF CUELANG.  IT'S A CONFIGURATION LANGUAGE, UPWARDLY COMPATIBLE WITH JSON AND YAML.","archived":false,"fork":false,"pushed_at":"2022-01-28T08:45:17.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T06:18:14.280Z","etag":null,"topics":["cue","cuelang","json","yaml"],"latest_commit_sha":null,"homepage":"","language":"CUE","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coordinate-Cat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-01-28T05:03:48.000Z","updated_at":"2022-03-20T09:05:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"37eb9f3e-bbed-435c-bf58-f598cd09d238","html_url":"https://github.com/Coordinate-Cat/cue_e_g","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Coordinate-Cat/cue_e_g","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coordinate-Cat%2Fcue_e_g","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coordinate-Cat%2Fcue_e_g/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coordinate-Cat%2Fcue_e_g/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coordinate-Cat%2Fcue_e_g/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coordinate-Cat","download_url":"https://codeload.github.com/Coordinate-Cat/cue_e_g/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coordinate-Cat%2Fcue_e_g/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265711407,"owners_count":23815531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cue","cuelang","json","yaml"],"created_at":"2024-11-21T14:28:09.155Z","updated_at":"2026-05-19T02:02:50.198Z","avatar_url":"https://github.com/Coordinate-Cat.png","language":"CUE","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUE_E_G\n\nチュートリアル\nhttps://cuetorials.com/overview\n\n- ConjunctionsとかDisjunctions上手く使いこなしたい\n- 小さく定義を設定していき「積み上げる」感覚を意識する(building-up)\n  - string, intなど型定義\n    ```\n    // 例\n    #Base: {\n      name: string\n      os: string\n    }\n    ```\n\n  - regex(正規表現)や配列に入る型の設定\n    ```\n    #Meta: {\n      // a~zまでの文字列が入るよ\n      version: =~\"[a-zA-Z_0-9]+\"\n      // 配列には文字列が入るよ\n      labels: [...string]\n    }\n    #Permissions: {\n      role: string\n      // デフォルトfalse\n      public: bool | *false\n    }\n    ```\n\n  - スキーマを作って再利用可能に\n    ```\n    #Schema-1: {\n      #Base\n      #Meta\n\n      #Permissions\n    }\n    #Schema-2: {\n      #Base\n      #Permissions\n    }\n    ```\n\n  - 上記で色々設定したものをまとめて出力\n    ```\n    value: #Schema-1 \u0026 {\n      name:    \"app\"\n      os:    \"mac\"\n      version: \"catalina\"\n      labels: [\"server\", \"prod\"]\n      role: \"backend\"\n      // public: false  (by default)\n    }\n    ```\n- 値の設定とルールの分離を行う\n  ```\n  cue/order/order-1.cue // 値\n  cue/order/order-2.cue // ルール\n  ↓\n  cue/order/order-unification.cue\n  ```\n\n- ショートハンド\n  ```\n  a: {\n    foo: \"bar\"\n  }\n\n  // shorthand nested field\n  a: hello: \"world\"\n  ```\n\n- 接頭辞アンダーバー(_)で非表示\n  ```\n  A: {                               →\n    _hidden: \"a hidden field\"        →\n    isshown: \"I can be seen\"         →\n    hidrefd: _hidden + \" sort of?\"   →\n  }                                  →\n\n  _#NoshowDefn: {                    →\n    hello: string                    →\n    num:   int | *42                 →\n  }                                  →\n\n  B: _#NoshowDefn \u0026 {hello: \"world\"} →\n  ```\n\n## COMMAND\nこのレポジトリでよく使ったコマンド\n```\n# 結果を表示\n## json\ncue export cue/Foundations.cue --out json\n## yaml\ncue export cue/Foundations.cue --out yaml\n\n# output(アウトプットコマンドがないのでシェルで出力)\ncue export cue/Foundations.cue \u003e json/Foundations.json\n\n# 値とルールのファイル分割、統合\ncue export cue/order/order-1.cue cue/order/order-2.cue --out json \u003e cue/order/order-unification.cue\n\n# eval(cueファイルを評価する)\ncue eval cue/Foundations.cue\n```\n\n## BUILTIN TYPES\nビルトインで用意されている型\n```\nN:   null\nB:   bool\nS:   string\nBy:  bytes\nNum: number // Decimals or integers, a superclass if you will\nInt: int    // Big Int which can represent values without limits\nList: [...]\nStruct: {...}\n```\n\n## SUGAR SYNTACTIC\n糖衣構文\n```\nhex:  0xdeadbeef            → hex:  3735928559\noct:  0o755                 → oct:  493\nbin:  0b0101_0001           → bin:  81\ncpu:  0.5Mi                 → cpu:  524288\nmem:  4Gi                   → mem:  4294967296\nmill: 1M                    → mill: 1000000\nbill: 1G                    → bill: 1000000000\nzero: 0.0                   → zero: 0\nhalf: 0.5                   → half: 0.5\ntrim: 01.23                 → trim: 1.23\nmole: 6.022_140_76e+23      → mole: 6.02214076e+23\ntiny: 1.2345e-12            → tiny: 1.2345e-12\nlong: 23_456_789_000_000000 → long: 23456789000000000\n```\n\n## REFERNCE\n\n### CUE\n- cuelnag 公式docs  \nhttps://cuelang.org/docs/\n- cuelangの公式tutorial  \nhttps://cuelang.org/docs/tutorials/tour/intro/\n- cue discuss  \nhttps://github.com/cuelang/cue/discussions\n- cue spec  \nhttps://github.com/cuelang/cue/blob/master/doc/ref/spec.md\n- cuetutorial by the Hofstadter team  \nhttps://cuetorials.com/introduction/  \nhttps://github.com/hofstadter-io/cuetorials.com\n- cue example  \nhttps://github.com/hofstadter-io/cue-examples\n- zenn  \nhttps://zenn.dev/riita10069/articles/plactice_cuelang\n- 公式Package（goでcueを扱うために）  \nhttps://pkg.go.dev/cuelang.org/go/cue\n- CUEを試して見る  \nhttps://future-architect.github.io/articles/20191002/\n- ngkcl/vscode-cuelang(highlight ext)  \nhttps://github.com/ngkcl/vscode-cuelang\n- シェルスクリプトでJSONを扱う  \nhttps://qiita.com/unhurried/items/c62d29540de3e10a50ad\n\n\n### REGEX\n- 基本的な正規表現一覧\nhttps://murashun.jp/article/programming/regular-expression.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoordinate-cat%2Fcue_e_g","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoordinate-cat%2Fcue_e_g","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoordinate-cat%2Fcue_e_g/lists"}