add: config folder

This commit is contained in:
Andy Bunce 2026-03-16 22:45:52 +00:00
parent be677cae50
commit 9189bb0358
6 changed files with 851 additions and 2 deletions

25
.opencode/opencode.json Normal file
View file

@ -0,0 +1,25 @@
{
"plugin": [],
"theme": "system",
"model": "halo/qwen3-coder-next:latest",
"small_model": "halo/gemma3:4b",
"provider": {
"halo": {
"npm": "@ai-sdk/openai-compatible",
"name": "(local)",
"options": { "baseURL": "http://host.docker.internal:11434/v1" },
"models": { "hf.co/unsloth/GLM-4.7-Flash-GGUF:Q6_K": { "name": "glm4.7" },
"hf.co/LiquidAI/LFM2-24B-A2B-GGUF:Q8_0": { "name": "lfm2" },
"qwen3-coder-next:latest": { "name": "qwen3" },
"gemma3:4b": {"name": "Gemma"}
}
}
},
"server": {
"port": 4096,
"hostname": "0.0.0.0",
"mdns": true,
"cors": ["https://example.com"]
}
}

View file

@ -0,0 +1,450 @@
---
name: agent-browser
description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
---
# Browser Automation with agent-browser
## Quick start
```bash
agent-browser open <url> # Navigate to page
agent-browser snapshot -i # Get interactive elements with refs
agent-browser click @e1 # Click element by ref
agent-browser fill @e2 "text" # Fill input by ref
agent-browser close # Close browser
```
## Core workflow
1. Navigate: `agent-browser open <url>`
2. Snapshot: `agent-browser snapshot -i` (returns elements with refs like `@e1`, `@e2`)
3. Interact using refs from the snapshot
4. Re-snapshot after navigation or significant DOM changes
## Commands
### Navigation
```bash
agent-browser open <url> # Navigate to URL (aliases: goto, navigate)
agent-browser back # Go back
agent-browser forward # Go forward
agent-browser reload # Reload page
agent-browser close # Close browser (aliases: quit, exit)
```
### Snapshot (page analysis)
```bash
agent-browser snapshot # Full accessibility tree
agent-browser snapshot -i # Interactive elements only (recommended)
agent-browser snapshot -i -C # Include cursor-interactive elements (divs with onclick, etc.)
agent-browser snapshot -c # Compact (remove empty structural elements)
agent-browser snapshot -d 3 # Limit depth to 3
agent-browser snapshot -s "#main" # Scope to CSS selector
agent-browser snapshot -i -c -d 5 # Combine options
```
The `-C` flag is useful for modern web apps that use custom clickable elements (divs, spans) instead of standard buttons/links.
### Interactions (use @refs from snapshot)
```bash
agent-browser click @e1 # Click (--new-tab to open in new tab)
agent-browser dblclick @e1 # Double-click
agent-browser focus @e1 # Focus element
agent-browser fill @e2 "text" # Clear and type
agent-browser type @e2 "text" # Type without clearing
agent-browser keyboard type "text" # Type with real keystrokes (no selector, current focus)
agent-browser keyboard inserttext "text" # Insert text without key events (no selector)
agent-browser press Enter # Press key
agent-browser press Control+a # Key combination
agent-browser keydown Shift # Hold key down
agent-browser keyup Shift # Release key
agent-browser hover @e1 # Hover
agent-browser check @e1 # Check checkbox
agent-browser uncheck @e1 # Uncheck checkbox
agent-browser select @e1 "value" # Select dropdown
agent-browser scroll down 500 # Scroll page (--selector <sel> for container)
agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto)
agent-browser drag @e1 @e2 # Drag and drop
agent-browser upload @e1 file.pdf # Upload files
```
### Get information
```bash
agent-browser get text @e1 # Get element text
agent-browser get html @e1 # Get innerHTML
agent-browser get value @e1 # Get input value
agent-browser get attr @e1 href # Get attribute
agent-browser get title # Get page title
agent-browser get url # Get current URL
agent-browser get count ".item" # Count matching elements
agent-browser get box @e1 # Get bounding box
agent-browser get styles @e1 # Get computed styles
```
### Check state
```bash
agent-browser is visible @e1 # Check if visible
agent-browser is enabled @e1 # Check if enabled
agent-browser is checked @e1 # Check if checked
```
### Screenshots & PDF
```bash
agent-browser screenshot # Screenshot (saves to temp dir if no path)
agent-browser screenshot path.png # Save to file
agent-browser screenshot --full # Full page
agent-browser screenshot --annotate # Annotated screenshot with numbered element labels
agent-browser pdf output.pdf # Save as PDF
```
Annotated screenshots overlay numbered labels `[N]` on interactive elements. Each label corresponds to ref `@eN`, so refs work for both visual and text workflows:
```bash
agent-browser screenshot --annotate ./page.png
# Output: [1] @e1 button "Submit", [2] @e2 link "Home", [3] @e3 textbox "Email"
agent-browser click @e2 # Click the "Home" link labeled [2]
```
### Video recording
```bash
agent-browser record start ./demo.webm # Start recording (uses current URL + state)
agent-browser click @e1 # Perform actions
agent-browser record stop # Stop and save video
agent-browser record restart ./take2.webm # Stop current + start new recording
```
Recording creates a fresh context but preserves cookies/storage from your session.
### Wait
```bash
agent-browser wait @e1 # Wait for element
agent-browser wait 2000 # Wait milliseconds
agent-browser wait --text "Success" # Wait for text
agent-browser wait --url "**/dashboard" # Wait for URL pattern
agent-browser wait --load networkidle # Wait for network idle
agent-browser wait --fn "window.ready" # Wait for JS condition
```
Load states: `load`, `domcontentloaded`, `networkidle`
### Mouse control
```bash
agent-browser mouse move 100 200 # Move mouse
agent-browser mouse down left # Press button (left/right/middle)
agent-browser mouse up left # Release button
agent-browser mouse wheel 100 # Scroll wheel
```
### Semantic locators (alternative to refs)
```bash
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find label "Email" fill "user@test.com"
agent-browser find placeholder "Search..." fill "query"
agent-browser find alt "Logo" click
agent-browser find title "Close" click
agent-browser find testid "submit-btn" click
agent-browser find first ".item" click
agent-browser find last ".item" click
agent-browser find nth 2 "a" text
```
Actions: `click`, `fill`, `type`, `hover`, `focus`, `check`, `uncheck`, `text`
Options: `--name <name>` (filter role by accessible name), `--exact` (require exact text match)
### Browser settings
```bash
agent-browser set viewport 1920 1080 # Set viewport size
agent-browser set device "iPhone 14" # Emulate device
agent-browser set geo 37.7749 -122.4194 # Set geolocation
agent-browser set offline on # Toggle offline mode
agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
agent-browser set credentials user pass # HTTP basic auth
agent-browser set media dark # Emulate color scheme
```
### Cookies & Storage
```bash
agent-browser cookies # Get all cookies
agent-browser cookies set name value # Set cookie
agent-browser cookies clear # Clear cookies
agent-browser storage local # Get all localStorage
agent-browser storage local key # Get specific key
agent-browser storage local set k v # Set value
agent-browser storage local clear # Clear all
agent-browser storage session # Same for sessionStorage
```
### Network
```bash
agent-browser network route <url> # Intercept requests
agent-browser network route <url> --abort # Block requests
agent-browser network route <url> --body '{}' # Mock response
agent-browser network unroute [url] # Remove routes
agent-browser network requests # View tracked requests
agent-browser network requests --filter api # Filter requests
```
### Tabs & Windows
```bash
agent-browser tab # List tabs
agent-browser tab new [url] # New tab
agent-browser tab 2 # Switch to tab
agent-browser tab close # Close tab
agent-browser window new # New window
```
### Frames
```bash
agent-browser frame "#iframe" # Switch to iframe
agent-browser frame main # Back to main frame
```
### Dialogs
```bash
agent-browser dialog accept [text] # Accept dialog (with optional prompt text)
agent-browser dialog dismiss # Dismiss dialog
```
### Diff (compare snapshots, screenshots, URLs)
```bash
agent-browser diff snapshot # Compare current vs last snapshot
agent-browser diff snapshot --baseline before.txt # Compare current vs saved snapshot file
agent-browser diff snapshot --selector "#main" --compact # Scoped snapshot diff
agent-browser diff screenshot --baseline before.png # Visual pixel diff against baseline
agent-browser diff screenshot --baseline b.png -o d.png # Save diff image to custom path
agent-browser diff screenshot --baseline b.png -t 0.2 # Adjust color threshold (0-1)
agent-browser diff url https://v1.com https://v2.com # Compare two URLs (snapshot diff)
agent-browser diff url https://v1.com https://v2.com --screenshot # Also visual diff
agent-browser diff url https://v1.com https://v2.com --selector "#main" # Scope to element
```
### JavaScript
```bash
agent-browser eval "document.title" # Run JavaScript
agent-browser eval -b "base64code" # Run base64-encoded JS
agent-browser eval --stdin # Read JS from stdin
```
### Debug & Profiling
```bash
agent-browser console # View console messages
agent-browser console --clear # Clear console
agent-browser errors # View page errors
agent-browser errors --clear # Clear errors
agent-browser highlight @e1 # Highlight element
agent-browser trace start # Start recording trace
agent-browser trace stop trace.zip # Stop and save trace
agent-browser profiler start # Start Chrome DevTools profiling
agent-browser profiler stop profile.json # Stop and save profile
```
### State management
```bash
agent-browser state save auth.json # Save auth state
agent-browser state load auth.json # Load auth state
agent-browser state list # List saved state files
agent-browser state show <file> # Show state summary
agent-browser state rename <old> <new> # Rename state file
agent-browser state clear [name] # Clear states for session
agent-browser state clear --all # Clear all saved states
agent-browser state clean --older-than <days> # Delete old states
```
### Setup
```bash
agent-browser install # Download Chromium browser
agent-browser install --with-deps # Also install system deps (Linux)
```
## Global Options
| Option | Description |
|--------|-------------|
| `--session <name>` | Isolated browser session (`AGENT_BROWSER_SESSION` env) |
| `--session-name <name>` | Auto-save/restore session state (`AGENT_BROWSER_SESSION_NAME` env) |
| `--profile <path>` | Persistent browser profile (`AGENT_BROWSER_PROFILE` env) |
| `--state <path>` | Load storage state from JSON file (`AGENT_BROWSER_STATE` env) |
| `--headers <json>` | HTTP headers scoped to URL's origin |
| `--executable-path <path>` | Custom browser binary (`AGENT_BROWSER_EXECUTABLE_PATH` env) |
| `--extension <path>` | Load browser extension (repeatable; `AGENT_BROWSER_EXTENSIONS` env) |
| `--args <args>` | Browser launch args (`AGENT_BROWSER_ARGS` env) |
| `--user-agent <ua>` | Custom User-Agent (`AGENT_BROWSER_USER_AGENT` env) |
| `--proxy <url>` | Proxy server (`AGENT_BROWSER_PROXY` env) |
| `--proxy-bypass <hosts>` | Hosts to bypass proxy (`AGENT_BROWSER_PROXY_BYPASS` env) |
| `--ignore-https-errors` | Ignore HTTPS certificate errors |
| `--allow-file-access` | Allow file:// URLs to access local files |
| `-p, --provider <name>` | Cloud browser provider (`AGENT_BROWSER_PROVIDER` env) |
| `--device <name>` | iOS device name (`AGENT_BROWSER_IOS_DEVICE` env) |
| `--json` | Machine-readable JSON output |
| `--full, -f` | Full page screenshot |
| `--annotate` | Annotated screenshot with numbered labels (`AGENT_BROWSER_ANNOTATE` env) |
| `--headed` | Show browser window (`AGENT_BROWSER_HEADED` env) |
| `--cdp <port\|wss://url>` | Connect via Chrome DevTools Protocol |
| `--auto-connect` | Auto-discover running Chrome (`AGENT_BROWSER_AUTO_CONNECT` env) |
| `--color-scheme <scheme>` | Color scheme: dark, light, no-preference (`AGENT_BROWSER_COLOR_SCHEME` env) |
| `--download-path <path>` | Default download directory (`AGENT_BROWSER_DOWNLOAD_PATH` env) |
| `--native` | [Experimental] Use native Rust daemon (`AGENT_BROWSER_NATIVE` env) |
| `--config <path>` | Custom config file (`AGENT_BROWSER_CONFIG` env) |
| `--debug` | Debug output |
### Security options
| Option | Description |
|--------|-------------|
| `--content-boundaries` | Wrap page output in boundary markers (`AGENT_BROWSER_CONTENT_BOUNDARIES` env) |
| `--max-output <chars>` | Truncate page output to N characters (`AGENT_BROWSER_MAX_OUTPUT` env) |
| `--allowed-domains <list>` | Comma-separated allowed domain patterns (`AGENT_BROWSER_ALLOWED_DOMAINS` env) |
| `--action-policy <path>` | Path to action policy JSON file (`AGENT_BROWSER_ACTION_POLICY` env) |
| `--confirm-actions <list>` | Action categories requiring confirmation (`AGENT_BROWSER_CONFIRM_ACTIONS` env) |
## Configuration file
Create `agent-browser.json` for persistent defaults (no need to repeat flags):
**Locations (lowest to highest priority):**
1. `~/.agent-browser/config.json` — user-level defaults
2. `./agent-browser.json` — project-level overrides
3. `AGENT_BROWSER_*` environment variables
4. CLI flags override everything
```json
{
"headed": true,
"proxy": "http://localhost:8080",
"profile": "./browser-data",
"native": true
}
```
## Example: Form submission
```bash
agent-browser open https://example.com/form
agent-browser snapshot -i
# Output shows: textbox "Email" [ref=e1], textbox "Password" [ref=e2], button "Submit" [ref=e3]
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i # Check result
```
## Example: Authentication with saved state
```bash
# Login once
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "username"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
agent-browser state save auth.json
# Later sessions: load saved state
agent-browser state load auth.json
agent-browser open https://app.example.com/dashboard
```
### Header-based Auth (Skip login flows)
```bash
# Headers scoped to api.example.com only
agent-browser open api.example.com --headers '{"Authorization": "Bearer <token>"}'
# Navigate to another domain - headers NOT sent (safe)
agent-browser open other-site.com
# Global headers (all domains)
agent-browser set headers '{"X-Custom-Header": "value"}'
```
### Authentication Vault
```bash
# Store credentials locally (encrypted). The LLM never sees passwords.
echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin
agent-browser auth login github
```
## Sessions & Persistent Profiles
### Sessions (parallel browsers)
```bash
agent-browser --session test1 open site-a.com
agent-browser --session test2 open site-b.com
agent-browser session list
```
### Session persistence (auto-save/restore)
```bash
agent-browser --session-name twitter open twitter.com
# Login once, state persists automatically across restarts
# State files stored in ~/.agent-browser/sessions/
```
### Persistent Profiles
Persists cookies, localStorage, IndexedDB, service workers, cache, login sessions across browser restarts.
```bash
agent-browser --profile ~/.myapp-profile open myapp.com
# Or via env var
AGENT_BROWSER_PROFILE=~/.myapp-profile agent-browser open myapp.com
```
## JSON output (for parsing)
Add `--json` for machine-readable output:
```bash
agent-browser snapshot -i --json
agent-browser get text @e1 --json
```
## Local files
```bash
agent-browser --allow-file-access open file:///path/to/document.pdf
agent-browser --allow-file-access open file:///path/to/page.html
```
## CDP Mode
```bash
agent-browser connect 9222 # Local CDP port
agent-browser --cdp 9222 snapshot # Direct CDP on each command
agent-browser --cdp "wss://browser-service.com/cdp?token=..." snapshot # Remote via WebSocket
agent-browser --auto-connect snapshot # Auto-discover running Chrome
```
## Cloud providers
```bash
# Browserbase
BROWSERBASE_API_KEY="key" BROWSERBASE_PROJECT_ID="id" agent-browser -p browserbase open example.com
# Browser Use
BROWSER_USE_API_KEY="key" agent-browser -p browseruse open example.com
# Kernel
KERNEL_API_KEY="key" agent-browser -p kernel open example.com
```
## iOS Simulator
```bash
agent-browser device list # List available simulators
agent-browser -p ios --device "iPhone 16 Pro" open example.com # Launch Safari
agent-browser -p ios snapshot -i # Same commands as desktop
agent-browser -p ios tap @e1 # Tap
agent-browser -p ios swipe up # Mobile-specific
agent-browser -p ios close # Close session
```
## Native Mode (Experimental)
Pure Rust daemon using direct CDP — no Node.js/Playwright required:
```bash
agent-browser --native open example.com
# Or: export AGENT_BROWSER_NATIVE=1
# Or: {"native": true} in agent-browser.json
```
---
Install: `bun add -g agent-browser && agent-browser install`. Run `agent-browser --help` for all commands. Repo: https://github.com/vercel-labs/agent-browser

