dev-tools 6 min read

Lama2 - Free Plain-Text REST API Client for Teams

Lama2 describes REST APIs as plain-text .l2 files you commit to git. No subscriptions, no locked collections — just the CLI, your editor, and version control.

By
Share: X in
Lama2 plain-text API client product thumbnail

TL;DR

TL;DR: Lama2 is an open-source API client that stores requests as plain-text .l2 files, letting teams collaborate through git instead of a paid SaaS subscription.

Source and Accuracy Notes

⚠️ This section is MANDATORY. All links must be verified from actual source, not guessed.

What Is Lama2?

Most engineering teams start with Postman or Insomnia for API testing — then hit a wall when multiple developers need to share collections, track changes across time, or resolve merge conflicts in their API configs. SaaS API clients solve collaboration but lock you into a subscription and a proprietary format.

Lama2 takes a different approach. It specifies the .l2 syntax — a plain-text format for describing HTTP requests — and ships a CLI tool called l2 that executes those files. You store .l2 files in git, just like code. Teams collaborate through pull requests. The format is human-readable and editor-friendly from day one.

The README describes it as “Markdown for APIs.” You define a request in plain text, run it with l2, and share the file with teammates. No GUI required for core workflows, though VSCode and other editors have integration support.

Key features (verified from README)

  • Plain-text .l2 files — human-friendly syntax, learn the basics in minutes
  • l2 CLI — execute .l2 files directly from the terminal
  • Editor support — VSCode integration and documentation for building editor extensions
  • Git-native collaboration — share API repos, review changes via PRs
  • Code generation — convert .l2 definitions into Python, JavaScript, Java, and other languages
  • JavaScript chaining — embed JS blocks to chain multiple requests together
  • Postman import — convert existing Postman collections to .l2 format
  • Extensible parser — recursive descent parser based on a formal grammar; supports adding new syntax like websockets

Setup Workflow

Step 1: Install the CLI

Linux / macOS:

curl -s https://hexmos.com/lama2/install.sh | bash -s

Windows (PowerShell as Administrator):

choco install lama2 --version=1.0.0 --force -y

After installation, verify with:

l2 --version

Step 2: Create your first .l2 file

mkdir my-api && cd my-api

Create a file named hello.l2:

GET https://httpbin.org/get
--- _METADATA={
  "api_name": "Hello World",
  "description": "Test GET request to httpbin"
}

Step 3: Run the request

l2 hello.l2

Lama2 prints the full HTTP response — status code, headers, and body — directly in the terminal.

Step 4: Commit to git

git init
git add hello.l2
git commit -m "Add hello world endpoint"

Share the repo with your team. Teammates pull, edit .l2 files, and submit PRs — just like code.

Step 5: Import from Postman (optional)

If you have existing Postman collections:

l2 import path/to/collection.json

This converts the Postman export into a directory of .l2 files.

Deeper Analysis

Why plain-text API definitions?

Proprietary API client formats (Postman’s JSON, Insomnia’s YAML) work fine for individuals but create friction in teams:

  • No meaningful diffs — comparing two versions of a Postman collection produces unreadable JSON noise
  • Lock-in — leaving a SaaS plan means losing your history
  • Conflict-prone — two developers editing the same collection will fight over merge conflicts

Lama2’s .l2 format is line-based plain text. A git diff shows exactly which request changed and how. Git merge strategies apply cleanly. The file is readable without any tool installed.

The .l2 syntax

From the official grammar, a request has this structure:

METHOD https://host/path
{ "json": "body" }
--- _METADATA={
  "key": "value"
}

Headers, query params, and authentication are all expressed as plain-text blocks. The syntax docs cover the full format.

Code generation

Running l2 --codegen python hello.l2 generates a Python requests library call from the .l2 definition. Supported targets include Python, JavaScript, Java, and others.

Self-update

l2 -u

Updates the l2 binary to the latest release on Linux and macOS.

Practical Evaluation Checklist

  • [ ] Installs via one command on Linux/macOS
  • [ ] l2 command available in PATH after install
  • [ ] Can create and execute a GET request from a .l2 file
  • [ ] .l2 file is readable as plain text without the CLI
  • [ ] Git diff on a .l2 file produces meaningful output
  • [ ] VSCode extension installs and provides syntax highlighting
  • [ ] Postman import converts collections to .l2 format
  • [ ] Code generation outputs working code in at least one target language

Security Notes

  • .l2 files may contain secrets (API keys, bearer tokens) in plain text — treat them like .env files: add *.l2 to .gitignore if they hold credentials, or use environment variable substitution
  • The CLI executes HTTP requests defined in .l2 files — only run l2 on files you trust or have reviewed
  • No telemetry or phone-home behavior mentioned in the README; the project is self-contained Go binaries

FAQ

Q: How does Lama2 compare to Postman? A: Postman is a GUI-first SaaS product with a free tier that locks collections into its format. Lama2 is CLI-first, stores requests as plain text, and has no subscription. The trade-off is a gentler learning curve in Postman’s GUI versus Lama2’s faster team workflows through git.

Q: Can I use Lama2 without a terminal? A: The core workflow is CLI-driven, but the project has VSCode integration and documentation for building editor extensions. A full GUI is not the primary focus.

Q: Does Lama2 support WebSockets or GraphQL? A: The parser is extensible and built on a formal grammar. The README notes websockets as a potential future addition. GraphQL support is not mentioned in current docs.

Q: Is there a hosted or SaaS version? A: No — Lama2 is fully self-hosted. You run the CLI and manage your .l2 files yourself.

Q: What is the license? A: AGPL-3.0 (verified from the LICENSE file in the repository).

Conclusion

Lama2 solves the team API-client problem by removing the GUI and proprietary format entirely. If your team already uses git for everything from infrastructure code to documentation, storing API definitions as .l2 files fits naturally. The CLI is lightweight, the format is human-readable, and there is no subscription to manage.

The product is young (v1.6.16, 124 GitHub stars) and the ecosystem is small — editor integrations are documented but not as polished as Postman’s. If you want a free, open-source alternative to Postman for a git-fluent team, Lama2 is worth a weekend pilot. If you need a full-featured GUI with mock servers and automated test runners, stick with Postman’s free tier for now.

Project page: hexmos.com/lama2 Source: github.com/HexmosTech/Lama2 (AGPL-3.0, v1.6.16)