Skip to content

build(cli): run on stable Effect 4.1.3 - #109

Merged
jkomyno merged 3 commits into
mainfrom
feat/cli-effect-4.1
Nov 11, 2026
Merged

jkomyno merged 3 commits into
mainfrom
feat/cli-effect-4.1

Conversation

@jkomyno

@jkomyno jkomyno commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

@uniku/cli now runs on stable Effect 4.1.3 instead of 4.0.0-beta.93. A global npm install no longer depends on the direct @effect/platform-node-shared pin that #106 added to stop the ERR_MODULE_NOT_FOUND startup crash: @effect/[email protected] pins it exactly, and a packed npm i -g resolves a single [email protected].

Fixes #107

What changes for CLI users

Output, --json shapes, and exit codes match main for valid invocations; I compared about 30 invocations against a build of main. Effect 4.1's parser is stricter, and the changeset lists each difference:

Invocation main This PR
uniku uuid -n 2 -n 3, uniku uuid extra, uniku uuid -v ignored, exit 0 help + error, exit 1
uniku tsid --node -1 unknown flag -1, exit 1 INVALID_NODE, exit 1
uniku --log-level bogus uuid bare error, exit 1 help + error, exit 1
uniku --completions 4 shells adds powershell, pwsh

Keeping the old leniency would mean working around the framework's parser, so this PR documents the stricter behavior instead. Say so if you would rather preserve it.

Design decisions

  • Per-command layout. Each command lives in src/commands/<name>/ as a .cmd.ts definition plus a .handler.ts; generate subcommands live in generate/<id>/. The layout mirrors the composio CLI, so both CLIs follow the same conventions.
  • No --wizard. 4.1 enables an interactive --wizard global flag by default. src/cli-config.ts keeps the 4.0 built-in set (help, version, completions, log level).
  • -- operands. 4.1 routes operands after -- to the selected subcommand, so the encode/decode workaround in src/runtime/args.ts is gone. --json detection for error output and the update notice now ignores operands, so uniku validate -- --json validates the literal ID --json.
  • Negative numbers. 4.1 reads -1 as a flag value. --count now rejects negative values, so uniku uuid -n -1 still exits 1 instead of printing nothing.
  • Vitest split. @effect/vitest 4.1 requires Vitest 5, now the workspace default. packages/uniku (its benchmarks use the bench() API Vitest 5 removed) and the Cloudflare e2e (@cloudflare/vitest-pool-workers still requires Vitest 4) use a vitest4 catalog.
  • Skill. .agents/skills/effect-v4 is rebuilt from composio's Effect v4 skill, with the 4.0-beta references removed. Its example checker now also fails when versions.json and the CLI pins disagree.

Validation

  • pnpm lint:ci, pnpm typecheck, pnpm test (uniku 547, CLI 261), pnpm test:e2e (Cloudflare, 63), pnpm examples:check
  • uniku browser smoke and benchmarks on the vitest4 catalog
  • Packed npm i -g of uniku + @uniku/cli, then uniku --help and uniku uuid
  • Standalone binaries for bun-darwin-arm64 and bun-linux-x64

Pin effect, @effect/platform-bun, and @effect/vitest to 4.1.3 in the
CLI, the browser smoke script, and the docs example, and drop the direct
@effect/platform-node-shared pin that @effect/platform-bun now pins
itself. Port the CLI to the 4.1 APIs, give each command its own
directory with a definition and a handler, drop the argv workaround for
`--` operands that 4.1 routes natively, and keep the built-in global
flags without 4.1's interactive --wizard.

Move the workspace to Vitest 5, which @effect/vitest 4.1 requires.
packages/uniku (its benchmarks use the bench() API Vitest 5 removed) and
the Cloudflare e2e workspace (@cloudflare/vitest-pool-workers requires
Vitest 4) use a vitest4 catalog.

Fixes #107
Rebuild the skill around composio's Effect v4 skill: a version matrix in
versions.json, references for the effect/cli surface and command layout,
core patterns, and the upgrade workflow, and an example checker that also
fails when versions.json and the CLI pins disagree. Drop the references
written for the 4.0 betas, and update AGENTS.md and the testing and
TypeScript skills for Effect 4.1 and the Vitest split.
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Preview removed because the pull request was closed.

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@uniku/cli@109
pnpm add https://pkg.pr.new/uniku@109

