{"id":18559132,"url":"https://github.com/linux-china/spring-boot-starter-shell","last_synced_at":"2025-04-10T02:30:40.075Z","repository":{"id":136596262,"uuid":"58379068","full_name":"linux-china/spring-boot-starter-shell","owner":"linux-china","description":"Spring Shell with Spring Boot Driven","archived":false,"fork":false,"pushed_at":"2017-09-13T08:51:43.000Z","size":10,"stargazers_count":17,"open_issues_count":5,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T02:51:14.433Z","etag":null,"topics":["spring-boot","spring-shell"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/linux-china.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":"2016-05-09T13:35:11.000Z","updated_at":"2021-11-08T06:55:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c53349e-a1bd-4ca9-aab3-1e8ada5b656d","html_url":"https://github.com/linux-china/spring-boot-starter-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-starter-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-starter-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-starter-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-starter-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/spring-boot-starter-shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144158,"owners_count":21054876,"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":["spring-boot","spring-shell"],"created_at":"2024-11-06T21:42:08.981Z","updated_at":"2025-04-10T02:30:40.069Z","avatar_url":"https://github.com/linux-china.png","language":"Java","readme":"spring-boot-start-shell\n=======================\nSpring Shell with Spring Boot Driven\n\n### How to use\n\n* Add spring-boot-starter-shell dependency in application's pom.xml: \n\n```xml\n    \u003cdependency\u003e\n       \u003cgroupId\u003eorg.mvnsearch.spring.boot\u003c/groupId\u003e\n       \u003cartifactId\u003espring-boot-starter-shell\u003c/artifactId\u003e\n       \u003cversion\u003e1.0.0-SNAPSHOT\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n* Add Spring Boot Maven Plugin in your pom.xml: \n\n```xml\n   \u003cplugin\u003e\n       \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n       \u003cartifactId\u003espring-boot-maven-plugin\u003c/artifactId\u003e\n       \u003cversion\u003e1.4.0.RELEASE\u003c/version\u003e\n       \u003cexecutions\u003e\n           \u003cexecution\u003e\n               \u003cgoals\u003e\n                   \u003cgoal\u003erepackage\u003c/goal\u003e\n               \u003c/goals\u003e\n           \u003c/execution\u003e\n       \u003c/executions\u003e\n       \u003cconfiguration\u003e\n           \u003c!-- do not enable it, this will creats a non standard jar and cause autoconfig to fail --\u003e\n           \u003cexecutable\u003efalse\u003c/executable\u003e\n       \u003c/configuration\u003e\n   \u003c/plugin\u003e\n```\n\n* Add following code in your Spring Boot Application main method:\n\n```\n    @SpringBootApplication\n    public class DemoApplication {\n    \n        public static void main(String[] args) {\n            SpringShellApplication.run(DemoApplication.class, args);\n        }\n    }\n```\n\n* Of course, create your Spring Shell commands.\n\n```\n@Component\npublic class HelloCommands implements CommandMarker {\n    @CliCommand(value = \"hello\", help = \"CMS \")\n    public String hello() {\n        return \"hello\";\n    }\n}\n```\n\n* Build your application and run it.\n\n```\n   $ mvn -DskipTests clean package\n   $ java -jar target/xxxx.jar\n```\n\n### Tips\n\n* Possible Configuration in your application.properties: \n\n```properties\nspring.main.banner-mode=off\n```\n\n* logback-spring.xml configuration to mute some log: \n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfiguration\u003e\n\n    \u003c!--stdout appender--\u003e\n    \u003cappender name=\"CONSOLE\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n        \u003cencoder\u003e\n            \u003cpattern\u003e%d %-5level %logger{36} - %msg%n\u003c/pattern\u003e\n        \u003c/encoder\u003e\n    \u003c/appender\u003e\n\n    \u003croot level=\"ERROR\"\u003e\n        \u003cappender-ref ref=\"CONSOLE\"/\u003e\n    \u003c/root\u003e\n\n\u003c/configuration\u003e\n```\n\n\n### Todo\n\nMigrate to: https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-shell-core/src/main/java/org/springframework/cloud/dataflow/shell/autoconfigure/BaseShellAutoConfiguration.java\n\n### References\n\n* Spring Shell Document: http://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/\n* ASCII Generator: http://www.network-science.de/ascii/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-boot-starter-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fspring-boot-starter-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-boot-starter-shell/lists"}