{"id":49815475,"url":"https://github.com/Amplicode/connekt","last_synced_at":"2026-05-29T21:00:51.102Z","repository":{"id":305132894,"uuid":"920636424","full_name":"Amplicode/connekt","owner":"Amplicode","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-07T06:48:41.000Z","size":498,"stargazers_count":48,"open_issues_count":7,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-05-07T08:37:00.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Amplicode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-22T14:06:58.000Z","updated_at":"2026-05-07T06:48:44.000Z","dependencies_parsed_at":"2025-07-18T14:22:45.554Z","dependency_job_id":"797147d5-dc87-4354-8627-3eeb535e09df","html_url":"https://github.com/Amplicode/connekt","commit_stats":null,"previous_names":["amplicode/connekt"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Amplicode/connekt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amplicode%2Fconnekt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amplicode%2Fconnekt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amplicode%2Fconnekt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amplicode%2Fconnekt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amplicode","download_url":"https://codeload.github.com/Amplicode/connekt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amplicode%2Fconnekt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-13T06:00:43.975Z","updated_at":"2026-05-29T21:00:51.097Z","avatar_url":"https://github.com/Amplicode.png","language":"Kotlin","funding_links":[],"categories":["HTTP客户端"],"sub_categories":["微服务框架"],"readme":"# Connekt\n\nAn HTTP client driven by Kotlin scripts.\n\nExample:\n\n```kotlin\n// Basic GET Request\nGET(\"https://api.example.com/users\") {\n  header(\"Authorization\", \"Bearer token123\")\n  queryParam(\"limit\", 10)\n}\n\n//POST Request with JSON Body\nPOST(\"https://api.example.com/users\") {\n  contentType(\"application/json\")\n  body(\n    \"\"\"\n        {\n            \"name\": \"John Doe\",\n            \"email\": \"john@example.com\"\n        }\n        \"\"\"\n  )\n}\n\n// Handling Responses\nGET(\"https://api.example.com/users/1\") then {\n  val name = decode\u003cString\u003e(\"$.name\")\n  assertEquals(\"John Doe\", name)\n}\n\n// Store value into variable\nval userId: String by POST(\"https://api.example.com/users\") {\n  contentType(\"application/json\")\n  body(\"\"\"{\"name\": \"John Doe\"}\"\"\")\n} then {\n  jsonPath().read(\"$.id\")\n}\n\n// Use value from another request using variable\nGET(\"https://api.example.com/users/$userId\")\n\n// Environment variables (from connekt.env.json)\nval baseUrl: String by env\n\nGET(\"$baseUrl/users\")\n\n// Path parameters\nGET(\"https://api.example.com/users/{id}/posts/{postId}\") {\n  pathParam(\"id\", \"user-123\")\n  pathParam(\"postId\", 42)\n}\n\n// Authentication helpers\nGET(\"https://api.example.com/profile\") {\n  basicAuth(\"username\", \"password\")\n}\n\nGET(\"https://api.example.com/profile\") {\n  bearerAuth(\"my-access-token\")\n}\n\n// Use cases — group related requests\nval petNames by useCase(\"Load pet names\") {\n  val response by GET(\"$baseUrl/pets\")\n  response.decode\u003cList\u003cString\u003e\u003e(\"$.name\")\n}\n```\n\nFor more examples and detailed documentation, see\nthe [Connekt Script Definition README](connekt-script-definition/README.md).\n\n## Connekt CLI\n\n### Run Connekt CLI in docker container\nThe Connekt installer sets up a CLI tool that allows you to run Kotlin scripts inside a Dockerized runtime with\nenvironment support.\n\n#### What it does:\n\n* Downloads the Connekt launcher script (bash or batch version)\n* Installs it into your home directory at:\n\n  * `~/.connekt` (Linux/MacOS)\n  * `%USERPROFILE%\\.connekt` (Windows)\n* Adds `~/.connekt` or `%USERPROFILE%\\.connekt` to your `PATH` if needed\n* Makes the `connekt` command available in your terminal\n* Does not download Docker images during install — images are pulled lazily on first script run\n\n#### Linux/MacOS\n\n```Bash\ncurl -sSf https://raw.githubusercontent.com/Amplicode/connekt/main/install/install.sh | bash\n```\n\n#### Windows\n\n```Batch\ncurl -fsSL https://raw.githubusercontent.com/Amplicode/connekt/main/install/install.bat -o %TEMP%\\install-connekt.bat \u0026\u0026 %TEMP%\\install-connekt.bat\n```\n\n#### Usage:\n\n```bash\nconnekt my-script.kts\n```\n\n#### Requirements:\n\n* `Docker` must be installed and running\n* `curl` must be available (preinstalled on macOS, most Linux, and Windows 10+)\n* On Windows:\n\n  * Use `CMD`, `PowerShell`, or `Git Bash`\n  * `connekt.bat` is used under the hood\n\nYou can run any `.kts` or `.connekt.kts` script with the `connekt` command.\n\n### Run Connekt CLI from Docker manually\n\nPull Connekt Docker container:\n\n```bash\ndocker pull ghcr.io/amplicode/connekt:0.2.10\n```\n\nRun container:\n\n```Batch\ndocker run --rm \\\n  --add-host=host.docker.internal:host-gateway \\\n  -v /absolute/path/to/your/scripts:/connekt/scripts \\\n  -v /absolute/path/to/connekt.env.json:/connekt/scripts/connekt.env.json \\\n  ghcr.io/amplicode/connekt:0.2.10 \\\n  --env-name=dev \\\n  --env-file=scripts/connekt.env.json \\\n  --script=scripts/your_script_name.cnt.kt \\\n  --env-param param1=value1 \\\n  --env-param param2=value2\n```\n## Overview\n\nConnekt consists of two main modules:\n\n1. **Connekt Script Definition**: A Kotlin scripting library that provides a domain-specific language (`DSL`) for\n   defining `HTTP` requests, handling responses, and managing state between requests.\n\n2. **Connekt Scripting Host**: A command-line tool and runtime environment for executing Connekt scripts. It can be run\n   directly or as a `Docker` container.\n\n## Features\n\n- **Kotlin Scripting**: Write scripts with the `.connekt.kts` extension using Kotlin's scripting capabilities\n- **HTTP Methods**: Support for all standard HTTP methods (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`,\n  `TRACE`)\n- **Request Configuration**:\n  - `Headers`\n  - `Query parameters`\n  - `Path parameters`\n  - Request body (`JSON`, text, `form data`, `multipart`)\n  - Cookies\n  - `SSL`/`TLS` configuration\n- **Response Handling**:\n  - `JSON` parsing with `JSONPath`\n  - Response validation\n  - File downloads\n- **Handling Authorization**\n  - `OAuth2` Authorization Code\n- **State Management**:\n  - Variables store for sharing data between requests\n  - Environment configuration\n- **Use Cases**: Group related requests into use cases for better organization\n- **Dependency Management**: Add `Maven` dependencies to your scripts\n\n### Building from Source\n\n1. Clone the repository\n2. Build the project:\n\n```bash\n./gradlew build\n```\n\n3. Run the application:\n\n```bash\n./gradlew :connekt-scripting-host:run --args=\"path/to/your/script.connekt.kts\"\n```\n\n## Project Structure\n\n- **connekt-script-definition**: Core library that defines the DSL for HTTP requests\n- **connekt-scripting-host**: Command-line tool and runtime environment for executing scripts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAmplicode%2Fconnekt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAmplicode%2Fconnekt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAmplicode%2Fconnekt/lists"}