chore: rename of example
This commit is contained in:
parent
7d70e03a75
commit
bf8a6bbdce
3 changed files with 63 additions and 44 deletions
41
README.md
41
README.md
|
@ -37,13 +37,13 @@ On your website you will need to use `.well-know/wacli.json` file:
|
||||||
"contentType": "application/json",
|
"contentType": "application/json",
|
||||||
"aliases": [{
|
"aliases": [{
|
||||||
"alias": "<short_hand>" | ["short_hand","long_hand"],
|
"alias": "<short_hand>" | ["short_hand","long_hand"],
|
||||||
"type": "path" | "method",
|
"type": "path" | "method" | "bin",
|
||||||
"description": "description of cli command"
|
"description": "description of cli command"
|
||||||
"path": "<path>"
|
"content": "<path>"
|
||||||
}],
|
}],
|
||||||
"auth": {
|
"auth": {
|
||||||
"sheme": "basic" | "bearer" | "oauth2"
|
"scheme": "basic" | "bearer" | "oauth2"
|
||||||
"token": "<name_of_token>" // - bearer
|
"tokenName": "<name_of_token>" // - bearer
|
||||||
// oauth2
|
// oauth2
|
||||||
"flows": {
|
"flows": {
|
||||||
"implict": {
|
"implict": {
|
||||||
|
@ -60,50 +60,55 @@ On your website you will need to use `.well-know/wacli.json` file:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"api": "https://codeberg.org/api/v1",
|
"api": "https://git.0ut0f.space/swagger.v1.json",
|
||||||
"settings": {
|
"settings": {
|
||||||
"aliases": [
|
"aliases": [
|
||||||
{
|
{
|
||||||
"alias": "i",
|
"alias": "issues",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"path": "/repos/{owner}/{repo}/issues"
|
"content": "/repos/{owner}/{repo}/issues"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": "create",
|
"alias": ["c","create"],
|
||||||
"type": "method",
|
"type": "method",
|
||||||
"method": "POST"
|
"content": "POST"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": "tea",
|
"alias": "tea",
|
||||||
"type": "bin",
|
"type": "bin",
|
||||||
"bin": "tea"
|
"content": "tea"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}]
|
"linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}],
|
||||||
|
"windows": [{"x86": "https://dl.gitea.com/tea/main/tea-main-windows-amd64.xz"}],
|
||||||
|
"darwin": [
|
||||||
|
{"arm64": "https://dl.gitea.com/tea/main/tea-main-darwin-arm64"},
|
||||||
|
{"x86": "https://dl.gitea.com/tea/main/tea-main-darwin-amd64.xz"}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Next REST API - `https://codeberg.org/api/v1/repos/{owner}/{repo}/issues` method is transform command:
|
Next REST API - `https://git.0ut0f.space/api/v1/repos/{owner}/{repo}/issues` method is transform command:
|
||||||
|
|
||||||
By default - GET request:
|
By default - GET request:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli codeberg.org repos issues [owner] [repo]
|
wacli git.0ut0f.space repos issues [owner] [repo]
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need a request other than GET, then add the command
|
If you need a request other than GET, then add the command
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli codeberg.org post|delete|put|path repos issues [owner] [repo]
|
wacli git.0ut0f.space post|delete|put|path repos issues [owner] [repo]
|
||||||
```
|
```
|
||||||
|
|
||||||
Such requests may require authorization, so you must log in separately:
|
Such requests may require authorization, so you must log in separately:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli auth codeberg.org
|
wacli auth git.0ut0f.space
|
||||||
```
|
```
|
||||||
|
|
||||||
tokens are stored separately in the database.
|
tokens are stored separately in the database.
|
||||||
|
@ -111,7 +116,7 @@ tokens are stored separately in the database.
|
||||||
Methods can be overridden:
|
Methods can be overridden:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli codeberg.org create repos issues [owner] [repo]
|
wacli git.0ut0f.space create repos issues [owner] [repo]
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, all request in clearnet and tor go via `https`, but i2p - `http`.
|
By default, all request in clearnet and tor go via `https`, but i2p - `http`.
|
||||||
|
@ -119,7 +124,7 @@ By default, all request in clearnet and tor go via `https`, but i2p - `http`.
|
||||||
But sometimes you need to specify a specific protocol
|
But sometimes you need to specify a specific protocol
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli bin "git+http://codeberg.org/"
|
wacli bin "git+http://git.0ut0f.space/"
|
||||||
```
|
```
|
||||||
|
|
||||||
Binaries is install of user directory `$HOME/.local/bin`, for root user - `/usr/local/bin`.
|
Binaries is install of user directory `$HOME/.local/bin`, for root user - `/usr/local/bin`.
|
||||||
|
@ -127,7 +132,7 @@ Binaries is install of user directory `$HOME/.local/bin`, for root user - `/usr/
|
||||||
Perhaps not everyone will add tools to their sites, so for popular tools using directive:
|
Perhaps not everyone will add tools to their sites, so for popular tools using directive:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wacli registry:codeberg repos issues
|
wacli registry:forgejo repos issues
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also get help on all api methods using the command
|
You can also get help on all api methods using the command
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"api": "https://codeberg.org/api/v1",
|
|
||||||
"settings": {
|
|
||||||
"aliases": [
|
|
||||||
{
|
|
||||||
"alias": "i",
|
|
||||||
"type": "path",
|
|
||||||
"path": "/repos/{owner}/{repo}/issues"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": "create",
|
|
||||||
"type": "method",
|
|
||||||
"method": "POST"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": "tea",
|
|
||||||
"type": "bin",
|
|
||||||
"bin": "tea"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
40
example/.well-known/git.0ut0f.space/wacli.json
Normal file
40
example/.well-known/git.0ut0f.space/wacli.json
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"api": "https://git.0ut0f.space/swagger.v1.json",
|
||||||
|
"settings": {
|
||||||
|
"auth": {
|
||||||
|
"scheme": "bearer",
|
||||||
|
"tokenName": "AuthorizationHeaderToken"
|
||||||
|
},
|
||||||
|
"aliases": [
|
||||||
|
{
|
||||||
|
"alias": "issues",
|
||||||
|
"type": "path",
|
||||||
|
"content": "/repos/{owner}/{repo}/issues"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": ["c","create"],
|
||||||
|
"type": "method",
|
||||||
|
"content": "POST"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": ["d","delete"],
|
||||||
|
"type": "method",
|
||||||
|
"content": "DELETE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "tea",
|
||||||
|
"type": "bin",
|
||||||
|
"content": "tea"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}],
|
||||||
|
"windows": [{"x86": "https://dl.gitea.com/tea/main/tea-main-windows-amd64.xz"}],
|
||||||
|
"darwin": [
|
||||||
|
{"arm64": "https://dl.gitea.com/tea/main/tea-main-darwin-arm64"},
|
||||||
|
{"x86": "https://dl.gitea.com/tea/main/tea-main-darwin-amd64.xz"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue