Stably Cli logo

Stably Cli

Community
exiao
stably-cli

Use the Stably CLI to create, run, fix, and maintain Playwright tests in the bloom-tests repo. Use when running tests (stably test), auto-fixing failures (stably fix), or generating new tests from a prompt (stably create).

Overview

Publisherexiao
Repositoryskills
Skill namestably-cli
Stars
40
Forks
12
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by exiao on GitHub. Read the source before you install it.

Installation

Install the Stably Cli AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/exiao/skills/tree/main/external-services/stably-cli
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/exiao/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/external-services/stably-cli .claude/skills/stably-cli
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Stably Cli in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Stably Cli on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Stably Cli is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Stably CLI

Source: https://skills.sh/stablyai/agent-skills/stably-cli

AI-assisted Playwright test management: create, run, fix, and maintain tests via CLI.

Pre-flight

bash
stably --version   # verify installed
# If not found: npm install -g stably

Requires Node.js 20+, Playwright, and a Stably account.

Command Reference

IntentCommand
Generate test from promptstably create "description"
Generate test from branch diffstably create (no prompt)
Run testsstably test
Run tests with remote envstably --env staging test
Fix failing testsstably fix [runId]
List recent runsstably runs list
View run detailsstably runs view <runId>
Initialize projectstably init
Install browsersstably install [--with-deps]
List remote environmentsstably env list
Inspect env variablesstably env inspect <name>
Authstably login / logout / whoami
Update CLIstably upgrade [--check]

Do NOT run stably (no args) — that's an interactive AI chat for humans only.

Global Options

OptionDescription
--cwd <path> / -CChange working directory
--env <name>Load vars from remote Stably environment
--env-file <path>Load vars from local file (repeatable)
--verbose / -vVerbose logging
--no-telemetryDisable telemetry

Env var precedence (highest to lowest): Stably auth (STABLY_API_KEY) > --env > --env-file > process.env

Inspecting Runs