commit: 7c9c85b

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Generation

ID uniku npm/regex Comparison
ULID 4.6M ops/s 28.4K ops/s 162.6x faster ⚠️ ±15.7%
UUID v7 3.5M ops/s 464.8K ops/s 7.4x faster
CUID2 43.9K ops/s 6.5K ops/s 6.8x faster ⚠️ ±4.9%
TypeID 2M ops/s 574.3K ops/s 3.5x faster
UUID v5 1.1M ops/s 357.8K ops/s 3.1x faster ⚠️ ±9.4%
TSID 6M ops/s 2.7M ops/s 2.3x faster
UUID v5 (256-char name) 408.9K ops/s 201.6K ops/s 2x faster ⚠️ ±15.5%
NanoID 9.9M ops/s 5.2M ops/s 1.9x faster
KSUID 366.9K ops/s 214.6K ops/s 1.7x faster ⚠️ ±3.8%
NanoID (10) 12M ops/s 8M ops/s 1.5x faster ⚠️ ±9.1%
XID 7.2M ops/s 5.5M ops/s 1.3x faster
UUID v4 10.1M ops/s 8.9M ops/s 1.1x faster
ObjectID 4.7M ops/s 4.2M ops/s 1.1x faster

Validation

ID uniku npm/regex Comparison
KSUID 8.6M ops/s 693.4K ops/s 12.4x faster
TypeID 4.4M ops/s 1.2M ops/s 3.8x faster
TSID 4.4M ops/s 1.5M ops/s 3x faster
XID 10M ops/s 3.9M ops/s 2.6x faster
UUID v7 8.8M ops/s 4.8M ops/s 1.8x faster
UUID v5 8.9M ops/s 4.8M ops/s 1.8x faster
UUID v4 8.7M ops/s 4.8M ops/s 1.8x faster
ULID 9.6M ops/s 10.4M ops/s regex 1.1x faster
CUID2 12.6M ops/s 14.1M ops/s npm 1.1x faster
NanoID 12.7M ops/s 14.5M ops/s regex 1.1x faster
ObjectID 9.6M ops/s 11.5M ops/s npm 1.2x faster

Cold Start (Node)

Generator Process to exit (median / p95) Import + first ID (median / p95)
uuid/v4 32.0 ms / 40.3 ms 5.5 ms / 7.3 ms
uuid/v5 27.9 ms / 29.8 ms 3.9 ms / 4.1 ms
uuid/v7 30.4 ms / 32.5 ms 5.9 ms / 6.1 ms
ulid 31.0 ms / 34.5 ms 5.7 ms / 5.9 ms
typeid 31.8 ms / 34.5 ms 6.4 ms / 6.6 ms
cuid2 38.5 ms / 41.0 ms 13.5 ms / 14.3 ms
cuid/v2 38.2 ms / 39.9 ms 13.7 ms / 14.4 ms
nanoid 29.4 ms / 32.6 ms 5.0 ms / 5.2 ms
ksuid 30.3 ms / 33.2 ms 6.1 ms / 6.3 ms
objectid 30.9 ms / 33.7 ms 6.2 ms / 6.4 ms
tsid 30.4 ms / 33.1 ms 5.5 ms / 5.8 ms
xid 31.1 ms / 34.1 ms 6.3 ms / 6.5 ms

Comparison vs Main

