{"id":18623,"library":"nunjucks-cli","title":"nunjucks-cli","description":"A CLI wrapper and file watcher for Nunjucks templates, enabling compilation of Nunjucks files to static HTML. Version 1.0.0, released as an initial stable version, works as a command-line tool for rendering templates with JSON data and watching for changes. Key differentiators: built-in watcher for automatic re-rendering, support for glob patterns, process.env injection as context, and sensible defaults like ignoring partials starting with underscore.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/jeremyben/nunjucks-cli","tags":["javascript","nunjucks","cli","watch","render","templates"],"install":[{"cmd":"npm install nunjucks-cli","lang":"bash","label":"npm"},{"cmd":"yarn add nunjucks-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add nunjucks-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core template engine","package":"nunjucks","optional":false}],"imports":[{"note":"CLI tool, not a library. Use npx to avoid global install.","wrong":"npm install -g nunjucks-cli && nunjucks <file> [context] [options]","symbol":"nunjucks-cli","correct":"npx nunjucks <file> [context] [options]"}],"quickstart":{"code":"# Create a sample template\necho 'Hello {{ name }}!' > hello.tpl\n# Create a sample data file\necho '{\"name\": \"World\"}' > data.json\n# Render the template to HTML\nnpx nunjucks hello.tpl data.json\n# Output: hello.html with content 'Hello World!'\n# Watch mode for auto-recompilation\nnpx nunjucks **/*.tpl --watch","lang":"typescript","description":"Shows basic rendering with a template and JSON data, then watching all templates for changes."},"warnings":[{"fix":"Rename files without underscore or use a different tool if you need to compile underscore-prefixed templates.","message":"Template files starting with underscore (_) are ignored by default","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `npx nunjucks` or install globally with `npm i -g nunjucks-cli` then run `nunjucks`.","cause":"Installed locally without global link or npx","error":"nunjucks: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}