Use stably runs to investigate failures without browser auth (dashboard requires login we can't automate):

bash
stably runs list                    # recent runs with status
stably runs view <runId>            # details: status, branch, commit, pass/fail/timeout counts, failed test names + errors

The run ID is the slug from the dashboard URL (e.g. ss8xdbaac1rcwm3ikcnkge0u from .../history/ss8xdbaac1rcwm3ikcnkge0u).

Core Commands

stably create [prompt...]

Generates tests from a prompt or infers from branch diff when no prompt given.

bash
stably create "test the checkout flow"
stably create              # infer from diff
stably create "test registration" --output ./e2e

Prompt tips: be specific about user flows, UI elements, auth requirements, and error states.

stably test

Runs Playwright tests with Stably reporter. Auto-enables --trace=on. All Playwright CLI options pass through:

bash
stably test --headed --project=chromium --workers=4
stably test --grep="login" tests/login.spec.ts
stably --env staging test --headed

stably fix [runId]

Fixes failing tests using AI analysis of traces, screenshots, logs, and DOM state.

Run ID resolution: explicit arg > CI env (GITHUB_RUN_ID) > .stably/last-run.json (24h cache). Requires git repo.

bash
stably fix           # auto-detect last run
stably fix abc123    # explicit run ID

Typical workflow: stably test > (failures?) > stably fix > stably test

Agent fix workflow (recommended):

  1. stably runs view <runId> to understand failures before fixing
  2. git pull origin main to ensure you're on latest (stably fix edits files in-place)
  3. stably fix <runId> with 600s+ timeout (can take 10+ min; output is mostly spinner noise)
  4. Check git diff to see what stably actually changed. The terminal output is too noisy to parse
  5. If main was updated since the failing run, stably's edits may conflict. Create a worktree from origin/main, manually apply the relevant changes, and PR from there
  6. Review the diff critically: stably sometimes uses brittle selectors (.nth(5), .first()) or overly generic aiAssert. Prefer explicit selectors (ticker symbols, role+name) over AI-driven assertions when possible

Long-Running Commands (Important for Agents)

stably create and stably fix are AI-powered and can take several minutes.

  • Use exec with a long timeout (600s+) or background mode
  • All other commands complete in seconds

Bloom-Specific Setup

Prefer the repo-local CLI if stably is not globally installed. Install dependencies first, then call ./node_modules/.bin/stably directly so verification does not depend on global npm state.

bash
cd ~/projects/bloom-tests
npm install --no-audit --no-fund
source ~/.hermes/.env
STABLY_API_KEY=$STABLY_API_KEY \
STABLY_PROJECT_ID=$STABLY_PROJECT_ID \
BASE_URL=https://bloom.onrender.com \
./node_modules/.bin/stably test

To fix after a failing run:

bash
source ~/.hermes/.env
STABLY_API_KEY=$STABLY_API_KEY STABLY_PROJECT_ID=$STABLY_PROJECT_ID ./node_modules/.bin/stably fix

If a test run URL is produced but stably runs view fails because stably is not on PATH, use the local binary:

bash
source ~/.hermes/.env
STABLY_API_KEY=$STABLY_API_KEY STABLY_PROJECT_ID=$STABLY_PROJECT_ID \
./node_modules/.bin/stably runs view <runId>

Playwright Pitfalls

isVisible({ timeout }) does NOT wait. Playwright's locator.isVisible() returns immediately regardless of any timeout option passed. The timeout is silently ignored. To wait for an optional element, use locator.waitFor({ state: 'visible', timeout: 3000 }) inside a try/catch. This is the #1 cause of race conditions in modal dismissal guards.

ts
// WRONG — returns immediately, modal may not have rendered yet
if (await modal.isVisible({ timeout: 3000 })) { ... }

// RIGHT — actually waits up to 3s for the element
try {
  await modal.waitFor({ state: 'visible', timeout: 3000 });
  await page.keyboard.press('Escape');
  try {
    await modal.waitFor({ state: 'hidden', timeout: 1000 });
  } catch {
    await modal.locator('..').locator('button').first().click({ force: true });
  }
} catch {
  // Modal never appeared — nothing to do
}

Strict mode violations with getByRole('button'). If a row or container has multiple buttons, getByRole('button') without .first() or a name filter throws a strict mode error. Always scope: .getByRole('button').first() or .getByRole('button', { name: 'Bookmark' }).

afterAll cleanup is mandatory for state-mutating tests. Tests that bookmark stocks, create portfolios, or modify user state MUST have an afterAll hook to undo those changes. Watchlist/bookmark state persists across runs and causes cascading failures in other tests. Pattern:

ts
test.afterAll(async ({ browser }) => {
  const page = await browser.newPage();
  try {
    // Navigate and undo state changes
  } catch {
    // Cleanup target doesn't exist — nothing to do
  } finally {
    await page.close();
  }
});

Bloom Test Failure Patterns

Common failure modes in bloom-tests and fixes:

Feedback Modal Overlay: A "Bloom experience" feedback modal overlays form elements (portfolio creation, edit flows), causing timeouts. Dismiss early using the waitFor pattern above with page.getByRole('heading', { name: /Bloom experience/i }).

Company Name vs Ticker Selectors: Bloom UI renders ticker symbols (GOOGL, MSFT) as link text, not company names. Use { name: /GOOGL/ } not { name: 'Alphabet' }.

agent.act() Failures: Replace with explicit Playwright selectors when possible. Reserve agent.act() for genuinely dynamic interactions where the exact selector isn't predictable.

Search/Algolia Flakiness: Avoid making critical Bloom QA flows depend on live search results when the same state can be reached through deterministic in-app navigation. In Stably/headless runs, stock search for AAPL has returned ETF-like results (AAPW, AAPY, AAPD) or hung before Apple Inc appeared. Prefer direct collection pages, ticker rows, or “Copy collection to portfolio” flows when testing portfolio mechanics. See references/bloom-search-and-collections-flakiness.md for a concrete repro and refactor pattern.

Back Button Fragility: .getByRole('button').first() is brittle. Use name or aria-label selectors instead.

Required Env Vars

bash
STABLY_API_KEY=<your-stably-api-key>
STABLY_PROJECT_ID=<your-stably-project-id>

Playwright Config (Reporter Setup)

ts
import { defineConfig } from '@playwright/test';
import { stablyReporter } from '@stablyai/playwright-test';

export default defineConfig({
  use: { trace: 'on' },
  reporter: [
    ['list'],
    stablyReporter({
      apiKey: process.env.STABLY_API_KEY,
      projectId: process.env.STABLY_PROJECT_ID,
    }),
  ],
});

Troubleshooting

ProblemSolution
"Not authenticated"stably login
API key not recognizedstably whoami to verify
Tests in wrong directorystably create "..." --output ./tests/e2e
Missing browserstably install --with-deps
Traces not uploadingSet trace: 'on' in playwright.config.ts
"Run ID not found"Run stably test first, then stably fix
Dashboard URL but no browser authUse stably runs view <runId> via CLI instead

Links

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Stably Cli AI skill do?

Use the Stably CLI to create, run, fix, and maintain Playwright tests in the bloom-tests repo. Use when running tests (stably test), auto-fixing failures (stably fix), or generating new tests from a prompt (stably create).

Why use Stably Cli on TypingMind?

Because you install it once and use it with any model. Stably Cli is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Stably Cli in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/exiao/skills/tree/main/external-services/stably-cli. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Stably Cli?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Stably Cli?

As many as you like. As long as a model supports skills, you can use Stably Cli with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Stably Cli AI skill free?

It is published on GitHub by exiao. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