{"id":14989906,"url":"https://github.com/neandertech/smithy4s-curl","last_synced_at":"2025-10-25T06:02:02.457Z","repository":{"id":248745658,"uuid":"822791452","full_name":"neandertech/smithy4s-curl","owner":"neandertech","description":"Curl-based Scala Native client implementation for Smithy4s services","archived":false,"fork":false,"pushed_at":"2024-07-19T10:00:17.000Z","size":100,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T21:06:33.385Z","etag":null,"topics":["curl","scala","scala3","scalanative","smithy4s"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neandertech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-01T20:43:30.000Z","updated_at":"2024-12-13T09:27:02.000Z","dependencies_parsed_at":"2024-09-15T17:22:14.974Z","dependency_job_id":null,"html_url":"https://github.com/neandertech/smithy4s-curl","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"84bfa9e5789f3a073537952b717396be87f3a94f"},"previous_names":["neandertech/smithy4s-curl"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neandertech%2Fsmithy4s-curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neandertech%2Fsmithy4s-curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neandertech%2Fsmithy4s-curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neandertech%2Fsmithy4s-curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neandertech","download_url":"https://codeload.github.com/neandertech/smithy4s-curl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248502015,"owners_count":21114724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["curl","scala","scala3","scalanative","smithy4s"],"created_at":"2024-09-24T14:19:07.121Z","updated_at":"2025-10-25T06:02:02.310Z","avatar_url":"https://github.com/neandertech.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smithy4s-curl\n\n\u003c!--toc:start--\u003e\n\n- [smithy4s-curl](#smithy4s-curl)\n  - [Installation](#installation)\n  - [Getting started](#getting-started)\n  - [Contributing](#contributing)\n  \u003c!--toc:end--\u003e\n\nAn _experimental_ [Smithy4s](https://disneystreaming.github.io/smithy4s/) client backend for [Scala Native](https://www.scala-native.org/), using Curl directly, without introducing a http4s/cats dependency.\n\nThe purpose of the library is to provide a synchronous client implementation for smithy4s services, suitable for usage in CLIs  where introducing http4s/cats dependency just to interact with a smithy4s service is undesirable.\n\nThe library is currently only available for Scala 3, but we will welcome contributions cross-compiling it to 2.13 – it should be very easy. API surface is very minimal and designed for binary compatible evolution, so after initial round of testing and gathering community feedback, we plan to release 1.0.0 and start checking binary/Tasty compatibility for each release.\n\nAdditionally, the library is currently published for Scala Native 0.4, but only for as long as smithy4s core stays on SN 0.4 – once it's published for SN 0.5, this library will jump straight to that.\n\n## Installation\n\nLatest version: [![smithy4s-curl Scala version support](https://index.scala-lang.org/neandertech/smithy4s-curl/smithy4s-curl/latest.svg)](https://index.scala-lang.org/neandertech/smithy4s-curl/smithy4s-curl)\n\n- **SBT**: `libraryDependencies += \"tech.neander\" %%% \"smithy4s-curl\" % \"\u003clatest version\u003e\"`\n- **Scala CLI**: `//\u003e using dep tech.neander::smithy4s-curl::\u003clatest version\u003e`\n- **Mill**: `ivy\"tech.neander::smithy4s-curl::\u003clatest version\u003e\"`\n\n## Getting started\n\nFor example's sake, let's say we have a smithy4s service that models one of the endpoints from https://httpbin.org, defined using [smithy4s-deriving](https://github.com/neandertech/smithy4s-deriving) (note we're using [Scala CLI](https://scala-cli.virtuslab.org) for this demo):\n\n```scala\n//\u003e using dep \"tech.neander::smithy4s-deriving::0.0.3\"\n//\u003e using platform scala-native\n//\u003e using scala 3.4.2\n//\u003e using option -Wunused:all\n\nimport scala.annotation.experimental\nimport smithy4s.*, deriving.{given, *}, aliases.*\nimport scala.util.Try\n\ncase class Response(headers: Map[String, String], origin: String, url: String)\n    derives Schema\n\n@experimental\ntrait HttpbinService derives API:\n  @readonly\n  @httpGet(\"/get\")\n  def get(): Try[Response]\n```\n\n***Note** that we only need to use `@experimental` annotation because we are using smithy4s-deriving.*\n*If you're creating clients for services generated by standard Smithy4s codegen, just remove all `@experimental` annotations*\n*you see.*\n\nTo create a Curl client for this service all we need to do is this:\n\n```scala\nimport smithy4s_curl.*\n\n@main @experimental\ndef helloWorld = \n  val service = \n    SimpleRestJsonCurlClient(\n      API.service[HttpbinService],\n      \"https://httpbin.org\",\n      SyncCurlClient()\n     ).make.unliftService\n\n  println(service.get())\n```\n\nNote that you need to have Curl library enabled, and a `-lcurl` flag added to the Scala Native linking flags \n\n## Contributing\n\nIf you see something that can be improved in this library – please contribute!\n\nThis is a relatively standard Scala CLI project, even though the tests run a \nScala version newer than the library itself (library is published for 3.3, tests are \nin 3.4, to make use of smithy4s-deriving).\n\nHere are some useful commands:\n\n- `make test` – run tests\n- `make check-docs` – verify that snippets in `README.md` (this file) compile\n- `make pre-ci` – format the code so that it passes CI check\n- `make run-example` – run example from README against real https://httpbin.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneandertech%2Fsmithy4s-curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneandertech%2Fsmithy4s-curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneandertech%2Fsmithy4s-curl/lists"}