Benchmark Baseline Current Change
tests/bench/compat.bench.ts > Generation > UUID v4 > uniku 15.7M ops/s 10.1M ops/s 🔴 -35.7% (+/-1.8% RME)
tests/bench/compat.bench.ts > Validation > KSUID > uniku 13.3M ops/s 8.6M ops/s 🔴 -35.6% (+/-2.9% RME)
tests/bench/compat.bench.ts > Validation > UUID v7 > uniku 13.4M ops/s 8.8M ops/s 🔴 -34.2% (+/-8.0% RME)
tests/bench/compat.bench.ts > Validation > ObjectID > uniku 14.5M ops/s 9.6M ops/s 🔴 -33.7% (+/-2.8% RME)
tests/bench/compat.bench.ts > Validation > UUID v4 > uniku 13.2M ops/s 8.7M ops/s 🔴 -33.6% (+/-0.9% RME)
tests/bench/compat.bench.ts > Validation > XID > uniku 14.9M ops/s 10M ops/s 🔴 -32.9% (+/-3.7% RME)
tests/bench/compat.bench.ts > Generation > ObjectID > uniku 6.9M ops/s 4.7M ops/s 🔴 -31.9% (+/-1.8% RME)
tests/bench/compat.bench.ts > Validation > TypeID > uniku 6.4M ops/s 4.4M ops/s 🔴 -31.7% (+/-1.6% RME)
tests/bench/compat.bench.ts > Validation > UUID v5 > uniku 13M ops/s 8.9M ops/s 🔴 -31.6% (+/-3.5% RME)
tests/bench/compat.bench.ts > Validation > TSID > uniku 6.4M ops/s 4.4M ops/s 🔴 -31.1% (+/-3.8% RME)
tests/bench/compat.bench.ts > Generation > UUID v7 > uniku 5M ops/s 3.5M ops/s 🔴 -30.3% (+/-2.1% RME)
tests/bench/compat.bench.ts > Generation > TypeID > uniku 2.8M ops/s 2M ops/s 🔴 -29.3% (+/-4.9% RME)
tests/bench/compat.bench.ts > Generation > ULID > uniku 6.5M ops/s 4.6M ops/s 🔴 -29.2% (+/-3.0% RME)
tests/bench/compat.bench.ts > Validation > NanoID > uniku 17.9M ops/s 12.7M ops/s 🔴 -28.8% (+/-1.3% RME)
tests/bench/compat.bench.ts > Validation > CUID2 > uniku 17.7M ops/s 12.6M ops/s 🔴 -28.7% (+/-1.3% RME)
tests/bench/compat.bench.ts > Generation > CUID2 > uniku 61.5K ops/s 43.9K ops/s 🔴 -28.6% (+/-1.7% RME)
tests/bench/compat.bench.ts > Generation > KSUID > uniku 512.3K ops/s 366.9K ops/s 🔴 -28.4% (+/-1.5% RME)
tests/bench/compat.bench.ts > Generation > NanoID > uniku 13.8M ops/s 9.9M ops/s 🔴 -28.4% (+/-2.7% RME)
tests/bench/compat.bench.ts > Generation > NanoID (10) > uniku 16.7M ops/s 12M ops/s 🔴 -28.1% (+/-2.6% RME)
tests/bench/compat.bench.ts > Validation > ULID > uniku 13.3M ops/s 9.6M ops/s 🔴 -27.9% (+/-3.8% RME)
tests/bench/compat.bench.ts > Generation > TSID > uniku 8.3M ops/s 6M ops/s 🔴 -27.3% (+/-0.7% RME)
tests/bench/compat.bench.ts > Generation > UUID v5 > uniku 1.5M ops/s 1.1M ops/s 🔴 -25.5% (+/-2.1% RME)
tests/bench/compat.bench.ts > Generation > XID > uniku 9.7M ops/s 7.2M ops/s 🔴 -25.3% (+/-9.0% RME)
tests/bench/compat.bench.ts > Generation > UUID v5 (256-char name) > uniku 515.1K ops/s 408.9K ops/s 🔴 -20.6% (+/-7.0% RME)
tests/bench/compat.bench.ts > Validation > UUID v7 > npm 7.3M ops/s 4.8M ops/s ℹ️ -34.4% (+/-2.8% RME) (ref)
tests/bench/compat.bench.ts > Validation > UUID v5 > npm 7.3M ops/s 4.8M ops/s ℹ️ -33.5% (+/-4.6% RME) (ref)
tests/bench/compat.bench.ts > Validation > XID > npm 5.8M ops/s 3.9M ops/s ℹ️ -33.5% (+/-7.3% RME) (ref)
tests/bench/compat.bench.ts > Validation > UUID v4 > npm 7.1M ops/s 4.8M ops/s ℹ️ -31.4% (+/-2.6% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v4 > npm 12.9M ops/s 8.9M ops/s ℹ️ -31.0% (+/-4.1% RME) (ref)
tests/bench/compat.bench.ts > Generation > XID > npm 7.8M ops/s 5.5M ops/s ℹ️ -30.4% (+/-6.4% RME) (ref)
tests/bench/compat.bench.ts > Generation > NanoID > npm 7.4M ops/s 5.2M ops/s ℹ️ -29.6% (+/-1.0% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v7 > npm 654.4K ops/s 464.8K ops/s ℹ️ -29.0% (+/-3.3% RME) (ref)
tests/bench/compat.bench.ts > Generation > ObjectID > npm 5.8M ops/s 4.2M ops/s ℹ️ -28.5% (+/-12.8% RME) (ref)
tests/bench/compat.bench.ts > Generation > CUID2 > npm 9K ops/s 6.5K ops/s ℹ️ -28.1% (+/-8.6% RME) (ref)
tests/bench/compat.bench.ts > Generation > NanoID (10) > npm 11.1M ops/s 8M ops/s ℹ️ -28.1% (+/-24.7% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v5 > npm 494.6K ops/s 357.8K ops/s ℹ️ -27.7% (+/-17.3% RME) (ref)
tests/bench/compat.bench.ts > Validation > TSID > npm 2M ops/s 1.5M ops/s ℹ️ -27.3% (+/-3.5% RME) (ref)
tests/bench/compat.bench.ts > Generation > KSUID > npm 293.7K ops/s 214.6K ops/s ℹ️ -26.9% (+/-7.3% RME) (ref)
tests/bench/compat.bench.ts > Validation > NanoID > regex 19.8M ops/s 14.5M ops/s ℹ️ -26.8% (+/-1.9% RME) (ref)
tests/bench/compat.bench.ts > Validation > ULID > regex 14.2M ops/s 10.4M ops/s ℹ️ -26.8% (+/-1.3% RME) (ref)
tests/bench/compat.bench.ts > Validation > KSUID > npm 946.5K ops/s 693.4K ops/s ℹ️ -26.7% (+/-7.3% RME) (ref)
tests/bench/compat.bench.ts > Generation > ULID > npm 38.5K ops/s 28.4K ops/s ℹ️ -26.3% (+/-29.2% RME) (ref)
tests/bench/compat.bench.ts > Generation > TypeID > npm 776.7K ops/s 574.3K ops/s ℹ️ -26.1% (+/-1.5% RME) (ref)
tests/bench/compat.bench.ts > Validation > CUID2 > npm 19M ops/s 14.1M ops/s ℹ️ -25.8% (+/-2.6% RME) (ref)
tests/bench/compat.bench.ts > Generation > TSID > npm 3.6M ops/s 2.7M ops/s ℹ️ -25.6% (+/-3.7% RME) (ref)
tests/bench/compat.bench.ts > Validation > ObjectID > npm 15.1M ops/s 11.5M ops/s ℹ️ -23.7% (+/-1.3% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v5 (256-char name) > npm 261.2K ops/s 201.6K ops/s ℹ️ -22.8% (+/-27.8% RME) (ref)
tests/bench/compat.bench.ts > Validation > TypeID > npm 1.5M ops/s 1.2M ops/s ℹ️ -19.8% (+/-2.7% RME) (ref)

❌ Performance regression detected!

  • tests/bench/compat.bench.ts > Generation > UUID v4 > uniku: -35.7% (15.7M -> 10.1M ops/s, +/-1.8% combined RME)
  • tests/bench/compat.bench.ts > Generation > UUID v5 > uniku: -25.5% (1.5M -> 1.1M ops/s, +/-2.1% combined RME)
  • tests/bench/compat.bench.ts > Generation > UUID v5 (256-char name) > uniku: -20.6% (515.1K -> 408.9K ops/s, +/-7.0% combined RME)
  • tests/bench/compat.bench.ts > Generation > UUID v7 > uniku: -30.3% (5M -> 3.5M ops/s, +/-2.1% combined RME)
  • tests/bench/compat.bench.ts > Generation > ULID > uniku: -29.2% (6.5M -> 4.6M ops/s, +/-3.0% combined RME)
  • tests/bench/compat.bench.ts > Generation > TypeID > uniku: -29.3% (2.8M -> 2M ops/s, +/-4.9% combined RME)
  • tests/bench/compat.bench.ts > Generation > NanoID > uniku: -28.4% (13.8M -> 9.9M ops/s, +/-2.7% combined RME)
  • tests/bench/compat.bench.ts > Generation > NanoID (10) > uniku: -28.1% (16.7M -> 12M ops/s, +/-2.6% combined RME)
  • tests/bench/compat.bench.ts > Generation > CUID2 > uniku: -28.6% (61.5K -> 43.9K ops/s, +/-1.7% combined RME)
  • tests/bench/compat.bench.ts > Generation > KSUID > uniku: -28.4% (512.3K -> 366.9K ops/s, +/-1.5% combined RME)
  • tests/bench/compat.bench.ts > Generation > ObjectID > uniku: -31.9% (6.9M -> 4.7M ops/s, +/-1.8% combined RME)
  • tests/bench/compat.bench.ts > Generation > TSID > uniku: -27.3% (8.3M -> 6M ops/s, +/-0.7% combined RME)
  • tests/bench/compat.bench.ts > Generation > XID > uniku: -25.3% (9.7M -> 7.2M ops/s, +/-9.0% combined RME)
  • tests/bench/compat.bench.ts > Validation > UUID v4 > uniku: -33.6% (13.2M -> 8.7M ops/s, +/-0.9% combined RME)
  • tests/bench/compat.bench.ts > Validation > UUID v5 > uniku: -31.6% (13M -> 8.9M ops/s, +/-3.5% combined RME)
  • tests/bench/compat.bench.ts > Validation > UUID v7 > uniku: -34.2% (13.4M -> 8.8M ops/s, +/-8.0% combined RME)
  • tests/bench/compat.bench.ts > Validation > ULID > uniku: -27.9% (13.3M -> 9.6M ops/s, +/-3.8% combined RME)
  • tests/bench/compat.bench.ts > Validation > TypeID > uniku: -31.7% (6.4M -> 4.4M ops/s, +/-1.6% combined RME)
  • tests/bench/compat.bench.ts > Validation > NanoID > uniku: -28.8% (17.9M -> 12.7M ops/s, +/-1.3% combined RME)
  • tests/bench/compat.bench.ts > Validation > CUID2 > uniku: -28.7% (17.7M -> 12.6M ops/s, +/-1.3% combined RME)
  • tests/bench/compat.bench.ts > Validation > KSUID > uniku: -35.6% (13.3M -> 8.6M ops/s, +/-2.9% combined RME)
  • tests/bench/compat.bench.ts > Validation > ObjectID > uniku: -33.7% (14.5M -> 9.6M ops/s, +/-2.8% combined RME)
  • tests/bench/compat.bench.ts > Validation > TSID > uniku: -31.1% (6.4M -> 4.4M ops/s, +/-3.8% combined RME)
  • tests/bench/compat.bench.ts > Validation > XID > uniku: -32.9% (14.9M -> 10M ops/s, +/-3.7% combined RME)

Bundle Impact

Import Minified + gzipped
uniku/uuid/v4 ~1.2 KB
uniku/uuid/v5 ~1.8 KB
uniku/uuid/v7 ~1.7 KB
uniku/ulid ~1.9 KB
uniku/typeid ~2.9 KB
uniku/cuid2 ~1.0 KB*
uniku/cuid/v2 ~1.0 KB*
uniku/nanoid ~1.2 KB
uniku/ksuid ~1.5 KB
uniku/objectid ~1.6 KB
uniku/tsid ~1.6 KB
uniku/xid ~2.1 KB
uniku/errors ~445 B
uniku/generators ~101 B

*Excludes external dependencies (e.g., @noble/hashes)

Generated by workflow run 42986632490

@jkomyno
jkomyno merged commit 3bf9102 into main Nov 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release a @uniku/cli minor version on Effect 4.1.x

1 participant