View file

@ -0,0 +1,274 @@
---
name: basex-test
description: Use this skill when working with BaseX XQuery unit tests
metadata:
author: BaseX
version: "12.2"
homepage: https://docs.basex.org/main/Unit_Functions
allowed-tools: Read
---
# Unit Functions
This BaseX module contains annotations and functions for performing XQUnit tests. Each test is an XQuery function with the `%unit:test` annotation.
## [Introduction](#introduction)
The more complex a software application grows, the more error-prone it gets. This is why testing frameworks exist, which provide a standardized, automated way of testing software. The [xUnit](https://en.wikipedia.org/wiki/XUnit) frameworks (such as SUnit or JUnit) allow testing of atomic units of a program, such as single functions and algorithms.
This module borrows heavily from the existing frameworks: it provides various annotations for testing XQuery functions. Unit functions are provided to assert the validity of arbitrary conditions expressed in XQuery and to raise errors whenever a condition is not satisfied. Some additional functions exist to run all unit tests of the current module or a set of specified library modules.
## [Usage](#usage)
Tests are started via the `[TEST](Commands#test)` command. It compiles all XQuery modules in a given file
or directory and runs all functions that are annotated with `%unit:test`. A test report is generated and returned, which resembles the format returned by other xUnit testing frameworks, such as the Maven Surefire Plugin ([see below](#result)).
## [Conventions](#conventions)
All annotations, functions and errors in this module are assigned to the `http://basex.org/modules/unit` namespace, which is statically bound to the `unit` prefix.
## [Annotations](#annotations)
### [`unit:test`](#unit:test)
| | |
| --- | --- |
| Syntax | `unit:test()` <br>`unit:test("expected", CODE)` |
| Summary | With this annotation, a function can be marked as unit test. It will be evaluated if a test report is created for the module in which this function is located. `error` can be supplied as additional string argument. It is followed by `CODE`, which must be a valid [EQName](XQuery_3.0#expanded_qnames) string. If the function expression does not raise that error, the test will fail. |
| Examples | ```xquery<br>declare %unit:test function local:void() { () };<br>```<br><br>The following test will be successful, as it does nothing (and, hence, nothing wrong).<br><br>- - -<br><br>```xquery<br>declare %unit:test('expected', "err:XPTY0004") function local:add() {<br> 123 + 'strings and integers cannot be added'<br>};<br>```<br><br>The following test will be successful, as the function body will raise `err:XPTY0004`. |
### [`unit:before`](#unit:before)
| | |
| --- | --- |
| Syntax | `unit:before()` <br>`unit:before(FUNCTION)` |
| Summary | A function decorated with this annotation will be evaluated **before each** unit test as a separate transaction. `FUNCTION` can be supplied as additional argument. It must be a valid [EQName](XQuery_3.0#expanded_qnames) string. If specified, the function will only be evaluated before a function with the given name is tested. This extension is e.g. helpful if the results of updates need to be tested. |
| Examples | ```xquery<br>declare %updating %unit:before("local:check") function local:before-check() {<br> db:create('test-db')<br>};<br>declare %updating %unit:test function local:check() {<br> unit:assert(db:exists('test-db'))<br>};<br>```<br><br>The first function will be evaluated before the actual test. |
### [`unit:after`](#unit:after)
| | |
| --- | --- |
| Syntax | `unit:after()` <br>`unit:after(FUNCTION)` |
| Summary | A function decorated with this annotation will be evaluated **after each** unit test as a separate transaction. `FUNCTION` can be supplied as additional argument. It must be a valid [EQName](XQuery_3.0#expanded_qnames) string. If specified, the function will only be evaluated after a function with the given name is tested. |
### [`unit:before-module`](#unit:before-module)
| | |
| --- | --- |
| Syntax | `unit:before-module()` |
| Summary | If a function is decorated with this annotation, it will be evaluated **before all** unit tests in the current module as a separate transaction. |
### [`unit:after-module`](#unit:after-module)
| | |
| --- | --- |
| Syntax | `unit:after-module()` |
| Summary | If a function is decorated with this annotation, it will be evaluated **after all** unit tests in the current module as a separate transaction. |
### [`unit:ignore`](#unit:ignore)
| | |
| --- | --- |
| Syntax | `unit:ignore()` <br>`unit:ignore(MESSAGE)` |
| Summary | If a function is decorated with this annotation, it will temporarily be ignored by the test suite runner. |
## [Functions](#functions)
### [`unit:assert`](#unit:assert)
Signature
unit:assert(
$test as item()\*,
$info as item() := ()
) as empty-sequence()
SummaryAsserts that the effective boolean value of the specified `$test` is true and returns an empty sequence. Otherwise, raises an error. The _effective boolean value_ of an expression can be explicitly computed by using the `fn:boolean` function. The default failure message can be overridden with the `$info` argument.Errors
| | |
| --- | --- |
| [`fail`](#errors) | An assertion failed, or an error was raised. |
### [`unit:assert-equals`](#unit:assert-equals)
Signature
unit:assert-equals(
$returned as item()\*,
$expected as item()\*,
$info as item() := ()
) as empty-sequence()
SummaryAsserts that the specified arguments are equal according to the rules of the `[fn:deep-equal](Standard_Functions#fn:deep-equal)` function. Otherwise, raises an error. The default failure message can be overridden with the `$info` argument.Errors
| | |
| --- | --- |
| [`fail`](#errors) | An assertion failed, or an error was raised. |
### [`unit:fail`](#unit:fail)
Signature
unit:fail(
$info as item() := ()
) as empty-sequence()
SummaryRaises a unit error. The default failure message can be overridden with the `$info` argument.Errors
| | |
| --- | --- |
| [`fail`](#errors) | An assertion failed, or an error was raised. |
## [Example](#example)
The following XQUnit module `tests.xqm` contains all available unit annotations:
### [Query](#query)
```xquery
module namespace test = 'http://basex.org/modules/xqunit-tests';
(:~ Initializing function, which is called once before all tests. :)
declare %unit:before-module function test:before-all-tests() {
()
};
(:~ Initializing function, which is called once after all tests. :)
declare %unit:after-module function test:after-all-tests() {
()
};
(:~ Initializing function, which is called before each test. :)
declare %unit:before function test:before() {
()
};
(:~ Initializing function, which is called after each test. :)
declare %unit:after function test:after() {
()
};
(:~ Function demonstrating a successful test. :)
declare %unit:test function test:assert-success() {
unit:assert(<a/>)
};
(:~ Function demonstrating a failure using unit:assert. :)
declare %unit:test function test:assert-failure() {
unit:assert((), 'Empty sequence.')
};
(:~ Function demonstrating a failure using unit:assert-equals. :)
declare %unit:test function test:assert-equals-failure() {
unit:assert-equals(4 + 5, 6)
};
(:~ Function demonstrating an unexpected success. :)
declare %unit:test("expected", "err:FORG0001") function test:unexpected-success() {
()
};
(:~ Function demonstrating an expected failure. :)
declare %unit:test("expected", "err:FORG0001") function test:expected-failure() {
1 + <a/>
};
(:~ Function demonstrating the creation of a failure. :)
declare %unit:test function test:failure() {
unit:fail("Failure!")
};
(:~ Function demonstrating an error. :)
declare %unit:test function test:error() {
1 + <a/>
};
(:~ Skipping a test. :)
declare %unit:test %unit:ignore("Skipped!") function test:skipped() {
()
};
```
By running `TEST tests.xqm`, the following report will be generated (timings may differ):
### [Result](#result)
```xml
<testsuites time="PT0.256S">
<testsuite name="file:///C:/Users/user/Desktop/test.xqm"
time="PT0.212S" tests="8" failures="4" errors="1" skipped="1">
<testcase name="assert-success" time="PT0.016S"/>
<testcase name="assert-failure" time="PT0.005S">
<failure line="30" column="15">
<info>Empty sequence.</info>
</failure>
</testcase>
<testcase name="assert-equals-failure" time="PT0.006S">
<failure line="35" column="22">
<returned item="1" type="xs:integer">9</returned>
<expected item="1" type="xs:integer">6</expected>
<info>Item 1: 6 expected, 9 returned.</info>
</failure>
</testcase>
<testcase name="unexpected-success" time="PT0.006S">
<failure>
<expected>FORG0001</expected>
</failure>
</testcase>
<testcase name="expected-failure" time="PT0.004S"/>
<testcase name="failure" time="PT0.004S">
<failure line="50" column="13">
<info>Failure!</info>
</failure>
</testcase>
<testcase name="error" time="PT0.004S">
<error line="55" column="6" type="FORG0001">
<info>Cannot cast to xs:double: "".</info>
</error>
</testcase>
<testcase name="skipped" skipped="Skipped!" time="PT0S"/>
</testsuite>
</testsuites>
```
## [Errors](#errors)
| Code | Description |
| --- | --- |
| `fail` | An assertion failed, or an error was raised. |
| `no-args` | A test function must have no arguments. |
| `private` | A test function must not be private. |
## [Changelog](#changelog)
**Version 9.0**
* Updated: error codes updated; errors now use the module namespace
**Version 8.0.2**
* Updated: (expected) errors are compared by QNames instead of local names (including namespaces).
**Version 8.0**
* Added: `[unit:fail](#unit:fail)`, 0-argument signature.
* Updated: the info argument of functions can now be an arbitrary item.
* Updated: infos are now represented in an `info` child element.
* Updated: `[unit:before](#unit:before)` and `[unit:after](#unit:after)` can be extended by a filter argument.
* Deleted: `UNIT0006` (ignore results returned by functions).
**Version 7.9**
* Added: TEST command
* Removed: `[unit:test](#unit:test)`, `unit:test-uris`
**Version 7.8**
* Added: `[unit:assert-equals](#unit:assert-equals)`
* Updated: enhanced test report output
**Version 7.7**
* Added: New module added.

View file

@ -0,0 +1,80 @@
---
name: forgejo-cli
description: Interact with a Forge instance using the executable `fj`, inspired by Github's `gh`
license: MIT
compatibility: opencode
metadata:
audience: maintainers
---
# What I do
The Forgejo CLI (`fj`) is a powerful command-line tool designed to streamline interactions with Forgejo instances. Inspired by tools like GitHub's `gh`, it allows you to manage repositories, issues, pull requests, and more directly from your terminal, making your workflow faster and more efficient.
## Core Capabilities
### Repository Management
- **View Info:** Get detailed information about any repository
- **Migrate/Mirror:** Migrate or mirror repositories from other hosts
- **Read README:** Print a repository's README file directly to the terminal
### Issue & Pull Request Operations
- **Create:** Open new issues or pull requests. You can use the `--web` flag to open the creation page in your browser instead
- **PR Autofill:** Automatically populate a pull request's title and body from the associated commit(s) with `fj pr create --autofill`
- **Agit Flow:** Create pull requests using the Agit flow, which doesn't require forking the repository (`pr --agit`)
- **PR Status:** Check the status of pull requests and use `--wait` to make the command exit only after all checks are finished
- **Comment:** Add comments from the command line, with the option to use a file's contents as the body (`--body-from-file`)
- **Search:** Search for issues with flexible filters like `--state all`
### User & Key Management
- **Key Management:** Manage SSH and GPG keys associated with your account (`fj user key`, `fj user gpg`)
- **List Repos/Orgs:** List repositories or organizations for a user
- **User Search:** Search for other users on the instance
### Tag Management
- **Manage Tags:** Create, list, and manage Git tags (`fj tag`)
## Installation Guide
You can install `forgejo-cli` in several ways:
| Method | Command / Instructions |
| :--- | :--- |
| **Pre-built Binaries** | Download the latest binary for `x86_64` Windows or Linux (GNU) from the releases tab on Codeberg |
| **From Source (Cargo)** | Install using Rust's package manager: `cargo install forgejo-cli` |
| **From Source (Git)** | Install the latest development version: `cargo install --git https://codeberg.org/Cyborus/forgejo-cli.git --branch main` |
| **Nix** | Use the provided Nix flake: `nix profile install git+https://codeberg.org/Cyborus/forgejo-cli` |
| **Fedora (Unofficial)** | An unofficial COPR repository is available. Ensure `dnf-plugins-core` is installed, then enable the repo |
| **Docker / OCI** | Use the OCI container for CI/CD environments: `codeberg.org/cyborus/forgejo-cli:latest` |
## Usage Examples
### Basic Commands
The `fj` tool uses a simple and intuitive structure: `fj <command> <subcommand> [arguments] [flags]`.
#### 1. Viewing Repository Information
```bash
# Using the command directly
fj repo info codeberg.org/forgejo/forgejo
# Example Output
forgejo/forgejo
> Beyond coding. We forge.
Primary language is Go
## When to use me
Interact with Forgejo instances (like codeberg.org or your self-hosted server)
## Overview
The Forgejo CLI (`fj`) is a powerful command-line tool designed to streamline interactions with Forgejo instances. Inspired by tools like GitHub's `gh`, it allows you to manage repositories, issues, pull requests, and more directly from your terminal, making your workflow faster and more efficient.
**Key Facts:**
- **Binary Name:** `fj`
- **Primary Purpose:** Interact with Forgejo instances (like codeberg.org or your self-hosted server)
- **Language:** Written in Rust
- **License:** Dual-licensed under Apache 2.0 or MIT

View file

@ -0,0 +1,20 @@
---
name: git-release
description: Create consistent releases and changelogs
license: MIT
compatibility: opencode
metadata:
audience: maintainers
workflow: github
---
## What I do
- Draft release notes from merged PRs
- Propose a version bump
- Provide a copy-pasteable `gh release create` command
## When to use me
Use this when you are preparing a tagged release.
Ask clarifying questions if the target versioning scheme is unclear.

View file

@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \
default-jdk-headless \ default-jdk-headless \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
#1a store creds #1a GIT store creds
RUN git config --global credential.helper store RUN git config --global credential.helper store
# 2. Install Starship & Aliases # 2. Install Starship & Aliases
@ -43,7 +43,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --pr
# install https://agent-browser.dev # install https://agent-browser.dev
RUN cargo install agent-browser && \ RUN cargo install agent-browser && \
agent-browser install # Download Chrome (first time) agent-browser install # Download Chrome (first time)
# --- NEW SECTION: GO SETUP --- # --- NEW SECTION: GO SETUP ---
# 6. Install Go (Latest Stable) # 6. Install Go (Latest Stable)