{"id":20915112,"url":"https://github.com/microcks/microcks-cli","last_synced_at":"2025-07-26T17:37:02.860Z","repository":{"id":50376824,"uuid":"161363817","full_name":"microcks/microcks-cli","owner":"microcks","description":"Simple CLI for interacting with Microcks test APIs","archived":false,"fork":false,"pushed_at":"2024-10-18T12:26:59.000Z","size":120,"stargazers_count":19,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T05:42:57.499Z","etag":null,"topics":["api","cli","golang","microservices","mocking","tekton","testing"],"latest_commit_sha":null,"homepage":"https://microcks.io","language":"Go","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/microcks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY-INSIGHTS.yml","support":null,"governance":"GOVERNANCE.md","roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"microcks","patreon":null,"open_collective":"microcks","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-12-11T16:38:44.000Z","updated_at":"2024-10-18T12:27:00.000Z","dependencies_parsed_at":"2023-12-27T04:09:22.469Z","dependency_job_id":"b823fa9d-f8ea-42f7-84f0-cf82d115366b","html_url":"https://github.com/microcks/microcks-cli","commit_stats":{"total_commits":71,"total_committers":4,"mean_commits":17.75,"dds":"0.16901408450704225","last_synced_commit":"9f7e1575b519968f461a6f1d4581e5e64bfc5842"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microcks","download_url":"https://codeload.github.com/microcks/microcks-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224189719,"owners_count":17270709,"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":["api","cli","golang","microservices","mocking","tekton","testing"],"created_at":"2024-11-18T16:13:03.259Z","updated_at":"2025-05-13T10:32:36.402Z","avatar_url":"https://github.com/microcks.png","language":"Go","funding_links":["https://github.com/sponsors/microcks","https://opencollective.com/microcks"],"categories":["Go"],"sub_categories":[],"readme":"# Microcks CLI\n\nSimple CLI for interacting with Microcks server APIs.\nIt allows to launch tests or import API artifacts with minimal dependencies.\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/microcks/microcks-cli/build-verify.yml?logo=github\u0026style=for-the-badge)](https://github.com/microcks/microcks-cli/actions)\n[![Container](https://img.shields.io/badge/dynamic/json?color=blue\u0026logo=docker\u0026style=for-the-badge\u0026label=Quay.io\u0026query=tags[1].name\u0026url=https://quay.io/api/v1/repository/microcks/microcks-cli/tag/?limit=10\u0026page=1\u0026onlyActiveTags=true)](https://quay.io/repository/microcks/microcks-cli?tab=tags)\n[![License](https://img.shields.io/github/license/microcks/microcks-cli?style=for-the-badge\u0026logo=apache)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Project Chat](https://img.shields.io/badge/discord-microcks-pink.svg?color=7289da\u0026style=for-the-badge\u0026logo=discord)](https://microcks.io/discord-invite/)\n[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/microcks-cli-image\u0026style=for-the-badge)](https://artifacthub.io/packages/search?repo=microcks-cli-image)\n[![CNCF Landscape](https://img.shields.io/badge/CNCF%20Landscape-5699C6?style=for-the-badge\u0026logo=cncf)](https://landscape.cncf.io/?item=app-definition-and-development--application-definition-image-build--microcks)\n\n\n## Build Status\n\nLatest release is `0.5.8`.\n\nCurrent development version is `0.5.9`.\nIt is available as a container image named `quay.io/microcks/microcks-cli:nightly`.\n\n#### Fossa license and security scans\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli.svg?type=shield\u0026issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli?ref=badge_shield\u0026issueType=license)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli.svg?type=shield\u0026issueType=security)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli?ref=badge_shield\u0026issueType=security)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmicrocks%2Fmicrocks-cli?ref=badge_small)\n\n#### Signature, Provenance, SBOM\n\n[![Static Badge](https://img.shields.io/badge/supply_chain-documentation-blue?logo=securityscorecard\u0026label=Supply%20Chain\u0026link=https%3A%2F%2Fmicrocks.io%2Fdocumentation%2Freferences%2Fcontainer-images%23software-supply-chain-security)](https://microcks.io/documentation/references/container-images#software-supply-chain-security)\n\n#### OpenSSF best practices on Microcks core\n\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/7513/badge)](https://bestpractices.coreinfrastructure.org/projects/7513)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microcks/microcks/badge)](https://securityscorecards.dev/viewer/?uri=github.com/microcks/microcks)\n\n## Community\n\n* [Documentation](https://microcks.io/documentation/tutorials/getting-started/)\n* [Microcks Community](https://github.com/microcks/community) and community meeting\n* Join us on [Discord](https://microcks.io/discord-invite/), on [GitHub Discussions](https://github.com/orgs/microcks/discussions) or [CNCF Slack #microcks channel](https://cloud-native.slack.com/archives/C05BYHW1TNJ)\n\nTo get involved with our community, please make sure you are familiar with the project's [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n## Usage instructions\n\nUsage is simply `microcks-cli [command]`\n\nwhere `[command]` can be one of the following:\n\n* `version` to check this CLI version,\n* `help` to display usage informations,\n* `test` to launch new test on Microcks server.\n* `import` to import API artifacts on Microcks server.\n\n### Test command\n\nThe `test` command has a bunch of arguments and flags so that you can use it that way:\n\n```\nmicrocks-cli test \u003capiName:apiVersion\u003e \u003ctestEndpoint\u003e \u003crunner\u003e\n        --microcksURL=\u003c\u003e --waitFor=5sec\n        --keycloakClientId=\u003c\u003e --keycloakClientSecret=\u003c\u003e\n```\n\nThe arguments:\n\n* `\u003capiName:apiVersion\u003e` : Service to test reference. Example: `'Beer Catalog API:0.9'`\n* `\u003ctestEndpoint\u003e` : URL where is deployed implementation to test\n* `\u003crunner\u003e` : Test strategy (one of: `HTTP`, `SOAP`, `SOAP_UI`, `POSTMAN`, `OPEN_API_SCHEMA`, `ASYNC_API_SCHEMA`, `GRPC_PROTOBUF`, `GRAPHQL_SCHEMA`)\n\nThe flags:\n\n* `--microcksURL` for the Microcks API endpoint,\n* `--waitFor` for the time to wait for test to finish (int + one of: milli, sec, min),\n* `--keycloakClientId` for the Keycloak Realm Service Account ClientId,\n* `--keycloakClientSecret` for the Keycloak Realm Service Account ClientSecret.\n\n\u003e Since `0.5.2` release, `microcks-cli` also works in unauthenticated mode, without Keycloak being deployed and configured with your Microcks instance. However, you still have to specify the Keycloak flags on the command even if you put random values there. For eg. `--keycloakClientId=foo --keycloakClientSecret=bar`.\n\nReal life example command and execution:\n\n```sh\n$ ./microcks-cli test 'Beer Catalog API:0.9' http://localhost:9090/api/ POSTMAN \\\n        --microcksURL=http://localhost:8080/api/ \\\n        --keycloakClientId=microcks-serviceaccount \\\n        --keycloakClientSecret=7deb71e8-8c80-4376-95ad-00a399ee3ca1 \\\n        --waitFor=3sec\n[...]\nMicrocksClient got status for test \"5c1781cf6310d94f8169384e\" - success: false, inProgress: true\nMicrocksTester waiting for 2 seconds before checking again.\nMicrocksClient got status for test \"5c1781cf6310d94f8169384e\" - success: true, inProgress: false\nFull TestResult details are available here: http://localhost:8080/#/tests/5c1781cf6310d94f8169384e \n```\n\n#### Advanced options\n\nThe `test` command provides additional flags for advanced usages and options:\n\n* `--verbose` allows to dump on standard output all the HTTP requests and responses,\n* `--insecure` allows to interact with Microcks and Keycloak instances through HTTPS without checking certificates issuer CA,\n* `--caCerts=\u003cpath1,path2\u003e` allows to specify additional certificates CRT files to add to trusted roots ones,\n* `--secretName='\u003cSecret Name\u003e'` is an optional flag specifying the name of a Secret to use for connecting endpoint,\n* `--filteredOperations=\u003cJSON\u003e` allows to filter a list of operations to launch a test for,\n* `--operationsHeaders=\u003cJSON\u003e` allows to override some operations headers for the tests to launch,\n* `--oAuth2Context=\u003cJSON\u003e` allows specification of an OAuth2 grant flow to execute before launching the test (starts with Microcks version `1.8.0`).\n\nOverriden test operations headers is a JSON strings where 1st level keys are operation name (eg. `GET /beer`) or `globals` for header applying to all the operations of the API. Headers are specified as an array of objects defining `key` and `values` properties.\n\nHere's below an example of using some of this flags:\n\n```sh\n$ ./microcks-cli test 'Beer Catalog API:0.9' http://localhost:9090/api/ OPEN_API_SCHEMA \\                           \n        --microcksURL=http://localhost:8080/api/ \\\n        --keycloakClientId=microcks-serviceaccount \\\n        --keycloakClientSecret=7deb71e8-8c80-4376-95ad-00a399ee3ca1 \\\n        --insecure --verbose  --waitFor=3sec \\\n        --filteredOperations='[\"GET /beer\", \"GET /beer/{name}\"]' \\\n        --operationsHeaders='{\"globals\": [{\"name\": \"x-api-key\", \"values\": \"my-values\"}], \"GET /beer\": [{\"name\": \"x-trace-id\", \"values\": \"xcvbnsdfghjklm\"}]}' \\\n        --oAuth2Context='{\"clientId\": \"microcks-test\", \"clientSecret\": \"ab54d329-e435-41ae-a900-ec6b3fe15c54\", \"tokenUri\": \"https://idp.acme.org/realms/my-app/protocol/openid-connect/token\", \"grantType\": \"CLIENT_CREDENTIALS\"}'\n\nMicrocksClient got status for test \"64c25f7ddec62569f9a0ed95\" - success: true, inProgress: false \nFull TestResult details are available here: http://localhost:8080/#/tests/64c25f7ddec62569f9a0ed95 \n```\n\n### Import command\n\nThe `import` command has one argument and common flags with `test` command. You can use it that way:\n\n```\nmicrocks-cli import \u003cspecificationFile1[:primary],specificationFile2[:primary]\u003e\n\t--microcksURL=\u003c\u003e\n\t--keycloakClientId=\u003c\u003e --keycloakClientSecret=\u003c\u003e\n```\n\nThe arguments:\n\n* `\u003cspecificationFile1[:primary],specificationFile2[:primary]\u003e` : Comma separated list of API specs to import with flag telling if it's a primary artifact. Example: `'specs/my-openapi.yaml:true,specs/my-postmancollection.json:false'`\n\nThe flags:\n\n* `--microcksURL` for the Microcks API endpoint,\n* `--keycloakClientId` for the Keycloak Realm Service Account ClientId,\n* `--keycloakClientSecret` for the Keycloak Realm Service Account ClientSecret.\n\n\u003e Since `0.5.2` release, `microcks-cli` also works in unauthenticated mode, without Keycloak being deployed and configured with your Microcks instance. However, you still have to specify the Keycloak flags on the command even if you put random values there. For eg. `--keycloakClientId=foo --keycloakClientSecret=bar`.\n\nReal life example command and execution:\n\n```sh\n$ ./microcks-cli import 'samples/weather-forecast-openapi.yml:true,samples/weather-forecast-postman.json:false' \\\n        --microcksURL=http://localhost:8080/api/ \\\n        --keycloakClientId=microcks-serviceaccount \\\n        --keycloakClientSecret=7deb71e8-8c80-4376-95ad-00a399ee3ca1\nMicrocks has discovered 'WeatherForecast API:1.1.0'\nMicrocks has discovered 'WeatherForecast API:1.1.0'\n```\n\n#### Advanced options\n\nThe `import` command provides additional flags for advanced usages and options:\n\n* `--verbose` allows to dump on standard output all the HTTP requests and responses,\n* `--insecure` allows to interact with Microcks and Keycloak instances through HTTPS without checking certificates issuer CA,\n* `--caCerts=\u003cpath1,path2\u003e` allows to specify additional certificates CRT files to add to trusted roots ones,\n\n\n## Installation\n\n### Binary\n\nBinary releases for Linux, MacOS or Windows platform are available on the GitHub [releases page](https://github.com/microcks/microcks-cli/releases). Just download the binary corresponding to your system and put the binary into the `PATH` somewhere ;-)\n\n### Container image\n\nThe `microcks-cli` is available as a container image. So that you'd be able to easily use it from a GitLab CI or a [Tekton pipeline](https://github.com/tektoncd/pipeline). The hosting repository is on Quay.io [here](https://quay.io/repository/microcks/microcks-cli).\n\nBelow a sample on how using the image without getting the CLI binary:\n\n```\n$ docker run -it quay.io/microcks/microcks-cli:latest microcks-cli test 'Beer Catalog API:0.9' http://beer-catalog-impl-beer-catalog-dev.apps.144.76.24.92.nip.io/api/ POSTMAN --microcksURL=http://microcks.apps.144.76.24.92.nip.io/api/ --keycloakClientId=microcks-serviceaccount --keycloakClientSecret=7deb71e8-8c80-4376-95ad-00a399ee3ca1 --waitFor=8sec  --operationsHeaders='{\"globals\": [{\"name\": \"x-api-key\", \"values\": \"my-values\"}], \"GET /beer\": [{\"name\": \"x-trace-id\", \"values\": \"xcvbnsdfghjklm\"}]}'\n```\n\n\n## Tekton tasks\n\nThis repository also contains different [Tekton](https://tekton.dev/) tasks definition and sample pipelines. You'll find under the `/tekton` folder the resource for current `v1beta1` Tekton API version and the older `v1alpha1` under `tekton/v1alpha1`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocks%2Fmicrocks-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrocks%2Fmicrocks-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocks%2Fmicrocks-cli/lists"}