npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ssww.one/l4cli

v0.0.12

Published

An interpreter and CLI runner for the **Swan L4 DSL**, a domain-specific language designed for building and executing LLM-driven agents, tools, and interactive workflows.

Readme

Swan L4 CLI

An interpreter and CLI runner for the Swan L4 DSL, a domain-specific language designed for building and executing LLM-driven agents, tools, and interactive workflows.

Table of Contents

Overview

Swan L4 is a structured text-based language that lets you program step-by-step logic, manage execution state, invoke LLM queries, branch conditionally, and coordinate nested agent behaviors.

@ssww.one/l4cli compiles and executes these .l4 scripts directly from your terminal.

Read full language specification on Swan L4 Language Specifications

Examples

TITLE Greeting Program

SAY Welcome to the test environment!
LISTEN
THINK Extract the user's name from this text.
SAY Nice to meet you, {Context}!

See more examples on example-l4 folder

Installation

Globally via npm

You can install the CLI globally from npm:

npm install -g @ssww.one/l4cli

Pre-compiled Standalone Binaries

Alternatively, you can download pre-compiled standalone executables for Linux, macOS, and Windows directly from the v0.0.10-alpha Release Page.

Local Development Setup

If you want to run or build the project from source:

# Install dependencies
npm install

# Build the TypeScript files and link the binary globally
npm run build

This registers the l4cli binary command globally on your system.

Compiling Standalone Binaries (Bun)

To compile self-contained executables for all major OSes/architectures (Linux, macOS, and Windows) using Bun:

# Compile binaries into the ./bin directory
npm run build:bin

Configuration

The interpreter requires access to an OpenAI-compatible API to resolve LLM calls (THINK, SAY THINK, IF, etc.). Define the following environment variables in a .env file in your execution directory or export them in your shell:

OPENAI_BASEURL=https://your-llm-provider-endpoint/v1
OPENAI_APIKEY=your-api-key
OPENAI_MODEL=your-model-name

# Optional: Locale configuration ('id' or 'en'). Defaults to 'id'.
LOCALE=en

# Optional: only if you use FIND keyword
LOCAL_EMBEDDING_MODEL=./my-model-folder/all-MiniLM-L6-v2
HOSTED_EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
OPENAI_VECTOR_MODEL=your-vector-model-name

On HOSTED_EMBEDDING_MODEL embedding model will be downloaded when first FIND operation found.

Embedding model priority: LOCAL_EMBEDDING_MODEL, HOSTED_EMBEDDING_MODEL, OPENAI_VECTOR_MODEL

Usage

Once built and configured, execute any .l4 script using the CLI:

l4cli path/to/script.l4

Language Features

The execution, syntax, features, and tokenization/parsing specifications for the Swan L4 DSL are backed by the core parser and tokenizer located in the separate repository: swan-L4.

Core DSL Features

  • Indentation-based Scoping: Automatically detects majority-based indentation (spaces or tabs) to determine scope and block execution.
  • Strict Sequencing: Enforces structured script ordering (TITLE#DEFINE → Executable Statements).
  • Macro & Agent Calls: Supports #DEFINE directives for external API endpoints starting with CALL_ and agent routing starting with AGENT_.
  • Implicit Context Pipeline: Seamlessly tracks state through the global Context variable and processes {Context} template interpolation inside string arguments.
  • Localized Error Diagnostics: Supports multi-language translation (English and Indonesian) for syntax and semantic parser errors.

Please check out the swan-L4 repository for more information on the core language specifications, grammar details, parser features, and implementation files.

Editor Extensions

For syntax highlighting and language support when writing .l4 scripts, you can search for "SWAN L4 Language Support" in your editor's extension search panel, or install it directly: