{"id":13579852,"url":"https://github.com/hakopako/openapi-cli-tool","last_synced_at":"2025-08-24T08:16:22.974Z","repository":{"id":53533337,"uuid":"189242303","full_name":"hakopako/openapi-cli-tool","owner":"hakopako","description":"OpenAPI (Swagger 3.x) CLI Tool. Supports multiple file extensions. Can list up defined API paths and bundle multi-file into one.","archived":false,"fork":false,"pushed_at":"2021-03-25T22:39:38.000Z","size":215,"stargazers_count":23,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T03:35:29.813Z","etag":null,"topics":["bundle","cli","command-line","merge","openapi-generator","openapi-spec","openapi3","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/openapi-cli-tool/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hakopako.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-29T14:31:14.000Z","updated_at":"2024-10-29T21:41:49.000Z","dependencies_parsed_at":"2022-08-20T12:20:15.125Z","dependency_job_id":null,"html_url":"https://github.com/hakopako/openapi-cli-tool","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakopako%2Fopenapi-cli-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakopako%2Fopenapi-cli-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakopako%2Fopenapi-cli-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakopako%2Fopenapi-cli-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hakopako","download_url":"https://codeload.github.com/hakopako/openapi-cli-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476458,"owners_count":21110289,"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":["bundle","cli","command-line","merge","openapi-generator","openapi-spec","openapi3","python"],"created_at":"2024-08-01T15:01:44.011Z","updated_at":"2025-04-11T20:32:16.466Z","avatar_url":"https://github.com/hakopako.png","language":"Python","readme":"![openapi-cli-tool](https://raw.githubusercontent.com/hakopako/openapi-cli-tool/master/doc/logo.png)\n\n\n[![Build Status](https://travis-ci.com/hakopako/openapi-cli-tool.svg?branch=master)](https://travis-ci.com/hakopako/openapi-cli-tool)\n \u003cimg src=\"https://img.shields.io/badge/version-v0.3.0-green.svg\"\u003e\n \u003cimg src=\"https://img.shields.io/badge/license-MIT-lightgray.svg\"\u003e  \n\u003cimg src=\"https://img.shields.io/badge/python-2.7,3.4\u003c=-blue.svg\"\u003e \u003cimg src=\"https://img.shields.io/badge/swagger-3.x-yellow.svg\"\u003e\n\n# openapi-cli-tool\nOpenAPI (Swagger 3.x) CLI Tool.  \n\n- Supports multiple file extensions (json|yaml|yml).\n- Can list up defined API paths.\n- Display an API specification which is resolved (`$ref`).\n- Bundle multi-file into one (output to json|yaml|html).\n- OAS interactive scaffolding.  \n\n# Requirements\n\nPython 2.7, 3.4 \u003c=.\n\n# Installation\n\nWith pip:\n\n```bash\n$ pip install openapi-cli-tool\n```\nManually:  \nClone the repository and execute the Python installation command on your machine.  \n\n```bash\n$ pip -r requirements.txt install\n$ python setup.py install\n```\n\nThen `openapi-cli-tool` command is installed.\n\n# Usage\n\n```\n$ openapi-cli-tool --help\nUsage: openapi-cli-tool [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  bundle    Bundle multiple files into one.\n  list      List up API paths in a file or directory.\n  resolve   Display `$ref` resolved API specification.\n  scaffold  Interactively create a simple OpenAPI Specification.\n```\n\n## Bundle\n\nBundle multi-file specifications into one, regardless of file extension (json|yaml|yml).\n\n```\n$ openapi-cli-tool bundle --help\nUsage: openapi-cli-tool bundle [OPTIONS] FILE_PATHS\n\n  Bundle multiple files into one.\n\nOptions:\n  -f, --file TEXT  Load common objects such as info and servers from a\n                   specific file. Default is a file which is the top of list\n                   command result.\n  -t, --type TEXT  Export data type. {json|yaml|html}  [default: json]\n  --help           Show this message and exit.\n```\n\nexample:\n```\n$ openapi-cli-tool bundle -t html file1.json file2.yaml` \u003e ./specification.html\n```\n\nIn the html file, an unpkg version of [swagger-ui](https://github.com/swagger-api/swagger-ui) is embedded. Rendered screenshot below:  \n\n\n![bundle-html-img](https://raw.githubusercontent.com/hakopako/openapi-cli-tool/master/doc/bundle-html.png)\n\n\n## List\n\nList up API paths from a file/directory regardless of the file extension (json|yaml|yml).\n\n```bash\n$ openapi-cli-tool list `find ./spec`\n\nMethod    Path       File\n--------  ---------  ------------------------------------------\nPUT       /avatar    ./tests/resources/spec/sample.yml\nGET       /follwers  ./tests/resources/spec/folder1/sample2.yaml\nPOST      /follwers  ./tests/resources/spec/folder1/sample2.yaml\nPUT       /follwers  ./tests/resources/spec/folder1/sample2.yaml\nPOST      /pets      ./tests/resources/spec/sample.yml\nGET       /posts     ./tests/resources/spec/folder1/sample.json\nPOST      /posts     ./tests/resources/spec/folder1/sample.json\nGET       /users     ./tests/resources/spec/folder1/sample.json\nPOST      /users     ./tests/resources/spec/folder1/sample.json\n```\n\n\n## Resolve\n\nDisplay an API specification which is resolved from  a multi-file API specification via $ref pointers.  \n\n```\nUsage: openapi-cli-tool resolve [OPTIONS] METHOD PATH FILE_PATHS\n\n  Display `$ref` resolved API specification.\n\nOptions:\n  -t, --type TEXT  Export data type. {json|yaml}  [default: json]\n  --help           Show this message and exit.\n```\n\nexample:\n```bash\n$ openapi-cli-tool resolve post /cats `find ./tests/resources/spec`\n```\n\n\n## Scaffold\n\nInteractively input information of your API.  \nA simple OpenAPI Specification is generated from your prompt.\n\n```bash\n$ openapi-cli-tool scaffold\n\nPlease enter title [\"\"]: sample\nPlease enter version [v1.0]:\nPlease enter license [Apache 2.0]:\nPlease enter server url [http://example.com]:\nPlease enter path [/]: /example\nPlease enter method for /example [get|post|put|delete|head|option|trace]: get\nPlease enter description for get /example [\"\"]: sample get endpoint\nPlease enter response code for get /example [200]:\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakopako%2Fopenapi-cli-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhakopako%2Fopenapi-cli-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakopako%2Fopenapi-cli-tool/lists"}