AI SummaryEnables AI coding agents to control and test Compose Desktop applications via HTTP, automating UI interactions like clicks, text entry, and screenshots. Developers building or testing Compose Desktop apps with AI assistance benefit most.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "compose-ui-control" skill in my project. Please run this command in my terminal: # Install skill into the correct directory mkdir -p .claude/skills/compose-ui-test-server && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/compose-ui-test-server/SKILL.md "https://raw.githubusercontent.com/forketyfork/compose-ui-test-server/main/SKILL.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Control a running Compose Desktop application via HTTP. Use when you need to interact with UI elements, click buttons, enter text, wait for elements to appear, or capture screenshots in a Compose Desktop app that has compose-ui-test-server enabled.
compose-ui-test-server
A library that enables AI coding agents to control Compose Desktop applications at runtime via HTTP. • Repository: https://github.com/forketyfork/compose-ui-test-server • Maven Central: io.github.forketyfork:compose-ui-test-server • Current version: 0.2.0
Checking If Already Installed
Before setting up, check if the project already has the library: `bash grep -r "compose-ui-test-server\|composeuittest" --include=".gradle" --include="*.kt" . ` Look for: • Dependency on io.github.forketyfork:compose-ui-test-server • Imports from io.github.forketyfork.composeuittest If found, skip to Starting the Application.
Step 1: Add the dependency
Find the app's build.gradle.kts and locate the desktop source set dependencies. Add compose-ui-test-server and compose.uiTest: `kotlin kotlin { sourceSets { val desktopMain by getting { dependencies { // Existing dependencies... // Add these two: implementation("io.github.forketyfork:compose-ui-test-server:0.2.0") @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.uiTest) } } } } ` For projects using version catalogs, add to gradle/libs.versions.toml: `toml [libraries] compose-ui-test-server = { module = "io.github.forketyfork:compose-ui-test-server", version = "0.2.0" } ` Then reference in build.gradle.kts: `kotlin implementation(libs.compose.ui.test.server) `
Step 2: Update the main function
Find the application's main() function (usually in Main.kt or similar). Replace the standard Compose Desktop launcher with runApplication: Before (typical Compose Desktop main): `kotlin import androidx.compose.ui.window.Window import androidx.compose.ui.window.application fun main() = application { Window(onCloseRequest = ::exitApplication, title = "My App") { App() } } ` After (with agent control support): `kotlin import io.github.forketyfork.composeuittest.WindowConfig import io.github.forketyfork.composeuittest.runApplication fun main() = runApplication( windowConfig = WindowConfig( title = "My App", minimumWidth = 1024, minimumHeight = 768, ), ) { App() } ` The app now runs normally by default, but supports agent control when launched with COMPOSE_UI_TEST_SERVER_ENABLED=true.
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster