From 456d7dc6a4ccb6207d8cfedfff33c2720675191a Mon Sep 17 00:00:00 2001 From: Yang Jun Date: Fri, 24 Jul 2026 02:08:59 +0800 Subject: [PATCH] feat!: take CLI template as positional argument Make template a required positional arg (drop --template) for v11 per #586; stdin template remains unsupported without a special error. Co-authored-by: Cursor --- README.md | 2 +- bin/liquid.js | 16 +++++++++------- docs/source/tutorials/setup.md | 14 +++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d3f638c5f..bdda8ace2 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ npm install liquidjs **CLI** ```bash -npx liquidjs --template 'Hello, {{ name }}!' --context '{"name": "Liquid"}' +npx liquidjs 'Hello, {{ name }}!' --context '{"name": "Liquid"}' ``` See the [setup guide][setup] for partials, layouts, caching, and other options. diff --git a/bin/liquid.js b/bin/liquid.js index b09b984eb..41d932037 100755 --- a/bin/liquid.js +++ b/bin/liquid.js @@ -14,7 +14,7 @@ async function render () { program .name('liquidjs') .description('Render a Liquid template') - .requiredOption('-t, --template ', 'liquid template to render (inline or @path to a file)') // TODO: Change to argument in 11.0 + .argument('