洪 民憙 (Hong Minhee) :nonbinary:'s avatar

洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · 981 following · 1339 followers

An intersectionalist, feminist, and socialist living in Seoul (UTC+09:00). @tokolovesme's spouse. Who's behind @fedify, @hollo, and @botkit. Write some free software in , , , & . They/them.

서울에 사는 交叉女性主義者이자 社會主義者. 金剛兔(@tokolovesme)의 配偶者. @fedify, @hollo, @botkit 메인테이너. , , , 等으로 自由 소프트웨어 만듦.

()

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social

Optique 0.7.0 released!

  • “Did you mean?” typo suggestions
  • Zod & Valibot schema validation
  • Duplicate option detection
  • Context-aware error messages

Type-safe CLI parsing for TypeScript just got friendlier.

https://hackers.pub/@hongminhee/2025/optique-070

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub

We're thrilled to announce Optique 0.7.0, a release focused on developer experience improvements and expanding Optique's ecosystem with validation library integrations.

Optique is a type-safe, combinatorial CLI argument parser for TypeScript. Unlike traditional CLI libraries that rely on configuration objects, Optique lets you compose parsers from small, reusable functions—bringing the same functional composition patterns that make Zod powerful to CLI development. If you're new to Optique, check out Why Optique? to learn how this approach unlocks possibilities that configuration-based libraries simply can't match.

This release introduces automatic “Did you mean?” suggestions for typos, seamless integration with Zod and Valibot validation libraries, duplicate option name detection for catching configuration bugs early, and context-aware error messages that help users understand exactly what went wrong.

“Did you mean?”: Automatic typo suggestions

We've all been there: you type --verbos instead of --verbose, and the CLI responds with an unhelpful “unknown option” error. Optique 0.7.0 changes this by automatically suggesting similar options when users make typos:

const parser = object({
  verbose: option("-v", "--verbose"),
  version: option("--version"),
});

// User types: --verbos (typo)
const result = parse(parser, ["--verbos"]);
// Error: Unexpected option or argument: --verbos.
//
// Did you mean one of these?
//   --verbose
//   --version

The suggestion system uses Levenshtein distance to find similar names, suggesting up to 3 alternatives when the edit distance is within a reasonable threshold. Suggestions work automatically for both option names and subcommand names across all parser types—option(), flag(), command(), object(), or(), and longestMatch(). See the automatic suggestions documentation for more details.

Customizing suggestions

You can customize how suggestions are formatted or disable them entirely through the errors option:

// Custom suggestion format for option/flag parsers
const portOption = option("--port", integer(), {
  errors: {
    noMatch: (invalidOption, suggestions) =>
      suggestions.length > 0
        ? message`Unknown option ${invalidOption}. Try: ${values(suggestions)}`
        : message`Unknown option ${invalidOption}.`
  }
});

// Custom suggestion format for combinators
const config = object({
  host: option("--host", string()),
  port: option("--port", integer())
}, {
  errors: {
    suggestions: (suggestions) =>
      suggestions.length > 0
        ? message`Available options: ${values(suggestions)}`
        : []
  }
});

Zod and Valibot integrations

Two new packages join the Optique family, bringing powerful validation capabilities from the TypeScript ecosystem to your CLI parsers.

@optique/zod

The new @optique/zod package lets you use Zod schemas directly as value parsers:

import { option, object } from "@optique/core";
import { zod } from "@optique/zod";
import { z } from "zod";

const parser = object({
  email: option("--email", zod(z.string().email())),
  port: option("--port", zod(z.coerce.number().int().min(1).max(65535))),
  format: option("--format", zod(z.enum(["json", "yaml", "xml"]))),
});

The package supports both Zod v3.25.0+ and v4.0.0+, with automatic error formatting that integrates seamlessly with Optique's message system. See the Zod integration guide for complete usage examples.

@optique/valibot

