{"id":18896809,"url":"https://github.com/shakibamoshiri/secli","last_synced_at":"2026-02-28T15:30:23.041Z","repository":{"id":65799226,"uuid":"582573304","full_name":"shakibamoshiri/secli","owner":"shakibamoshiri","description":"Bash CLI  to manage SoftEther VPN Server using JSON-RPC","archived":false,"fork":false,"pushed_at":"2023-02-19T13:51:03.000Z","size":176,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T08:16:18.239Z","etag":null,"topics":["secli","softether","softether-vpn","vpn"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/shakibamoshiri.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":"2022-12-27T08:48:52.000Z","updated_at":"2023-03-21T10:18:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"b41565d0-fc64-4528-b0f9-86eed2ef9126","html_url":"https://github.com/shakibamoshiri/secli","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/shakibamoshiri%2Fsecli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fsecli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fsecli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fsecli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakibamoshiri","download_url":"https://codeload.github.com/shakibamoshiri/secli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239877132,"owners_count":19712020,"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":["secli","softether","softether-vpn","vpn"],"created_at":"2024-11-08T08:35:26.449Z","updated_at":"2026-02-28T15:30:22.866Z","avatar_url":"https://github.com/shakibamoshiri.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# secli\nBash CLI to manage SoftEther VPN Server using JSON-RPC\n\nSoftEther server can be managed by JSON-RPC, but there was not a CLI to manage it from a Terminal.  \n`secli` tries to be a SE server client written in Bash to manage a SE server.\n\n## prerequisites\nThe CLI needs the following in order to function properly:  \n\n- [Bash](https://www.gnu.org/software/bash/) v4.4 or higher\n- jq [project](https://stedolan.github.io/jq/), [download](https://stedolan.github.io/jq/)\n- yq [project](https://github.com/mikefarah/yq), [download](https://github.com/mikefarah/yq/releases)\n- [perl](https://www.perl.org/) \n- some other Linux commands. e.g. printf, grep, etc\n\n## CIL architecture\nUnlink traditional Unix/Linux CLIs which all the functionalities are managed by options (i.e `--option`); `secli` uses **Pipeline Architecture**. \nThis architecture helps to have:  \n- software testability\n- software modularity\n- software extendability\n- component/function reusability\n- and more\n\n[See Software Non-functional requirement](https://en.wikipedia.org/wiki/Non-functional_requirement).  \n\n\nThus `secli` does not follow traditional option based CLIs, as you might expect like bellow samples:\n\n```bash\n./secli --admin --admin-password \u003cPASSWORD\u003e --add-user --user-name XYZ --user-pass 123@XYZ --enable-policy vpn.example.com\n```\n\nAnd `secli` handles its functionality using pipe (**Name Pipe in Linux** == `|`). Here is an example apply Test:\n\n### Test (Test RPC function)\n\n```bash\nsecli Test | secli config -f admin.yaml -t local | secli apply\n```\n\nOutput:\n\n```json\n{\n  \"method\": \"Test\",\n  \"result\": {\n    \"Int64Value_u64\": 0,\n    \"IntValue_u32\": 0,\n    \"StrValue_str\": \"0\",\n    \"UniStrValue_utf\": \"\"\n  },\n  \"jsonrpc\": \"2.0\",\n  \"id\": \"rpc_call_id\"\n}\n```\n\n - Test: the JSON-RPC for testing the server is up or no\n - config: add our server credentials to the JSON-RPC \n - apply: send JSON-RPC of Test to server and use credentials for authentication\n\nAnd **admin.yaml** file is:\n\n```yaml\nsecli:\n  local:\n    address: localhost\n    port: 443\n    password: 1234\n```\n\n - local: a target name for `-t`\n - address: SE server address (domain name) or IP\n - port: SE server port\n - password: SE server administrator password\n\n\n![Test.png](shots/Test.png)\n\n---\n\n## JSON-RPCs have been added\n\n - `Test                 Test RPC function`\n - `GetServerInfo        Get server information`\n - `GetServerStatus      Get Current Server Status`\n - `CreateListener       Create New TCP Listener`\n - `EnumListener         Get List of TCP Listeners`\n - `DeleteListener       Delete TCP Listener`\n - `EnableListener       Enable / Disable TCP Listener`\n - `CreateUser           Create a user`\n - `SetUser              Change User Settings`\n - `GetUser              Get User Settings`\n - `DeleteUser           Delete a user`\n - `EnumUser             Get List of Users`\n - `EnumSession          Get List of Connected VPN Sessions`\n - `GetSessionStatus     Get Session Status`\n - `DeleteSession        Disconnect Session`\n\nOthers will be added gradually.  \nYou can ask/request for new JSON-RPC be added or contribute and send PR (Pull Request).  \n[Here is the full list](https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/developer_tools/vpnserver-jsonrpc-clients).\n\n\n## features\n\nBeyond common expected functionalities  \n\n - add a user\n - delete a user\n - enable / disable a user\n - etc\n\nThere are out-of-box features  \n\n - human readable output\n - three output formats (JSON, YAML, table)\n - set a user data limitation and block if exceeded\n\nPlanned more will be added\n\n## samples\n\n**List of users of a HUB in table format on my local machine**  \nIt could be any server anywhere.  \n\n\n```bash\nsecli user --enum local vpn | secli parse --table\n```\n\noutput\n\n```bash\nhub  username  realname     blocked  logins  etime                 llogin                traffic\nvpn  491bxd    user_491bxd  false    0       2023-03-09T23:39:30Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  7ehhzq    user_7ehhzq  false    0       2023-03-09T23:33:53Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  bh0i1s    user_bh0i1s  false    0       2023-03-09T23:31:24Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  d36que    user_d36que  false    0       2023-03-09T23:33:35Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  eutjiy    user_eutjiy  false    0       2023-03-09T23:35:58Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  fkxaci    user_fkxaci  false    0       2023-03-09T23:26:37Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  h9xein    user_h9xein  false    0       2023-03-09T23:33:21Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  tmit5k    user_tmit5k  false    0       2023-03-09T23:28:48Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  uyybel    user_uyybel  false    0       2023-03-09T23:26:56Z  1970-01-01T09:00:00Z  1073741824  0          1073741824\nvpn  vpn       shakiba      false    28      2023-12-30T20:30:00Z  2023-02-10T11:39:16Z  9000000000  329668722  8670331278\n```\n\n**List online users (sessions) of a HUB in YAML format.**\n\n\n```bash\nsecli session --enum local vpn | secli parse --yaml\n```\n\noutput\n\n```yaml\n- username: Cascade\n  client_ip: '::'\n  session_id: SID-LINK-1\n  hostname: '-'\n  max_tcp: 0\n  uptime: 1324\n  index: 1\n- username: vpn\n  client_ip: 192.168.1.178\n  session_id: SID-VPN-[L2TP]-2\n  hostname: 192.168.1.178\n  max_tcp: 1\n  uptime: 21\n  index: 2\n```\n\nor table format\n\n```bash\nsecli session --enum local vpn | secli parse --table\n```\n\noutput\n\n```bash\nusername  client_ip      session_id        hostname       max_tcp  uptime  index\nCascade   ::             SID-LINK-1        -              0        1332    1\nvpn       192.168.1.178  SID-VPN-[L2TP]-2  192.168.1.178  1        29      \n```\n\nBy default it will be JSON format\n\n```bash\nsecli session --enum local vpn\n```\n\noutput\n\n\n```json\n{\n  \"method\": \"EnumSession\",\n  \"parsed\": true,\n  \"result\": [\n    {\n      \"username\": \"Cascade\",\n      \"client_ip\": \"::\",\n      \"session_id\": \"SID-LINK-1\",\n      \"hostname\": \"-\",\n      \"max_tcp\": 0,\n      \"uptime\": 1544,\n      \"index\": 1\n    },\n    {\n      \"username\": \"vpn\",\n      \"client_ip\": \"192.168.1.178\",\n      \"session_id\": \"SID-VPN-[L2TP]-2\",\n      \"hostname\": \"192.168.1.178\",\n      \"max_tcp\": 1,\n      \"uptime\": 241,\n      \"index\": 2\n    }\n  ]\n}\n```\n\n## contributors \n\nAny new \n - ideas\n - functionalities\n - RPC-JSON support\n - PR (pull request)\n    - you know Bash + best practices of coding\n - Bug reports \n\nare welcome.\n\n## license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fsecli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakibamoshiri%2Fsecli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fsecli/lists"}