lagune
Lagune's Security-Driven Hardening commands, from the repository that authors them.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/wellwelwel/lagune with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/wellwelwel/lagune'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/wellwelwel--lagune)HTML
<a href="/listings/wellwelwel--lagune"><img src="/api/listings/wellwelwel--lagune/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Pick your agent:
<table> <tr> <th width="50%" align="left">Install</th> <th width="50%" align="left">Update</th> </tr> <tr> <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/claude.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/claude-code"><b>Claude Code</b></a></td> </tr> <tr> <td>
claude plugin install lagune --marketplace wellwelwel/lagune
</td> <td>
claude plugin marketplace update lagune claude plugin update lagune@lagune
</td> </tr> <tr> <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/claude.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/claude-code"><b>Claude Code Extension</b></a></td> </tr> <tr> <td>
- Type `/plugin` and select **Manage plugins**. - Add `wellwelwel/lagune` on the **Marketplaces** tab. - Install `lagune` on the **Plugins** tab.
</td> <td>
- Type `/plugin` and select **Manage plugins**. - Open the **Marketplaces** tab. - Select the refresh icon on `lagune`.
</td> </tr> <tr> <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/codex.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/codex"><b>Codex</b></a></td> </tr> <tr> <td>
codex plugin marketplace add wellwelwel/lagune codex plugin add lagune@lagune
</td> <td>
codex plugin marketplace upgrade lagune
</td> </tr> </table>
- <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/antigravity.svg" width="20" align="absmiddle" /></picture> [**Antigravity**](https://lagune.ai/docs/install/antigravity-cli) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/cursor.svg" width="20" align="absmiddle" /></picture> [**Cursor**](https://lagune.ai/docs/install/cursor) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/devin.svg" width="20" align="absmiddle" /></picture> [**Devin for Terminal**](https://lagune.ai/docs/install/devin-cli) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/droid.svg" width="20" align="absmiddle" /></picture> [**Factory Droid**](https://lagune.ai/docs/install/factory-droid) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/gemini.svg" width="20" align="absmiddle" /></picture> [**Gemini CLI**](https://lagune.ai/docs/install/gemini-cli) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/copilot.svg" width="20" align="absmiddle" /></picture> [**GitHub Copilot**](https://lagune.ai/docs/install/github-copilot-cli) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/grok.svg" width="20" align="absmiddle" /></picture> [**Grok Build**](https://lagune.ai/docs/install/grok-build) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/hermes.svg" width="20" align="absmiddle" /></picture> [**Hermes Agent**](https://lagune.ai/docs/install/hermes-agent) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/kimi.svg" width="20" align="absmiddle" /></picture> [**Kimi Code**](https://lagune.ai/docs/install/kimi-code) - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/muse.svg" width="20" align="absmiddle" /></picture> [**Muse Code**](https://lagune.ai/docs/install/muse-code)
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 32 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "name": "lagune",
- "description": "Lagune's Security-Driven Hardening commands, from the repository that authors them.",
- "owner": {
- "name": "Weslley Araújo"
- },
- "plugins": [
- {
- "name": "lagune",
- "source": {
- "source": "url",
- "url": "https://github.com/wellwelwel/lagune.git",
- "ref": "plugin-claude"
- },
- "description": "🪼 Your security copilot as you build, your Blue Team when you audit, whether you're a developer or not.",
- "category": "security",
- "tags": [
- "security",
- "blue-team",
- "sdh",
- "sdd",
- "security-driven-hardening",
- "spec-driven-development",
- "audit",
- "hardening",
- "coding",
- "best-practices",
- "agent-skills"
- ]
- }
- ]
- }
README.md · README · 363 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <div align="center">
- # 🪼 Lagune [AI](https://lagune.ai)
- [](https://lagune.ai)
- [](https://www.npmjs.com/package/lagune)
- [](https://www.npmjs.com/package/lagune)
- [](https://lagune.ai/docs)
- Instead of running a generic checklist, what if security existed **before**, **during**, and **after** development?
- ---
- [**Give us a ⭐ on GitHub**](https://github.com/wellwelwel/lagune)<br />
- It helps more people discover the project.
- ---
- #### 📘 Documentation
- <a href="https://lagune.ai/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/us.svg" alt="English" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/pt-BR/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/br.svg" alt="Português (Brasil)" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/es-ES/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/es.svg" alt="Español (España)" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/de-DE/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/de.svg" alt="Deutsch" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/fr-FR/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/fr.svg" alt="Français" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/it-IT/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/it.svg" alt="Italiano" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/tr-TR/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/tr.svg" alt="Türkçe" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/uk-UA/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/ua.svg" alt="Українська" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/ru-RU/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/ru.svg" alt="Русский" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/zh-CN/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/cn.svg" alt="简体中文" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/ja-JP/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/jp.svg" alt="日本語" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/ko-KR/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/kr.svg" alt="한국어" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/hi-IN/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/in.svg" alt="हिन्दी" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/id-ID/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/id.svg" alt="Bahasa Indonesia" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/th-TH/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/th.svg" alt="ไทย" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/da-DK/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/dk.svg" alt="Dansk" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/no-NO/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/no.svg" alt="Norsk" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/pl-PL/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/pl.svg" alt="Polski" width="32" align="absmiddle" /></a>
- <a href="https://lagune.ai/ar-AE/docs"><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flags/ae.svg" alt="العربية" width="32" align="absmiddle" /></a>
- ---
- <img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/flow.svg" width="100%" alt="An AI agent running Lagune: a project charter, a secure user sign-up, and a Blue Team audit" />
- </div>
- ---
- ## Get Started
- ### Install and Update
- Pick your agent:
- <table>
- <tr>
- <th width="50%" align="left">Install</th>
- <th width="50%" align="left">Update</th>
- </tr>
- <tr>
- <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/claude.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/claude-code"><b>Claude Code</b></a></td>
- </tr>
- <tr>
- <td>
- ```bash
- claude plugin install lagune --marketplace wellwelwel/lagune
- ```
- </td>
- <td>
- ```bash
- claude plugin marketplace update lagune
- claude plugin update lagune@lagune
- ```
- </td>
- </tr>
- <tr>
- <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/claude.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/claude-code"><b>Claude Code Extension</b></a></td>
- </tr>
- <tr>
- <td>
- - Type `/plugin` and select **Manage plugins**.
- - Add `wellwelwel/lagune` on the **Marketplaces** tab.
- - Install `lagune` on the **Plugins** tab.
- </td>
- <td>
- - Type `/plugin` and select **Manage plugins**.
- - Open the **Marketplaces** tab.
- - Select the refresh icon on `lagune`.
- </td>
- </tr>
- <tr>
- <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/codex.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/codex"><b>Codex</b></a></td>
- </tr>
- <tr>
- <td>
- ```bash
- codex plugin marketplace add wellwelwel/lagune
- codex plugin add lagune@lagune
- ```
- </td>
- <td>
- ```bash
- codex plugin marketplace upgrade lagune
- ```
- </td>
- </tr>
- <tr>
- <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/vercel.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/universal"><b>Universal (skills.sh)</b></a></td>
- </tr>
- <tr>
- <td>
- ```bash
- npx skills add wellwelwel/lagune -y
- ```
- </td>
- <td>
- ```bash
- npx skills update
- ```
- </td>
- </tr>
- <tr>
- <td colspan="2"><picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/github.svg" width="20" align="absmiddle" /></picture> <a href="https://lagune.ai/docs/install/universal"><b>Universal (GitHub CLI)</b></a></td>
- </tr>
- <tr>
- <td>
- ```bash
- gh skill install wellwelwel/lagune --all --scope project
- ```
- </td>
- <td>
- ```bash
- gh skill update --all
- ```
- </td>
- </tr>
- </table>
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/antigravity.svg" width="20" align="absmiddle" /></picture> [**Antigravity**](https://lagune.ai/docs/install/antigravity-cli)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/cursor.svg" width="20" align="absmiddle" /></picture> [**Cursor**](https://lagune.ai/docs/install/cursor)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/devin.svg" width="20" align="absmiddle" /></picture> [**Devin for Terminal**](https://lagune.ai/docs/install/devin-cli)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/droid.svg" width="20" align="absmiddle" /></picture> [**Factory Droid**](https://lagune.ai/docs/install/factory-droid)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/gemini.svg" width="20" align="absmiddle" /></picture> [**Gemini CLI**](https://lagune.ai/docs/install/gemini-cli)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/copilot.svg" width="20" align="absmiddle" /></picture> [**GitHub Copilot**](https://lagune.ai/docs/install/github-copilot-cli)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/grok.svg" width="20" align="absmiddle" /></picture> [**Grok Build**](https://lagune.ai/docs/install/grok-build)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/hermes.svg" width="20" align="absmiddle" /></picture> [**Hermes Agent**](https://lagune.ai/docs/install/hermes-agent)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/kimi.svg" width="20" align="absmiddle" /></picture> [**Kimi Code**](https://lagune.ai/docs/install/kimi-code)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/muse.svg" width="20" align="absmiddle" /></picture> [**Muse Code**](https://lagune.ai/docs/install/muse-code)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/opencode.svg" width="20" align="absmiddle" /></picture> [**OpenCode**](https://lagune.ai/docs/install/opencode)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/pi.svg" width="20" align="absmiddle" /></picture> [**Pi**](https://lagune.ai/docs/install/pi)
- - <picture><img src="https://raw.githubusercontent.com/wellwelwel/lagune/main/.github/readme/assets/agents/qwen.svg" width="20" align="absmiddle" /></picture> [**Qwen Code**](https://lagune.ai/docs/install/qwen-code)
- > [!NOTE]
- >
- > - See the [**Install**](https://lagune.ai/docs) section for **detailed instructions**.
- > - [**Migrate from previous Lagune**](https://lagune.ai/docs/commands/migrate) manifest-based setup.
- ---
- ### Skills
- Once installed, your **AI** agent unlocks a set of commands, all governed by the **charter**: secure new work as you build it, or run the full audit over a project.
- > [!TIP]
- >
- > See real-world [**Prompt Samples**](https://lagune.ai/docs/examples/prompts) 🪼
- #### › First use
- Start here, before building or auditing:
- | Skill | What it does for you |
- | -------------------------------------------------------------- | ------------------------------------------------------------------------------ |
- | [**/lagune-charter**](https://lagune.ai/docs/commands/charter) | Sets your project's security rules, the foundation every other skill builds on |
- ##### Examples
- ```md
- /lagune-charter
- ```
- ```md
- /lagune-charter @<PRD.md>
- ```
- ```md
- /lagune-charter <describe your project and what it does>
- ```
- #### › Build _(Universal)_
- Harden the work as you write it, with no flow to follow:
- | Skill | What it does for you |
- | ----------------------------------------------------- | -------------------------------------------------------------------------- |
- | [**/lagune**](https://lagune.ai/docs/commands/lagune) | Builds what you ask and hardens it as it is written, guided by the charter |
- ##### Examples
- ```md
- /lagune let users upload a custom photo on their profile.
- ```
- ```md
- /lagune nothing happens when the user submits the form. Look into what it might be and fix it.
- ```
- ```md
- /lagune decouple and improve the payload logic
- ```
- #### › Audit: the Blue Team flow
- These five run in order. Each builds on the previous, so following the list top to bottom is all it takes:
- | # | Skill | What it does for you |
- | --- | -------------------------------------------------------------- | ------------------------------------------------------------------------------ |
- | 1 | [**/lagune-charter**](https://lagune.ai/docs/commands/charter) | Sets your project's security rules, proposed for you or shaped by what you say |
- | 2 | [**/lagune-detect**](https://lagune.ai/docs/commands/detect) | Reads your code and maps what your system does and where the risks are |
- | 3 | [**/lagune-plan**](https://lagune.ai/docs/commands/plan) | Turns what detect found into a defense plan, with a fix for each finding |
- | 4 | [**/lagune-harden**](https://lagune.ai/docs/commands/harden) | Applies the plan's fixes to your code, safely and one at a time |
- | 5 | [**/lagune-verify**](https://lagune.ai/docs/commands/verify) | Proves each applied fix holds and closes out the ones that do |
- ##### Examples
- ```md
- You are a cybersecurity orchestrator:
- - 0th sub-agent: /lagune-charter (only if no charter exists)
- - 1st sub-agent: /lagune-detect
- - 2nd sub-agent: /lagune-plan
- - 3rd sub-agent: /lagune-harden
- - 4th sub-agent: /lagune-verify
- Loop: re-run harden and verify sub-agents until all findings are closed.
- ```
- Combine them with your own skills, for example:
- ```md
- // ...
- - 3rd sub-agent: /lagune-harden /engineering
- - 4th sub-agent: /lagune-verify /code-review
- ```
- #### › Special skills
- | Skill | What it does |
- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
- | [**/lagune-specialize**](https://lagune.ai/docs/commands/specialize) | Teaches **Lagune** a new security specialization from articles, exploits, or topics |
- | [**/lagune-prove**](https://lagune.ai/docs/commands/prove) | Turns each detected finding into a runnable, defense-only proof for responsible disclosure |
- > [!TIP]
- >
- > Security is not a cost, it is an investment: what you put in upfront, you save many times over in the incidents you never have 🙋🏻♂️
- > [!NOTE]
- >
- > Some agents take the commands under the plugin's name, such as `/lagune:lagune-charter`. Your agent's [**install page**](https://lagune.ai/docs) shows how to type them.
- > [!IMPORTANT]
- >
- > See the full [**documentation**](https://lagune.ai/) for usage examples and more.
- ---
- ### Dashboard
- For an interactive live view of `.lagune/`, run:
- ```bash
- npx lagune
- ```
- It serves a dashboard and opens it on a random port:
- - [x] **Live Reload**
- - [x] **Private** and **Local**
- - [x] Follow the findings, fixes, and verdicts, and manage the categories, directly from your browser
- - [x] No `node_modules` or `package.json` is needed 📦
- <details>
- <summary>Overview</summary>
- <br />
- <img width="320" src="https://raw.githubusercontent.com/wellwelwel/lagune/main/website/static/img/dashboard/02.png" />
- <img width="320" src="https://raw.githubusercontent.com/wellwelwel/lagune/main/website/static/img/dashboard/03.png" />
- <img width="320" src="https://raw.githubusercontent.com/wellwelwel/lagune/main/website/static/img/dashboard/04.png" />
- <img width="320" src="https://raw.githubusercontent.com/wellwelwel/lagune/main/website/static/img/dashboard/05.png" />
- <img width="320" src="https://raw.githubusercontent.com/wellwelwel/lagune/main/website/static/img/dashboard/06.png" />
- </details>
- > [!TIP]
- >
- > - 🚪 Use `--port` to specify a custom port.
- > - ⏏️ Press `Ctrl+C` to stop.
- ---
- ## Requirements
- You will need [**Node.js (LTS)**](https://nodejs.org/en/download/package-manager) installed on your system.
- ---
- ## Security
- To report a vulnerability and see the supported versions, check the [**Security Policy**](https://github.com/wellwelwel/lagune/blob/main/SECURITY.md).
- ---
- ## Contributing
- See the [**Contributing Guide**](https://github.com/wellwelwel/lagune/blob/main/CONTRIBUTING.md) and please follow our [**Code of Conduct**](https://github.com/wellwelwel/lagune/blob/main/CODE_OF_CONDUCT.md) 🚀
- ---
- ## Acknowledgements
- ### Partners
- Partners get an exclusive logo across the repositories and landing pages, plus a spot on a dedicated partners page.
- > Help my work grow by [**becoming a partner**](https://weslley.io/?partners) 🖖
- ### Supporters
- Really thanks to everyone who has supported and keeps supporting my work.
- [](https://github.com/sponsors/wellwelwel)
- > Support my work by [**becoming a sponsor**](https://github.com/sponsors/wellwelwel) too ✨
- ---
- ## License
- **Lagune** is under the [**Apache License 2.0**](https://github.com/wellwelwel/lagune/blob/main/LICENSE).<br />
- Copyright © 2026-present [**Weslley Araújo**](https://github.com/wellwelwel) and [**contributors**](https://github.com/wellwelwel/lagune/graphs/contributors).
- All product names, trademarks, and registered trademarks mentioned are the property of their respective owners and are used for identification purposes only.
scripts/playground/agents.sh · Bundled script · 728 lines · 2 findings marked
- #!/usr/bin/env bash
- set -euo pipefail
- repository="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
- tools="$repository/tools/playground"
- fixture="$repository/.claude/skills/simulate/fixtures/image-upload-service"
- root="${LAGUNE_PLAYGROUND:-$HOME/.lagune-playground}"
- keysFile="$root/keys.env"
- prompt='An image upload service for a small team'
- agents='droid grok gemini qwen opencode pi cursor antigravity copilot kimi'
- export GIT_AUTHOR_NAME='Lagune playground' GIT_AUTHOR_EMAIL='playground@lagune.invalid'
- export GIT_COMMITTER_NAME='Lagune playground' GIT_COMMITTER_EMAIL='playground@lagune.invalid'
- export COPYFILE_DISABLE=1
- usage() {
- cat << TEXT
- Usage: bash scripts/playground/agents.sh <agent> <action> [arguments]
- bash scripts/playground/agents.sh keys
- Agents:
- acceptance droid grok gemini qwen opencode pi cursor antigravity
- probe copilot kimi
- Actions:
- mount Build this tree, install what the release would publish for the agent
- into an isolated home, and copy the fixture into a fresh project.
- mount sign-in The same, with the agent's own sign-in instead of the keys file's BYOK.
- run [args] Start the agent in the project, with its isolated home.
- server on|off Put the engine's server back in the installed plugin, or take it out,
- and start a new measurement. Acceptance agents only.
- report Print the engine calls and the verdict, or what the probe received.
- keys Create the keys file, where your API keys and BYOK endpoint live.
- Everything lives under $root, outside the repository
- (override it with LAGUNE_PLAYGROUND). The agent's CLI comes from your PATH, or from
- LAGUNE_PLAYGROUND_BIN. Logins stay in each agent's isolated home across mounts.
- The agent starts with a clean environment, as outside any editor: only PATH, your user
- and shell, the terminal, the locale, proxy settings, and the keys file reach it.
- Claude Code keeps its own playground: bash scripts/playground/mount.sh
- TEXT
- }
- binaryName() {
- case "$1" in
- droid | grok | gemini | qwen | opencode | pi | copilot | kimi) echo "$1" ;;
- cursor) echo agent ;;
- antigravity) echo agy ;;
- *) return 1 ;;
- esac
- }
- installHint() {
- case "$1" in
- droid) echo 'npm install --global @factory/cli' ;;
- grok) echo 'npm install --global @xai-official/grok' ;;
- gemini) echo 'npm install --global @google/gemini-cli' ;;
- qwen) echo 'npm install --global @qwen-code/qwen-code' ;;
- opencode) echo 'npm install --global opencode-ai (1.x) or @opencode/cli (2.x)' ;;
- pi) echo 'npm install --global @earendil-works/pi-coding-agent' ;;
- cursor) echo 'curl https://cursor.com/install -fsS | bash' ;;
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 61 on GitHub
- antigravity) echo 'curl -fsSL https://antigravity.google/cli/install.sh | bash' ;;
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 62 on GitHub
- copilot) echo 'npm install --global @github/copilot' ;;
- kimi) echo 'npm install --global @moonshot-ai/kimi-code' ;;
- esac
- }
- isProbe() {
- [[ "$1" == copilot || "$1" == kimi ]]
- }
- hasByok() {
- [[ -n "${LAGUNE_BYOK_BASE_URL:-}" && -n "${LAGUNE_BYOK_API_KEY:-}" && -n "${LAGUNE_BYOK_MODEL:-}" ]] && ! signsIn
- }
- signsIn() {
- [[ "$(cat "$state/model" 2> /dev/null)" == sign-in ]]
- }
- createKeysFile() {
- if [[ -f "$keysFile" ]]; then
- echo "The keys file already exists: $keysFile"
- return
- fi
- mkdir -p "$root"
- (
- umask 077
- cat > "$keysFile" << 'TEXT'
- # The Lagune playground reads this file on every mount and run. It lives outside the
- # repository and only you can read it. Uncomment and fill what you have, then mount again.
- # Keys exported by your shell never reach the agent, so every key it needs goes here.
- # BYOK: any OpenAI-compatible endpoint drives Factory Droid, Grok Build, Qwen Code,
- # OpenCode, and Pi with the same model. Examples of base URLs:
- # OpenRouter https://openrouter.ai/api/v1
- # OpenAI https://api.openai.com/v1
- # xAI https://api.x.ai/v1
- # Anthropic https://api.anthropic.com/v1
- # Google https://generativelanguage.googleapis.com/v1beta/openai
- # The model is its id as the provider names it, such as one listed at openrouter.ai/models.
- # LAGUNE_BYOK_BASE_URL=https://openrouter.ai/api/v1
- # LAGUNE_BYOK_API_KEY=
- # LAGUNE_BYOK_MODEL=
- # Gemini CLI and Antigravity CLI: a key from https://aistudio.google.com/apikey
- # GEMINI_API_KEY=
- # Cursor CLI: a user API key from https://cursor.com/dashboard/api, since its sign-in
- # needs the macOS keychain, which the isolated home cannot reach.
- # CURSOR_API_KEY=
- TEXT
- )
- echo "Created $keysFile. Fill it in, then mount the agent again."
- }
- if [[ "${1:-}" == keys ]]; then
- createKeysFile
- exit 0
- fi
- agent="${1:-}"
- action="${2:-}"
- if [[ -z "$agent" || -z "$action" ]]; then
- usage
- exit 0
- fi
- if ! binaryName "$agent" > /dev/null; then
- echo "Unknown agent \"$agent\". Choose one of: $agents." >&2
- exit 1
- fi
- shift 2
- state="$root/$agent"
- project="$state/project"
- calls="$state/engine-calls.jsonl"
- measurements="$state/measurements"
- probeLog="$state/probe.jsonl"
- registryProcess=''
- resolveBinary() {
- local name found
- name="$(binaryName "$agent")"
- found="${LAGUNE_PLAYGROUND_BIN:-$(command -v "$name" || true)}"
- if [[ -z "$found" && "$agent" == cursor ]]; then
- found="$(command -v cursor-agent || true)"
- fi
- if [[ -z "$found" ]]; then
- echo "The $agent CLI ($name) is not on your PATH. Install it with: $(installHint "$agent")" >&2
- exit 1
- fi
- binary="$found"
- }
- keepsVariable() {
- case "$1" in
- PATH | PWD | SHELL | USER | LOGNAME | TERM | COLORTERM | LANG | LC_* | TZ) return 0 ;;
- HTTP_PROXY | HTTPS_PROXY | NO_PROXY | ALL_PROXY | http_proxy | https_proxy | no_proxy | all_proxy) return 0 ;;
- NODE_EXTRA_CA_CERTS | SSL_CERT_FILE | SSL_CERT_DIR) return 0 ;;
- LAGUNE_PLAYGROUND | LAGUNE_PLAYGROUND_BIN | GIT_AUTHOR_* | GIT_COMMITTER_* | COPYFILE_DISABLE) return 0 ;;
- esac
- return 1
- }
- clearEnvironment() {
- local name
- for name in $(compgen -e); do
- keepsVariable "$name" || unset "$name" 2> /dev/null || true
- done
- }
- loadKeys() {
- if [[ -f "$keysFile" ]]; then
- set -a
- # shellcheck source=/dev/null
- . "$keysFile"
- set +a
- fi
- }
- isolate() {
- clearEnvironment
- loadKeys
- export HOME="$state/home"
- export XDG_CONFIG_HOME="$HOME/.config"
- export XDG_DATA_HOME="$HOME/.local/share"
- export XDG_CACHE_HOME="$HOME/.cache"
- export XDG_STATE_HOME="$HOME/.local/state"
- export TMPDIR="$state/tmp"
- export npm_config_cache="$HOME/.npm"
- export npm_config_prefix="$HOME/.npm-global"
- export PATH="$state/shadow:$PATH"
- mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME" "$TMPDIR" "$npm_config_prefix" "$state/shadow"
- printf '#!/bin/sh\necho "lagune: command not found" >&2\nexit 127\n' > "$state/shadow/lagune"
- chmod +x "$state/shadow/lagune"
- case "$agent" in
- droid) export FACTORY_DISABLE_KEYRING=1 FACTORY_DROID_AUTO_UPDATE_ENABLED=false ;;
- grok) export GROK_HOME="$HOME/.grok" GROK_DISABLE_AUTOUPDATER=1 ;;
- gemini) export GEMINI_CLI_HOME="$HOME" ;;
- qwen) export QWEN_HOME="$HOME/.qwen" ;;
- opencode) export OPENCODE_DISABLE_AUTOUPDATE=1 ;;
- pi) export PI_CODING_AGENT_DIR="$HOME/.pi/agent" ;;
- copilot) export COPILOT_HOME="$HOME/.copilot" ;;
- kimi) export KIMI_CODE_HOME="$HOME/.kimi-code" ;;
- esac
- }
- commitAll() {
- git -C "$1" add -A
- git -C "$1" commit --quiet --no-verify -m "$2"
- }
- buildEngine() {
- echo "Building this tree..."
- if ! (cd "$repository" && npm run build > "$state/build.log" 2>&1); then
- cat "$state/build.log" >&2
- exit 1
- fi
- version="$(node -p 'require(process.argv[1]).version' "$repository/package.json")"
- tarball="$state/pack/lagune-$version.tgz"
- rm -rf "$state/pack"
- mkdir -p "$state/pack"
- (cd "$repository" && npm pack --pack-destination "$state/pack" > /dev/null 2>&1)
- }
- freshProject() {
- rm -rf "$project"
- mkdir -p "$project"
- cp -R "$fixture/." "$project/"
- git -C "$project" init --quiet
- commitAll "$project" 'The image-upload-service fixture'
- }
- stagePinnedEngine() {
- local unpacked="$state/unpacked"
- rm -rf "$unpacked" "$state/registry" "$state/home/.npm/_npx"
- mkdir -p "$unpacked" "$state/registry"
- tar -xzf "$tarball" -C "$unpacked"
- node "$tools/instrument.ts" "$unpacked/package/lib/bin/index.js" "$calls" npx
- tar -czf "$state/registry/lagune-$version.tgz" -C "$unpacked" package
- echo "$version" > "$state/registry/latest"
- echo "$version" > "$state/pinned"
- rm -rf "$unpacked"
- }
- assembleBundle() {
- rm -rf "$state/bundle"
- (cd "$repository" && bash scripts/plugins/bundle.sh "$1" "$state/bundle")
- node "$tools/instrument.ts" "$state/bundle/lib/bin/index.js" "$calls" tools
- }
- publishBareRepository() {
- local branch="$1" bare="$state/lagune.git" work="$state/work"
- rm -rf "$bare" "$work" "$work-main"
- git init --quiet --bare --initial-branch=main "$bare"
- git init --quiet --initial-branch="$branch" "$work"
- cp -R "$state/bundle/." "$work/"
- commitAll "$work" "The $branch bundle"
- git -C "$work" push --quiet "$bare" "$branch"
- git init --quiet --initial-branch=main "$work-main"
- "$2" "$work-main"
- commitAll "$work-main" 'The default branch'
- git -C "$work-main" push --quiet "$bare" main
- rm -rf "$work" "$work-main"
- }
- writeDroidMain() {
- node "$tools/config.ts" droid-marketplace \
- "$repository/.factory-plugin/marketplace.json" \
- "$1/.factory-plugin/marketplace.json" \
- "file://$state/lagune.git"
- }
- writePlaceholderMain() {
- echo 'The plugin lives on its own branch.' > "$1/README.md"
- }
- stageNpmPackage() {
- local unpacked="$state/unpacked"
- stamped="$version-playground.$(date +%s)"
- rm -rf "$unpacked"
- mkdir -p "$unpacked"
- tar -xzf "$tarball" -C "$unpacked"
- node "$tools/config.ts" stamp-package "$unpacked/package" "$stamped"
- node "$tools/instrument.ts" "$unpacked/package/lib/bin/index.js" "$calls" tools
- tar -czf "$state/registry/lagune-$stamped.tgz" -C "$unpacked" package
- echo "$stamped" > "$state/registry/latest"
- rm -rf "$unpacked"
- }
- stopRegistry() {
- if [[ -n "$registryProcess" ]]; then
- kill "$registryProcess" 2> /dev/null || true
- wait "$registryProcess" 2> /dev/null || true
- registryProcess=''
- fi
- }
- startRegistry() {
- local attempt
- registryPort="$(node -e "const server = require('node:net').createServer(); server.listen(0, '127.0.0.1', () => { console.log(server.address().port); server.close(); });")"
- node "$tools/registry.ts" "$registryPort" "$state/registry" > "$state/registry.log" 2>&1 &
- registryProcess=$!
- trap stopRegistry EXIT
- for attempt in $(seq 1 50); do
- if curl -fsS "http://127.0.0.1:$registryPort/lagune" > /dev/null 2>&1; then
- export npm_config_registry="http://127.0.0.1:$registryPort/"
- echo "registry=$npm_config_registry" > "$HOME/.npmrc"
- return
- fi
- sleep 0.1
- done
- echo 'The local npm registry did not start.' >&2
- exit 1
- }
- openCodeMajor() {
- "$binary" --version 2> /dev/null | grep -oE '[0-9]+' | head -1
- }
- writeProbePlugin() {
- rm -rf "$state/probe-plugin"
- node "$tools/config.ts" probe-plugin "$agent" "$state/probe-plugin" "$(command -v node)" "$tools/probe.ts" "$probeLog"
- }
- installForAgent() {
- case "$agent" in
- droid)
- assembleBundle droid
- publishBareRepository plugin-droid writeDroidMain
- isolate
- cd "$HOME"
- "$binary" plugin uninstall lagune@lagune > /dev/null 2>&1 || true
- "$binary" plugin marketplace remove lagune > /dev/null 2>&1 || true
- "$binary" plugin marketplace add "file://$state/lagune.git"
- "$binary" plugin install lagune@lagune
- ;;
- grok)
- assembleBundle grok
- publishBareRepository plugin-grok writePlaceholderMain
- isolate
- cd "$HOME"
- "$binary" plugin uninstall lagune > /dev/null 2>&1 || true
- "$binary" plugin install "file://$state/lagune.git@plugin-grok" --trust
- ;;
- gemini)
- assembleBundle gemini
- isolate
- cd "$HOME"
- "$binary" extensions uninstall lagune > /dev/null 2>&1 || true
- printf 'y\n' | "$binary" extensions install "$state/bundle" --consent
- ;;
- qwen)
- stageNpmPackage
- isolate
- cd "$HOME"
- startRegistry
- "$binary" extensions uninstall lagune > /dev/null 2>&1 || true
- printf 'Y\n' | "$binary" extensions install lagune --registry "http://127.0.0.1:$registryPort"
- stopRegistry
- ;;
- opencode)
- stageNpmPackage
- isolate
- cd "$HOME"
- startRegistry
- node "$tools/config.ts" opencode-clear "$XDG_CONFIG_HOME/opencode/opencode.json" "$(openCodeMajor)"
- if [[ "$(openCodeMajor)" == 1 ]]; then
- "$binary" plugin "lagune@$stamped" -g --force
- else
- "$binary" plugin add "lagune@$stamped"
- "$binary" service stop > /dev/null 2>&1 || true
- fi
- stopRegistry
- ;;
- pi)
- stageNpmPackage
- isolate
- cd "$HOME"
- startRegistry
- "$binary" remove npm:lagune > /dev/null 2>&1 || true
- "$binary" install npm:lagune
- stopRegistry
- ;;
- cursor)
- assembleBundle cursor
- isolate
- rm -rf "$HOME/.cursor/plugins/local/lagune"
- mkdir -p "$HOME/.cursor/plugins/local"
- cp -R "$state/bundle" "$HOME/.cursor/plugins/local/lagune"
- ;;
- antigravity)
- assembleBundle antigravity
- isolate
- cd "$HOME"
- "$binary" plugin uninstall lagune > /dev/null 2>&1 || true
- "$binary" plugin install "$state/bundle"
- ;;
- copilot)
- writeProbePlugin
- isolate
- cd "$HOME"
- "$binary" plugin uninstall lagune-probe@lagune-probe > /dev/null 2>&1 || true
- "$binary" plugin marketplace remove lagune-probe > /dev/null 2>&1 || true
- "$binary" plugin marketplace add "$state/probe-plugin"
- "$binary" plugin install lagune-probe@lagune-probe
- ;;
- kimi)
- writeProbePlugin
- ;;
- esac
- }
- clearByok() {
- case "$agent" in
- droid) node "$tools/config.ts" clear-byok droid "$HOME/.factory/settings.json" ;;
- grok) node "$tools/config.ts" clear-byok grok "$GROK_HOME/config.toml" ;;
- qwen) node "$tools/config.ts" clear-byok qwen "$QWEN_HOME/settings.json" ;;
- opencode) node "$tools/config.ts" clear-byok opencode "$XDG_CONFIG_HOME/opencode/opencode.json" ;;
- pi) node "$tools/config.ts" clear-byok pi "$PI_CODING_AGENT_DIR/models.json" ;;
- esac
- }
- configureModel() {
- if signsIn; then
- clearByok
- return
- fi
- case "$agent" in
- gemini)
- if [[ -n "${GEMINI_API_KEY:-}" ]]; then
- node "$tools/config.ts" select-auth "$HOME/.gemini/settings.json" gemini-api-key
- fi
- ;;
- droid)
- if hasByok; then
- node "$tools/config.ts" byok-droid "$HOME/.factory/settings.json" "$LAGUNE_BYOK_BASE_URL" "$LAGUNE_BYOK_API_KEY" "$LAGUNE_BYOK_MODEL"
- fi
- ;;
- grok)
- if hasByok; then
- node "$tools/config.ts" byok-grok "$GROK_HOME/config.toml" "$LAGUNE_BYOK_BASE_URL" "$LAGUNE_BYOK_API_KEY" "$LAGUNE_BYOK_MODEL"
- fi
- ;;
- qwen)
- if hasByok; then
- node "$tools/config.ts" select-auth "$QWEN_HOME/settings.json" openai
- fi
- ;;
- opencode)
- if hasByok; then
- node "$tools/config.ts" byok-opencode "$XDG_CONFIG_HOME/opencode/opencode.json" "$(openCodeMajor)" "$LAGUNE_BYOK_BASE_URL" "$LAGUNE_BYOK_API_KEY" "$LAGUNE_BYOK_MODEL"
- fi
- ;;
- pi)
- if hasByok; then
- node "$tools/config.ts" byok-pi "$PI_CODING_AGENT_DIR/models.json" "$LAGUNE_BYOK_BASE_URL" "$LAGUNE_BYOK_API_KEY" "$LAGUNE_BYOK_MODEL"
- fi
- ;;
- esac
- }
- modelNote() {
- case "$agent" in
- gemini | antigravity)
- if [[ -n "${GEMINI_API_KEY:-}" ]]; then
- echo 'the Gemini API key from the keys file'
- elif [[ "$agent" == gemini ]]; then
- echo 'none yet: Gemini CLI takes a paid Gemini API key or a Code Assist Standard or Enterprise sign-in, since free, AI Pro, and AI Ultra accounts moved to Antigravity CLI. Put GEMINI_API_KEY in the keys file and mount again'
- else
- echo 'your Google sign-in, on the first session'
- fi
- ;;
- droid | grok | qwen | opencode | pi)
- if signsIn; then
- echo "your own sign-in, on the first run, since this mount skips BYOK"
- elif hasByok; then
- echo "BYOK, $LAGUNE_BYOK_MODEL at $LAGUNE_BYOK_BASE_URL, preselected as \"Playground\""
- else
- echo "the agent's own sign-in, on the first run, or BYOK: fill LAGUNE_BYOK_* in the keys file and mount again"
- fi
- ;;
- cursor)
- if [[ -n "${CURSOR_API_KEY:-}" ]]; then
- echo 'the Cursor API key from the keys file'
- else
- echo 'none yet: put CURSOR_API_KEY in the keys file, since agent login needs the macOS keychain, which the isolated home cannot reach'
- fi
- ;;
- copilot | kimi) echo 'your account, with /login on the first session if the agent asks' ;;
- esac
- }
- invocation() {
- case "$agent" in
- gemini | qwen | antigravity) echo "/lagune:lagune-charter $prompt" ;;
- pi) echo "/skill:lagune-charter $prompt" ;;
- opencode)
- if [[ "$(openCodeMajor)" == 1 ]]; then
- echo "/lagune-charter $prompt"
- else
- echo "@lagune-charter, picked from the @ menu, then: $prompt"
- fi
- ;;
- *) echo "/lagune-charter $prompt" ;;
- esac
- }
- printNextSteps() {
- local command="bash scripts/playground/agents.sh $agent"
- echo
- echo "Mounted $agent ($binary)."
- echo "Project: $project"
- echo "Home: $state/home, where the agent keeps its login"
- echo "Model: $(modelNote)"
- if [[ ! -f "$keysFile" ]]; then
- echo "Keys: no keys file yet. Create it with: bash scripts/playground/agents.sh keys"
- fi
- echo
- if isProbe "$agent"; then
- echo "1. Start it: $command run"
- if [[ "$agent" == kimi ]]; then
- echo " In the session: /plugins install $state/probe-plugin, choose Trust and install, then /new"
- fi
- echo '2. Ask it: "Call the where tool of the lagune-probe server."'
- echo "3. See what the plugin server received: $command report"
- return
- fi
- echo "1. Start it: $command run"
- echo "2. Type: $(invocation)"
- echo ' Answer each permission prompt as it comes. Allow nothing up front.'
- echo "3. Read the verdict: $command report"
- echo "4. Take the server out, then repeat 1 to 3: $command server off"
- }
- mount() {
- local choice="${1:-byok}"
- if [[ "$choice" != byok && "$choice" != sign-in ]]; then
- echo 'Usage: mount [sign-in]' >&2
- exit 1
- fi
- if [[ ! -d "$fixture" ]]; then
- echo "The fixture is missing: $fixture" >&2
- exit 1
- fi
- resolveBinary
- mkdir -p "$state"
- echo "$choice" > "$state/model"
- freshProject
- if ! isProbe "$agent"; then
- buildEngine
- stagePinnedEngine
- fi
- rm -rf "$measurements"
- : > "$calls"
- : > "$probeLog"
- echo on > "$state/mode"
- installForAgent
- configureModel
- printNextSteps
- }
- switchFile() {
- if [[ "$1" == off && -e "$2" ]]; then
- mv "$2" "$2.off"
- fi
- if [[ "$1" == on && -e "$2.off" ]]; then
- mv "$2.off" "$2"
- fi
- }
- saveMeasurement() {
- if [[ -s "$calls" ]]; then
- mkdir -p "$measurements"
- mv "$calls" "$measurements/$(date +%H%M%S)-$(cat "$state/mode" 2> /dev/null || echo on).jsonl"
- fi
- : > "$calls"
- }
- switchServer() {
- local wanted="${1:-}" file
- if [[ "$wanted" != on && "$wanted" != off ]]; then
- echo 'Usage: server on|off' >&2
- exit 1
- fi
- if isProbe "$agent"; then
- echo "The $agent probe has no engine server to switch." >&2
- exit 1
- fi
- resolveBinary
- isolate
- case "$agent" in
- droid)
- while IFS= read -r file; do
- switchFile "$wanted" "${file%.off}"
- done < <(find "$HOME/.factory/plugins" \( -name mcp.json -o -name mcp.json.off \) -path '*lagune*' 2> /dev/null)
- ;;
- grok)
- for file in "$GROK_HOME"/installed-plugins/lagune-*/.mcp.json "$GROK_HOME"/installed-plugins/lagune-*/.mcp.json.off; do
- if [[ -e "$file" ]]; then
- switchFile "$wanted" "${file%.off}"
- fi
- done
- ;;
- gemini) node "$tools/config.ts" extension-server "$HOME/.gemini/extensions/lagune/gemini-extension.json" "$wanted" ;;
- qwen) node "$tools/config.ts" extension-server "$QWEN_HOME/extensions/lagune/qwen-extension.json" "$wanted" ;;
- opencode) node "$tools/config.ts" opencode-tools "$XDG_CONFIG_HOME/opencode/opencode.json" "$(openCodeMajor)" "$wanted" ;;
- pi) switchFile "$wanted" "$PI_CODING_AGENT_DIR/npm/node_modules/lagune/lib/plugins/pi.js" ;;
- cursor) switchFile "$wanted" "$HOME/.cursor/plugins/local/lagune/mcp.json" ;;
- antigravity) switchFile "$wanted" "$HOME/.gemini/config/plugins/lagune/mcp_config.json" ;;
- esac
- saveMeasurement
- echo "$wanted" > "$state/mode"
- echo "Server $wanted. A new measurement starts, and report keeps the earlier ones. Start a new session with: bash scripts/playground/agents.sh $agent run"
- }
- runAgent() {
- if [[ ! -d "$project" ]]; then
- echo "Mount it first: bash scripts/playground/agents.sh $agent mount" >&2
- exit 1
- fi
- resolveBinary
- isolate
- cd "$project"
- if ! isProbe "$agent"; then
- startRegistry
- fi
- if [[ "$agent" == qwen ]] && hasByok; then
- export OPENAI_BASE_URL="$LAGUNE_BYOK_BASE_URL" OPENAI_API_KEY="$LAGUNE_BYOK_API_KEY" OPENAI_MODEL="$LAGUNE_BYOK_MODEL"
- fi
- if [[ "$agent" == pi && $# -eq 0 ]] && hasByok; then
- set -- --provider playground --model "$LAGUNE_BYOK_MODEL"
- fi
- "$binary" ${@+"$@"}
- }
- reportMeasurements() {
- local version file name
- version="$(cat "$state/pinned" 2> /dev/null || echo unknown)"
- for file in "$measurements"/*.jsonl; do
- if [[ -e "$file" ]]; then
- name="$(basename "$file" .jsonl)"
- echo "Saved when the server switched at ${name:0:2}:${name:2:2}:${name:4:2}"
- node "$tools/report.ts" calls "$file" "$project" "${name##*-}" "$version"
- echo
- fi
- done
- echo 'Current measurement'
- node "$tools/report.ts" calls "$calls" "$project" "$(cat "$state/mode" 2> /dev/null || echo on)" "$version"
- }
- report() {
- if [[ "$agent" == copilot ]]; then
- node "$tools/report.ts" probe "$probeLog" "$project" probe-plain probe-vars
- elif [[ "$agent" == kimi ]]; then
- node "$tools/report.ts" probe "$probeLog" "$project" probe-plain probe-vars probe-node
- else
- reportMeasurements
- fi
- }
- case "$action" in
- mount) mount "${1:-}" ;;
- run) runAgent ${@+"$@"} ;;
- server) switchServer "${1:-}" ;;
- report) report ;;
- *)
- usage
- exit 1
- ;;
- esac
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.