Logo vun Stably Cli

Stably Cli

Communautéit
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).

Iwwersiicht

Editeurexiao
Repositoryskills
Skill-Nummstably-cli
Stären
40
Forks
12
Matgeliwwert Fichieren
1
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum exiao op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Stably Cli an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/exiao/skills/tree/main/external-services/stably-cli
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Stably Cli an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Stably Cli automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Stably Cli net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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).

Firwat Stably Cli op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Stably Cli besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Stably Cli an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/exiao/skills/tree/main/external-services/stably-cli an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Stably Cli benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Stably Cli benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Stably Cli domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Stably Cli gratis?

De Skill gëtt vum exiao op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