{"id":36706445,"url":"https://github.com/frost373/w2j-cli","last_synced_at":"2026-01-12T11:43:10.070Z","repository":{"id":57743400,"uuid":"131005432","full_name":"frost373/w2j-cli","owner":"frost373","description":"JavaWeb CLI Framework,Simple and easy to use. 简单易用的Javaweb 命令行框架","archived":false,"fork":false,"pushed_at":"2019-02-27T11:07:49.000Z","size":107,"stargazers_count":100,"open_issues_count":1,"forks_count":5,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-07-21T11:49:32.966Z","etag":null,"topics":["cli","web"],"latest_commit_sha":null,"homepage":"","language":"Java","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/frost373.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}},"created_at":"2018-04-25T12:48:36.000Z","updated_at":"2025-06-19T02:24:44.000Z","dependencies_parsed_at":"2022-08-25T23:20:13.432Z","dependency_job_id":null,"html_url":"https://github.com/frost373/w2j-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/frost373/w2j-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frost373%2Fw2j-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frost373%2Fw2j-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frost373%2Fw2j-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frost373%2Fw2j-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frost373","download_url":"https://codeload.github.com/frost373/w2j-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frost373%2Fw2j-cli/sbom","scorecard":{"id":412227,"data":{"date":"2025-08-11","repo":{"name":"github.com/frost373/w2j-cli","commit":"de5409a18a7cfba545e2976797acb5942db5c2ef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T23:00:12.970Z","repository_id":57743400,"created_at":"2025-08-18T23:00:12.970Z","updated_at":"2025-08-18T23:00:12.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","web"],"created_at":"2026-01-12T11:43:09.536Z","updated_at":"2026-01-12T11:43:10.065Z","avatar_url":"https://github.com/frost373.png","language":"Java","readme":"# W2J-CLI\n\nJavaWeb Command-line Framework, help you easily build a command line JavaWeb System.  \nIt can be easily combined with any Java framework , and no other dependency.Even you don't need create a HTML page.\n\n## Why need it\n- Some functions are provided to professional and do not want to invest in developing front-end.\n- Quick development for a simple management system\n- provided some tools through a web page\n- Quick,simple,fun,geek and so on\n\n## Get it \n##### Maven  \n```xml\n\u003c!-- https://mvnrepository.com/artifact/top.thinkin/w2j-cli-core --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003etop.thinkin\u003c/groupId\u003e\n    \u003cartifactId\u003ew2j-cli-core\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n##### Gradle\n```\n// https://mvnrepository.com/artifact/top.thinkin/w2j-cli-core\ncompile group: 'top.thinkin', name: 'w2j-cli-core', version: '0.1.3'\n```\n\n## Some examples\n\n#### Base\nBase input and output,Text-table, Confirm,Auto-Complete\n\n![image](https://raw.githubusercontent.com/wiki/frost373/w2j-cli/img/base.gif)\n\ncreate a class and write annotations for root command,commands and parameters\n\n```java\n@HJRoot(name=\"task\",help = \"task related operation\")\npublic class TaskTest {\n    @HJCommand(name = \"list\",help = \"get the list of task\")\n    public String list(\n            @HJValue(name=\"start\",help = \"start time. example：2017-12-1\")\n                    String start,\n            @HJValue(name=\"end\",help = \"end time. example：2018-12-1\")\n                    String end\n    ) throws WjException {\n        TextTable table =  TextTable.create();\n        table.config(\"id\");\n        table.config(\"name\");\n        table.config(\"status\");\n        table.config(\"createTime\");\n\n        table.add(Arrays.asList(\"1\",\"task-1\",\"open\",\"2017-12-1\"));\n        table.add(Arrays.asList(\"2\",\"task-2\",\"open\",\"2017-12-2\" ));\n\n        return View.text(table.buildTable());\n    }\n\n    @HJCommand(name = \"stop\",ask = true,help = \"stop the task\")\n    public String close(\n            @HJValue(name=\"id\",help = \"the task id\",req = true)\n                    String id,\n            @HJContext()\n                    Context context\n\n    ){\n        return View.text(\"task is closed\");\n    }\n}\n```\n\n\n\n#### Help\nBased on you annotations, W2J-CLI could automatically generate the help documents\n\n\n![image](https://raw.githubusercontent.com/wiki/frost373/w2j-cli/img/help.gif)\n\n\n#### Login\n W2J-CLI have provided a built-in login module.\n\n![image](https://raw.githubusercontent.com/wiki/frost373/w2j-cli/img/login.gif)\n\nThis codes simulates a simple logon process   \n```java\npublic class YesLogin implements WJLogin\u003cContext\u003e {\n\n    public final static String AUTH = \"LX2F8rdCA2wKel9yR42\";\n\n    public  String login(String root, String pass, Context context) {\n        if(\"root\".equals(root)\u0026\u0026\"pass\".equals(pass)){\n            return View.OK(AUTH);\n        }else{\n            return View.error(\"error\");\n        }\n    }\n\n    public  boolean filter(String auth, Context context) {\n\n        if(AUTH.equals(auth)){\n            return true;\n        }else{\n            return false;\n        }\n    }\n}\n```\n\n\n\n#### Use scripts to get more powerful functions\nUsers can create scripts to achieve stronger functionality.\nOf course, there are some commonly used built-in scripts.Likes loop command script, you can use it to achieve some animation effects.\n```Java\n/**\n     * Circular sending command.\n     * The result will be displayed on the screen and overlay the last display.\n     * @param cli\n     * @param stopPrefix If the prefix is this, the loop will stop\n     * @param interval Time interval of a request\n     * @return\n     */\nString script = ScriptKits.LOOP_CLI(\"task get -id \"+id,\"ok\",500);\n```\n![image](https://raw.githubusercontent.com/wiki/frost373/w2j-cli/img/atom.gif)\n\n\n\n## Getting Started\n\nW2J-CLI can combined with any Java framework,likes spring,sptingMVC,struts2 and so on.   \nThere has a example for combined with base servlet，you can get other ways in wiki    \n\n**build web.xml**\n```xml\n\u003cservlet\u003e\n    \u003cservlet-name\u003eDispatcherServlet\u003c/servlet-name\u003e\n    \u003cservlet-class\u003etop.test.web.TestAction\u003c/servlet-class\u003e\n    \u003cload-on-startup\u003e1\u003c/load-on-startup\u003e\n  \u003c/servlet\u003e\n\n \u003cservlet\u003e\n    \u003cservlet-name\u003eHtmlServlet\u003c/servlet-name\u003e\n    \u003cservlet-class\u003etop.test.web.HtmlAction\u003c/servlet-class\u003e\n    \u003cload-on-startup\u003e1\u003c/load-on-startup\u003e\n  \u003c/servlet\u003e\n \n  \u003cservlet-mapping\u003e\n    \u003cservlet-name\u003eDispatcherServlet\u003c/servlet-name\u003e\n    \u003curl-pattern\u003e/api/*\u003c/url-pattern\u003e\n  \u003c/servlet-mapping\u003e\n\n  \u003cservlet-mapping\u003e\n    \u003cservlet-name\u003eHtmlServlet\u003c/servlet-name\u003e\n    \u003curl-pattern\u003e/html\u003c/url-pattern\u003e\n  \u003c/servlet-mapping\u003e\n```\n\n**build html Servlet**   \n```java\npublic class HtmlAction extends HttpServlet {\n    HTMLConfig config;\n    public void init() throws ServletException {\n        try {\n            // the postUrl is necessary ，if you use built-in login module needLogin must be true\n            // there has some other configuration items,you can get them in wiki\n            config =  HTMLConfig.cteate().setPostUrl(\"http://127.0.0.1:8082/api\").needLogin(true).build();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n        req.setCharacterEncoding(\"UTF-8\");\n        resp.setContentType(\"text/html;charset=UTF-8\");\n        PrintWriter writer = resp.getWriter();\n        writer.write(config.html());\n        writer.close();\n    }\n}\n```\n**build the handler Servlet**  \n```java\npublic class TestAction  extends HttpServlet {\n    CommandManage commandManage;\n    public void init(){\n        try {\n            commandManage =  CommandManage.config()\n                    .setLogin(new YesLogin()).add(new HelloTest()).add(new TaskTest());\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n\n    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n        req.setCharacterEncoding(\"UTF-8\");\n        Context context = new Context();//the context of your design\n        \n        String cli =  req.getParameter(\"cli\");//get the command line\n        String auth =  req.getParameter(\"auth\");//get the login authcode\n        String x = null;\n        try {\n            x = commandManage.handleCommand(cli,context,auth);\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        resp.setContentType(\"text/html;charset=UTF-8\");\n        PrintWriter writer = resp.getWriter();\n        writer.write(x);\n        writer.close();\n    }\n}\n```\n\n### Prerequisites\n\nJDK 1.6+ \n\n## Authors\n* **Dong Bin** - *Initial work* - [BOLG](http://thinkin.top)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* Hat tip to anyone who's code was used\n* Inspiration\n* etc\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrost373%2Fw2j-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrost373%2Fw2j-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrost373%2Fw2j-cli/lists"}