Skip to content
quinnsprousePublic

About

Agent-first CLI starter kit: Effect v4, contract-generated surfaces, guardrails that fail the build

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lasso 🪢

Build agent-first CLIs with Effect.

Each command is one contract that generates its parsing, help, schemas, and docs. Mutations plan before they apply, and the runtime owns confirmation. Outside a terminal, Lasso writes machine output by default and catches protocol drift in the checks.

Quick start

Use Node ^22.19, ^24.11, or 26 and newer, npm 10 or newer, and Git. (The CLI you ship runs on any Node 22.19 or newer.)

npx degit quinnsprouse/lasso my-cli   # or: gh repo create my-cli --template quinnsprouse/lasso --clone
cd my-cli
git init --initial-branch=main        # skip when gh created the repository
npm ci
npm run setup
node scripts/rename.mjs my-cli
npm run dev -- task list --json

Rename the package before publishing: the template's npm name is under the author's scope. Then set name (your scope), repository, homepage, and bugs in package.json; provenance requires repository to match your GitHub project. The demo store lives in .lasso/ (renamed with the CLI) under the current directory.

What makes it different

In JSON mode, Lasso writes one envelope to stdout for each invocation. It sends diagnostics to stderr.

{"schemaVersion":"1","status":"ok","data":{},"warnings":[],"next":[],"guides":[]}
  • Expected errors include a stable code, an executable fix, and a transient flag.
  • Every mutation begins with a read-only plan. The runtime owns --confirm, --dry-run, and --yes.
  • Exit code 4 requests confirmation. transient: true means a retry may work (exits 69, 75, and 130 carry it).
  • describe --json lists every command. schema --json returns JSON Schema draft 2020-12.
  • Settings are typed and discoverable: describe --json lists every environment variable, and secrets stay redacted. API calls go through Effect's HttpClient on Node's built-in fetch, with retries and HTTP failures mapped to honest transient flags.
  • Every outcome carries next (executable next moves) and guides (topic ids); guide get <topic> serves version-matched guides for what the surface cannot express, and skills/ ships the skill that routes agents to them.
  • A committed snapshot makes command and schema changes visible in review. Tests require the snapshot to stay current; reviewers decide compatibility.
  • Claude Code hooks in .claude/ check direct commands and report formatting and lint errors after edits. Full type and Effect checks after each edit are opt-in.

Read the output protocol for envelopes, NDJSON, exit codes, and confirmation.

Daily commands

npm run dev -- <args>                        # run from source
npm run check                                # format, type-aware lint, types, guide catalog, unit and contract tests
npm run check:push                           # add build, dead code, e2e, and pack checks
npm run check:ci                             # add coverage and the Starter Contract
npm run build                                # build dist/bin.cjs
npm run test:starter                         # test a fresh archive of the starter
node scripts/new-command.mjs <group> <name>  # scaffold and register a query (--mutation: plan + apply)
node scripts/guides.mjs                      # inline guides/topics/*.md into the bundle
npm run surface:update                       # record an additive surface change
npm run setup                                # install Git hooks
npm run doctor                               # check the workspace, incl. patch state
npm run release:prepare -- patch             # bump every version source together

Agents start with AGENTS.md. CONTEXT.md defines project terms, and docs/agents/ contains deeper references.

Stack

  • Effect v4 release candidate with effect/unstable/cli, tested with @effect/vitest
  • TypeScript 7 with type-aware oxlint and Biome
  • tsdown with one self-contained, minified CommonJS bundle; the launcher enables Node's compile cache, so a command adds about 15 ms to Node's own startup
  • Vitest, fast-check, and execa
  • lefthook, commitlint, and knip

License

MIT

About

Agent-first CLI starter kit: Effect v4, contract-generated surfaces, guardrails that fail the build

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages