Cherri – 一种直接编译到 Apple Shortcut 的编程语言。
Cherri – programming language that compiles to an Apple Shortuct

原始链接: https://github.com/electrikmilk/cherri

Cherri 是一种新的编程语言,专为构建和维护 macOS 上的大型、复杂的“快捷指令”而设计。与直接在“快捷指令”应用内构建不同,Cherri 允许使用 CLI、VSCode 扩展或专用 macOS 应用进行桌面开发。 它旨在与“快捷指令”动作实现 1:1 映射,以便于调试,并具有包管理器(使用 Git 仓库)、类型检查、函数以及包含文件的功能。Cherri 优先创建优化后的“快捷指令”,以最大限度地减少尺寸和内存使用。 主要功能包括导入现有“快捷指令”、定义自定义动作和嵌入文件。它还处理通过 macOS 或备用服务器对“快捷指令”进行签名。安装方式包括 Homebrew、Nix 或直接下载。该项目的创建者强调了在“快捷指令”语言领域持续发展的必要性,并以此为基础,延续之前经常被废弃的努力。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Cherri – 一种直接编译到 Apple Shortcut 的编程语言 (github.com/electrikmilk) 26 分,由 mihau 1 小时前发布 | 隐藏 | 过去 | 收藏 | 2 条评论 帮助 threecheese 36 分钟前 | 下一个 [–] 我想了解它与 Jelly 的不同之处;它们似乎很相似。同样适用于 Scriptable。我一直在研究这个,想让 Claude 来构建 Shortcuts,而 Shortcuts 的开发体验非常糟糕。回复 aaronbrethorst 12 分钟前 | 上一个 [–] 顺便问一下,有人知道创建 GitHub Actions YML 文件是否有类似 Terraform 的语法吗?回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文
Cherri Icon

Build & Test Releases Go License Platform GoDoc Go Report Card

Cherri (pronounced cherry) is a Shortcuts programming language that compiles directly to a valid runnable Shortcut.

The primary goal is to make it practical to create large Shortcut projects (within the limitations of Shortcuts) and maintain them long term.

Hello World Example

  • 🖥️ Laptop/Desktop-based development (CLI, VSCode extension, macOS app)
  • 🎓 Easy to learn and syntax similar to other languages
  • 🐞 1-1 translation to Shortcut actions as much as possible to make debugging easier
  • 🥾 Half-bootstrapped: Most actions and types are written in the language
  • 💻 Import actions on your Mac
  • 📦 Package manager: Remote Git repo-based package manager built in, allowing for automatic inclusion and updates.
  • 🪄 No magic variables syntax, they're constants instead
  • 🪶 Optimized to create as small as possible Shortcuts and reduce memory usage at runtime
  • #️⃣ Include files within others for large Shortcut projects
  • 🔧 Define actions with type checking, enums, optionals, default values, raw identifiers, and raw keys.
  • 🔄 Define functions to run within their own scope at the top of your Shortcut to reduce duplicate actions.
  • 📋 Copy-paste actions automatically
  • 🥩 Enter action identifier and parameters manually using Raw Actions.
  • ❓ Define import questions
  • 📇 Generate VCards for menus
  • 📄 Embed files in base64
  • 🔀 Convert Shortcuts from an iCloud link with the --import= option
  • 🔢 Type system and type inference
  • 🔏 Signs using macOS, falls back on HubSign or another server that uses scaxyz/shortcut-signing-server.

You can install Cherri by downloading the latest release or via the Homebrew or Nix package managers:

If you have Homebrew installed, you can run:

Add Tap:

brew tap electrikmilk/cherri

Install:

brew install electrikmilk/cherri/cherri

If you have Nix installed, you can run:

nix profile install github:electrikmilk/cherri

Alternatively, you can use nix-direnv to get an isolated, effortless dev environment where cherri is available based on which directory you're in. Then you would use_flake and add Cherri to flake.nix:

{
  inputs.cherri.url = "github:electrikmilk/cherri";


  { # outputs.packages.${system}.default = pkgs.mkShell etc - omitted for brevity
    buildInputs = [
      inputs.cherri.packages.${system}.cherri
    ]
  }
}

Then run direnv allow in the directory with the flake.nix file.

Run cherri without any arguments to see all options and usage. For development, use the --debug (or -d) option to print stack traces, debug information, and output a .plist file.

Why another Shortcuts language?

Because it's fun :)

Some languages have been abandoned, don't work well, or no longer work. I don't want Shortcuts languages to die. There should be more, not less.

Plus, some stability comes with this project being on macOS and not iOS, and I'm not aware of another Shortcuts language with macOS as its platform other than Buttermilk.


The original Workflow app assigned a code name to each release. Cherri is named after the second-to-last update "Cherries" (also cherry is one of my favorite flavors).

This project started on October 5, 2022.

联系我们 contact @ memedata.com