For those who prefer a lighter bundle, @optique/valibot integrates with Valibot—a validation library with a significantly smaller footprint (~10KB vs Zod's ~52KB):

import { option, object } from "@optique/core";
import { valibot } from "@optique/valibot";
import * as v from "valibot";

const parser = object({
  email: option("--email", valibot(v.pipe(v.string(), v.email()))),
  port: option("--port", valibot(v.pipe(
    v.string(),
    v.transform(Number),
    v.integer(),
    v.minValue(1),
    v.maxValue(65535)
  ))),
});

Both packages support custom error messages through their respective error handler options (zodError and valibotError), giving you full control over how validation failures are presented to users. See the Valibot integration guide for complete usage examples.

Duplicate option name detection

A common source of bugs in CLI applications is accidentally using the same option name in multiple places. Previously, this would silently cause ambiguous parsing where the first matching parser consumed the option.

Optique 0.7.0 now validates option names at parse time and fails with a clear error message when duplicates are detected:

const parser = object({
  input: option("-i", "--input", string()),
  interactive: option("-i", "--interactive"),  // Oops! -i is already used
});

// Error: Duplicate option name -i found in fields: input, interactive.
// Each option name must be unique within a parser combinator.

This validation applies to object(), tuple(), merge(), and group() combinators. The or() combinator continues to allow duplicate option names since its branches are mutually exclusive. See the duplicate detection documentation for more details.

If you have a legitimate use case for duplicate option names, you can opt out with allowDuplicates: true:

const parser = object({
  input: option("-i", "--input", string()),
  interactive: option("-i", "--interactive"),
}, { allowDuplicates: true });

Context-aware error messages

Error messages from combinators are now smarter about what they report. Instead of generic "No matching option or command found" messages, Optique now analyzes what the parser expects and provides specific feedback:

// When only arguments are expected
const parser1 = or(argument(string()), argument(integer()));
// Error: Missing required argument.

// When only commands are expected
const parser2 = or(command("add", addParser), command("remove", removeParser));
// Error: No matching command found.

// When both options and arguments are expected
const parser3 = object({
  port: option("--port", integer()),
  file: argument(string()),
});
// Error: No matching option or argument found.

Dynamic error messages with NoMatchContext

For applications that need internationalization or context-specific messaging, the errors.noMatch option now accepts a function that receives a NoMatchContext object:

const parser = or(
  command("add", addParser),
  command("remove", removeParser),
  {
    errors: {
      noMatch: ({ hasOptions, hasCommands, hasArguments }) => {
        if (hasCommands && !hasOptions && !hasArguments) {
          return message`일치하는 명령을 찾을 수 없습니다.`;  // Korean
        }
        return message`잘못된 입력입니다.`;
      }
    }
  }
);

Shell completion naming conventions

The run() function now supports configuring whether shell completions use singular or plural naming conventions:

run(parser, {
  completion: {
    name: "plural",  // Uses "completions" and "--completions"
  }
});

// Or for singular only
run(parser, {
  completion: {
    name: "singular",  // Uses "completion" and "--completion"
  }
});

The default "both" accepts either form, maintaining backward compatibility while letting you enforce a consistent style in your CLI.

Additional improvements

  • Line break handling: formatMessage() now distinguishes between soft breaks (single \n, converted to spaces) and hard breaks (double \n\n, creating paragraph separations), improving multi-line error message formatting.

  • New utility functions: Added extractOptionNames() and extractArgumentMetavars() to the @optique/core/usage module for programmatic access to parser metadata.

Installation

deno add --jsr @optique/core @optique/run
npm  add       @optique/core @optique/run
pnpm add       @optique/core @optique/run
yarn add       @optique/core @optique/run
bun  add       @optique/core @optique/run

For validation library integrations:

# Zod integration
deno add jsr:@optique/zod     # Deno
npm  add     @optique/zod      # npm/pnpm/yarn/bun

# Valibot integration
deno add jsr:@optique/valibot  # Deno
npm  add     @optique/valibot  # npm/pnpm/yarn/bun

Looking forward

This release represents our commitment to making CLI development in TypeScript as smooth as possible. The “Did you mean?” suggestions and validation library integrations were among the most requested features, and we're excited to see how they improve your CLI applications.

For detailed documentation and examples, visit the Optique documentation. We welcome your feedback and contributions on GitHub!

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub

We're thrilled to announce Optique 0.7.0, a release focused on developer experience improvements and expanding Optique's ecosystem with validation library integrations.

Optique is a type-safe, combinatorial CLI argument parser for TypeScript. Unlike traditional CLI libraries that rely on configuration objects, Optique lets you compose parsers from small, reusable functions—bringing the same functional composition patterns that make Zod powerful to CLI development. If you're new to Optique, check out Why Optique? to learn how this approach unlocks possibilities that configuration-based libraries simply can't match.

This release introduces automatic “Did you mean?” suggestions for typos, seamless integration with Zod and Valibot validation libraries, duplicate option name detection for catching configuration bugs early, and context-aware error messages that help users understand exactly what went wrong.

“Did you mean?”: Automatic typo suggestions

We've all been there: you type --verbos instead of --verbose, and the CLI responds with an unhelpful “unknown option” error. Optique 0.7.0 changes this by automatically suggesting similar options when users make typos:

const parser = object({
  verbose: option("-v", "--verbose"),
  version: option("--version"),
});

// User types: --verbos (typo)
const result = parse(parser, ["--verbos"]);
// Error: Unexpected option or argument: --verbos.
//
// Did you mean one of these?
//   --verbose
//   --version

The suggestion system uses Levenshtein distance to find similar names, suggesting up to 3 alternatives when the edit distance is within a reasonable threshold. Suggestions work automatically for both option names and subcommand names across all parser types—option(), flag(), command(), object(), or(), and longestMatch(). See the automatic suggestions documentation for more details.

Customizing suggestions

You can customize how suggestions are formatted or disable them entirely through the errors option:

// Custom suggestion format for option/flag parsers
const portOption = option("--port", integer(), {
  errors: {
    noMatch: (invalidOption, suggestions) =>
      suggestions.length > 0
        ? message`Unknown option ${invalidOption}. Try: ${values(suggestions)}`
        : message`Unknown option ${invalidOption}.`
  }
});

// Custom suggestion format for combinators
const config = object({
  host: option("--host", string()),
  port: option("--port", integer())
}, {
  errors: {
    suggestions: (suggestions) =>
      suggestions.length > 0
        ? message`Available options: ${values(suggestions)}`
        : []
  }
});

Zod and Valibot integrations

Two new packages join the Optique family, bringing powerful validation capabilities from the TypeScript ecosystem to your CLI parsers.

@optique/zod

The new @optique/zod package lets you use Zod schemas directly as value parsers:

import { option, object } from "@optique/core";
import { zod } from "@optique/zod";
import { z } from "zod";

const parser = object({
  email: option("--email", zod(z.string().email())),
  port: option("--port", zod(z.coerce.number().int().min(1).max(65535))),
  format: option("--format", zod(z.enum(["json", "yaml", "xml"]))),
});

The package supports both Zod v3.25.0+ and v4.0.0+, with automatic error formatting that integrates seamlessly with Optique's message system. See the Zod integration guide for complete usage examples.

@optique/valibot

For those who prefer a lighter bundle, @optique/valibot integrates with Valibot—a validation library with a significantly smaller footprint (~10KB vs Zod's ~52KB):

import { option, object } from "@optique/core";
import { valibot } from "@optique/valibot";
import * as v from "valibot";

const parser = object({
  email: option("--email", valibot(v.pipe(v.string(), v.email()))),
  port: option("--port", valibot(v.pipe(
    v.string(),
    v.transform(Number),
    v.integer(),
    v.minValue(1),
    v.maxValue(65535)
  ))),
});

Both packages support custom error messages through their respective error handler options (zodError and valibotError), giving you full control over how validation failures are presented to users. See the Valibot integration guide for complete usage examples.

Duplicate option name detection

A common source of bugs in CLI applications is accidentally using the same option name in multiple places. Previously, this would silently cause ambiguous parsing where the first matching parser consumed the option.

Optique 0.7.0 now validates option names at parse time and fails with a clear error message when duplicates are detected:

const parser = object({
  input: option("-i", "--input", string()),
  interactive: option("-i", "--interactive"),  // Oops! -i is already used
});

// Error: Duplicate option name -i found in fields: input, interactive.
// Each option name must be unique within a parser combinator.

This validation applies to object(), tuple(), merge(), and group() combinators. The or() combinator continues to allow duplicate option names since its branches are mutually exclusive. See the duplicate detection documentation for more details.

If you have a legitimate use case for duplicate option names, you can opt out with allowDuplicates: true:

const parser = object({
  input: option("-i", "--input", string()),
  interactive: option("-i", "--interactive"),
}, { allowDuplicates: true });

Context-aware error messages

Error messages from combinators are now smarter about what they report. Instead of generic "No matching option or command found" messages, Optique now analyzes what the parser expects and provides specific feedback:

// When only arguments are expected
const parser1 = or(argument(string()), argument(integer()));
// Error: Missing required argument.

// When only commands are expected
const parser2 = or(command("add", addParser), command("remove", removeParser));
// Error: No matching command found.

// When both options and arguments are expected
const parser3 = object({
  port: option("--port", integer()),
  file: argument(string()),
});
// Error: No matching option or argument found.

Dynamic error messages with NoMatchContext

For applications that need internationalization or context-specific messaging, the errors.noMatch option now accepts a function that receives a NoMatchContext object:

const parser = or(
  command("add", addParser),
  command("remove", removeParser),
  {
    errors: {
      noMatch: ({ hasOptions, hasCommands, hasArguments }) => {
        if (hasCommands && !hasOptions && !hasArguments) {
          return message`일치하는 명령을 찾을 수 없습니다.`;  // Korean
        }
        return message`잘못된 입력입니다.`;
      }
    }
  }
);

Shell completion naming conventions

The run() function now supports configuring whether shell completions use singular or plural naming conventions:

run(parser, {
  completion: {
    name: "plural",  // Uses "completions" and "--completions"
  }
});

// Or for singular only
run(parser, {
  completion: {
    name: "singular",  // Uses "completion" and "--completion"
  }
});

The default "both" accepts either form, maintaining backward compatibility while letting you enforce a consistent style in your CLI.

Additional improvements

  • Line break handling: formatMessage() now distinguishes between soft breaks (single \n, converted to spaces) and hard breaks (double \n\n, creating paragraph separations), improving multi-line error message formatting.

  • New utility functions: Added extractOptionNames() and extractArgumentMetavars() to the @optique/core/usage module for programmatic access to parser metadata.

Installation

deno add --jsr @optique/core @optique/run
npm  add       @optique/core @optique/run
pnpm add       @optique/core @optique/run
yarn add       @optique/core @optique/run
bun  add       @optique/core @optique/run

For validation library integrations:

# Zod integration
deno add jsr:@optique/zod     # Deno
npm  add     @optique/zod      # npm/pnpm/yarn/bun

# Valibot integration
deno add jsr:@optique/valibot  # Deno
npm  add     @optique/valibot  # npm/pnpm/yarn/bun

Looking forward

This release represents our commitment to making CLI development in TypeScript as smooth as possible. The “Did you mean?” suggestions and validation library integrations were among the most requested features, and we're excited to see how they improve your CLI applications.

For detailed documentation and examples, visit the Optique documentation. We welcome your feedback and contributions on GitHub!

silverpill's avatar
silverpill

@silverpill@mitra.social

FEP-9f9f: Collections

Collections are the most under-specified entities in #ActivityPub. I've started documenting them in a FEP:

https://codeberg.org/silverpill/feps/src/branch/main/9f9f/fep-9f9f.md

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub

フェディバースのアドベントカレンダー、去年も参加したんだ。今年も参加しなきゃ!



RE: https://fedibird.com/@noellabo/115610217465349809

のえる's avatar
のえる

@noellabo@fedibird.com

Fediverseのアドベントカレンダー、2025年も会場をご用意しています。

アドベントカレンダーはキリストの降誕祭・待降節に由来するもので、

12月1日(クリスマスの4つ前の日曜日)〜12月24日、毎日印をつけたり、毎週キャンドルを灯しながら数えていく習慣がありまして、

クリスマスを待つ子供達に、お菓子やおもちゃが入った扉がついているカレンダーがつくられ、毎日ひとつずつ開けていく習慣が根付いています。

大人向けの、紅茶とか化粧品の入ったカレンダーも、だいぶメジャーになってきましたよね。

で、これになぞらえて行われている、毎日記事を書いて発表する技術界隈から始まったイベントがありまして、

その流れを汲んでいるのが、今回私たちが企画しているアドベントカレンダーです。

みんなでテーマに沿った記事を持ち寄って、それを読んで一年を振り返ったり、知見を共有したり、抱負を語ったりするイベントです。

個人的な感想や振り返りなども受け付けているので、みなさん、ぜひ参加してください。エントリー受付中です。

登録・詳細はこちらからどうぞ。
adventar.org/calendars/11463

クリスマスマーケット
ALT text detailsクリスマスマーケット
남정현's avatar
남정현

@rkttu@hackers.pub

네이버 모각코 지도를 오랫만에 업그레이드합니다. 24시, 야간, 밤 11시 이후 마감, 심야, 새벽 시간에도 운영하는 카페들을 모아 별도 지도로 준비하고 있습니다.

많이 제보하고 공유해주세요~ 🤗

https://naver.me/xF2W8ln7

wwj's avatar
wwj

@z9mb1@hackers.pub

아… 젠부 귀찮다 그나저나 후쿠오카에서 Wagashi를 먹어보지 못한게 아쉽군… 다음엔 디저트 투어를 해보러 갈까 싶다. 카페에서 먹는 몽블랑도 좀 궁금하고. 프랑스 식 제과는 크게 궁금하지 않은데 일본식 프랑스 제과 뭐 이런건 궁금하다.

금강토's avatar
금강토

@tokolovesme@seoul.earth

후쿠오카에서 온 에린기와래(새송이버섯 하치와래)

wwj's avatar
wwj

@z9mb1@hackers.pub

‘@FUK’ ‘@everyone’ 🍨👩‍💻🧑‍💻👨‍💻

공항에서 서 있다
ALT text details공항에서 서 있다
coffee jelly parfait
ALT text detailscoffee jelly parfait
tea time. two tarts and tea cups.
ALT text detailstea time. two tarts and tea cups.
apartment and a tree
ALT text detailsapartment and a tree
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

아마도 더 오래된 건 트剩餘(잉여)에 있었을 듯…

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social

링크가 살아 있는 것 ()에서는 가장 오래된 聯合宇宙(연합우주)에서의 내 글:

https://mastodon.social/@hongminhee/6595450

Ian Wagner's avatar
Ian Wagner

@ianthetechie@fosstodon.org

I periodically find it interesting how we still haven't really solved consistency in audio leveling. I have to turn YouTube up to around 1:00 on my amp dial to get the same volume as 11:00 on Apple Music.

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

デザートでシャインマスカットのタルト!

シャインマスカットのタルト
ALT text detailsシャインマスカットのタルト
Jazz de Ville – Jazz's avatar
Jazz de Ville – Jazz

@jdv_jazz@mastodon.nl

Avishai Cohen - Signature

Cover: Avishai Cohen - Signature
ALT text detailsCover: Avishai Cohen - Signature
Jazz de Ville – Jazz's avatar
Jazz de Ville – Jazz

@jdv_jazz@mastodon.nl

Samara Joy - Can't Get Out Of This Mood

Cover: Samara Joy - Can't Get Out Of This Mood
ALT text detailsCover: Samara Joy - Can't Get Out Of This Mood
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

三日目のお昼ご飯は麻婆豆腐!

麻婆豆腐
ALT text details麻婆豆腐
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

夕飯は焼き鳥!

焼き鳥
ALT text details焼き鳥
焼き鳥
ALT text details焼き鳥
wwj's avatar
wwj

@z9mb1@hackers.pub

Im @Engineering cafe in FUK (^ν^)

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

今日はちょっと仕事しにエンジニアカフェに来た。福岡市赤煉瓦文化館の建物を使ってるから、趣があっていい感じ。

福岡市赤煉瓦文化館の建物
ALT text details福岡市赤煉瓦文化館の建物
「福岡市赤煉瓦文化館」と書いている標識版
ALT text details「福岡市赤煉瓦文化館」と書いている標識版
エンジニアカフェの看板
ALT text detailsエンジニアカフェの看板
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

二日目のお昼は焼きカレー!福岡の名物らしい。

スペシャル焼きカレー
ALT text detailsスペシャル焼きカレー
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

今回の旅行の初ご飯は鯛茶漬け!

鯛茶漬け
ALT text details鯛茶漬け
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

福岡到着!

Fukuoka Airport
ALT text detailsFukuoka Airport
洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social

今日から3泊4日で福岡旅行!これから仁川空港に向かいます。

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social

I try to be polite when I write prompts for LLMs. Especially in languages like Korean or Japanese that have grammatical honorifics, I make sure to use the formal, respectful form of speech (what's known as 敬語—gyeongeo or keigo). I joke with my friends that I'm using polite language early on to be pardoned for my sins when AI eventually takes over the world, but the real reason is that I don't want to get used to speaking to someone in a commanding tone. It makes me think I might start believing it's “okay” to order around certain intelligent beings, almost like condoning slavery.

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to Stéphane's post

@sirber83 @julian Thanks! You might not have been able to find it because you were searching for “JavaScript” instead of “TypeScript.” What do you mean by “standalone” by the way? Fedify is typically used in together with with other web frameworks like Express or Next.js.

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

Update: Just added Valibot integration as well!

https://unstable.optique.dev/concepts/valueparsers#valibot-integration

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

Update: Just added automatic metavar inference!

The help text now gets smarter labels based on your Zod schema:

  • z.string().email()EMAIL
  • z.coerce.number().int()INTEGER
  • z.enum([…])CHOICE

No manual configuration needed.

https://github.com/dahlia/optique/commit/d4903dfdb88727a488dedb6a73ad8997868246e1

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to Mike Roberts's post

@mikebroberts Zod's a solid choice! The transform stuff can be tricky at first but becomes second nature.

Let me know if you end up trying Optique—always curious to hear feedback.

Chee Aun 🤔's avatar
Chee Aun 🤔

@cheeaun@mastodon.social · Reply to Chee Aun 🤔's post

Community deployments 🙇‍♂️ github.com/cheeaun/phanpy?tab=

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social

Optique 0.7.0 will support Zod schemas as value parsers.

Seemed like a natural fit—same validation logic for both CLI and app code.

https://github.com/dahlia/optique/issues/39

洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

근데 果然(과연) 이런 게 興味(흥미)로운 內容(내용)일까…? 🤔

네 階層 아키텍처

슬라이드는 4個의 박스로 構成되어 있으며, 각 박스는 Optique의 階層 構造를 나타냅니다.

左側 위 — 階層 1: 값 파서 (value parsers)

• string()
• integer()
• url()
• choice()

左側 아래 — 階層 2: 基本 파서 (primitives)

• flag()
• option()
• argument()
• command()
• constant()

右側 위 — 階層 3: 修正子 (modifiers)

• optional(parser)
• withDefault(parser, defaultValue)
• map(parser, transform)

右側 아래 — 階層 4: 構成子 (constructors)

• object({ /* … */ })
• or(parser1, parser2, /* … */)
• merge(parser1, parser2, /* … */)
ALT text details네 階層 아키텍처 슬라이드는 4個의 박스로 構成되어 있으며, 각 박스는 Optique의 階層 構造를 나타냅니다. 左側 위 — 階層 1: 값 파서 (value parsers) • string() • integer() • url() • choice() 左側 아래 — 階層 2: 基本 파서 (primitives) • flag() • option() • argument() • command() • constant() 右側 위 — 階層 3: 修正子 (modifiers) • optional(parser) • withDefault(parser, defaultValue) • map(parser, transform) 右側 아래 — 階層 4: 構成子 (constructors) • object({ /* … */ }) • or(parser1, parser2, /* … */) • merge(parser1, parser2, /* … */)
Older →