├── bin
├── brew_install_htop.json
└── conda.json
├── browser
├── close.json
└── open.json
├── callbackwindows
├── download_with_callback_action.json
├── open_with_callback_action.json
└── open_with_callback_uri.json
├── datastructure
├── concat_local.json
├── push_local.json
├── push_self.json
├── rm_local.json
├── rm_self.json
├── set_global.json
├── set_local.json
└── set_self.json
├── flow
├── goto.json
├── goto_with_input.json
├── sleep.json
└── switch.json
├── fs
├── .gitignore
├── download_file.json
├── read_base64.json
├── read_text.json
├── write_buffer.json
├── write_json.json
└── write_text.json
├── graphics
└── index.js
├── icon.png
├── input
├── allfields.json
├── config.json
├── formless.json
├── inbetween.json
├── index.json
├── key.json
├── login.json
├── notifyinput.json
└── test
│ └── package.json
├── load
├── index.json
├── load_and_set.json
├── local_load.json
└── prompt.json
├── memory
├── current.json
├── next.json
└── undefined.json
├── net
├── get_json.json
├── get_text.json
└── post_json.json
├── notify
├── image_notification.json
├── open_in_browser.json
└── open_in_pinokio.json
├── pinokio.js
├── python.json
├── requires
├── brew.json
├── conda.json
├── npm.json
├── pip.json
└── platform.json
├── shell
├── array_env.json
├── array_prepend_PATH.json
├── capturing_url_in_terminal.json
├── conda.json
├── done_shell_event.json
├── env.json
├── event.json
├── kill_shell_event.json
├── locate.json
├── multi.json
├── node.json
├── npminitializer
│ └── initialize.json
├── npx.json
├── package.json
├── parse_shell.json
├── server.json
├── sh.json
├── start_and_write.json
├── start_with_message.json
├── starte_and_enter.json
├── sudo.json
├── sudo_with_multiple_commands.json
├── venv.json
└── write.json
└── vars
└── print.json
/bin/brew_install_htop.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": "brew install htop"
6 | }
7 | }, {
8 | "method": "shell.run",
9 | "params": {
10 | "message": "htop"
11 | }
12 | }]
13 | }
14 |
--------------------------------------------------------------------------------
/bin/conda.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": "git clone https://github.com/cocktailpeanut/DragGAN.git"
6 | }
7 | }, {
8 | "method": "shell.run",
9 | "params": {
10 | "message": "conda env create -f environment.yml",
11 | "path": "DragGAN"
12 | }
13 | }, {
14 | "method": "shell.start",
15 | "params": {
16 | "path": "DragGAN"
17 | }
18 | }, {
19 | "method": "shell.enter",
20 | "params": {
21 | "message": "conda activate stylegan3",
22 | "on": [{
23 | "event": null,
24 | "return": true
25 | }]
26 | }
27 | }, {
28 | "method": "shell.enter",
29 | "params": {
30 | "message": "pip install -r requirements.txt",
31 | "on": [{
32 | "event": null,
33 | "return": true
34 | }]
35 | }
36 | }]
37 | }
38 |
--------------------------------------------------------------------------------
/browser/close.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "URL",
6 | "type": "notify",
7 | "form": [{
8 | "key": "uri",
9 | "placeholder": "enter a URL to open"
10 | }]
11 | }
12 | }, {
13 | "method": "browser.open",
14 | "params": {
15 | "uri": "{{input.uri}}",
16 | "target": "new"
17 | }
18 | }, {
19 | "method": "process.wait",
20 | "params": {
21 | "sec": 2
22 | }
23 | }, {
24 | "method": "browser.close",
25 | "params": {
26 | "target": "new"
27 | }
28 | }]
29 | }
30 |
--------------------------------------------------------------------------------
/browser/open.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "URL",
6 | "type": "notify",
7 | "form": [{
8 | "key": "url",
9 | "placeholder": "enter a URL to open"
10 | }]
11 | }
12 | }, {
13 | "method": "browser.open",
14 | "params": {
15 | "uri": "{{input.url}}",
16 | "target": "_blank"
17 | }
18 | }]
19 | }
20 |
--------------------------------------------------------------------------------
/callbackwindows/download_with_callback_action.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "browser.open",
4 | "params": {
5 | "uri": "/pinokio/download?uri=https://github.com/cocktailpeanut/automatic1111.pinokio?html=Install complete! Click to close and continue.&action=close",
6 | "target": "_blank",
7 | "features": "self"
8 | }
9 | }]
10 | }
11 |
--------------------------------------------------------------------------------
/callbackwindows/open_with_callback_action.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Download PDF",
6 | "description":"Download and come back, and then click Done"
7 | }
8 | }, {
9 | "method": "browser.open",
10 | "params": {
11 | "uri": "/pinokio?uri=https://github.com/cocktailpeanut/tutorial.pinokio.git/fs/bitcoin.pdf?raw=true",
12 | "target": "_blank"
13 | }
14 | }]
15 | }
16 |
--------------------------------------------------------------------------------
/callbackwindows/open_with_callback_uri.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "browser.open",
4 | "params": {
5 | "uri": "/pinokio?uri=https://github.com/cocktailpeanut/tutorial.pinokio.git/fs/download_file.json&href=https://google.com&target=_blank&html=successfully downloaded! click to open google",
6 | "target": "_blank"
7 | }
8 | }, {
9 | "method": "browser.open",
10 | "params": {
11 | "uri": "/pinokio?uri=https://github.com/cocktailpeanut/tutorial.pinokio/fs/bitcoin.pdf?raw=true",
12 | "target": "_blank"
13 | }
14 | }]
15 | }
16 |
--------------------------------------------------------------------------------
/datastructure/concat_local.json:
--------------------------------------------------------------------------------
1 | {
2 | "items": [1,2,3],
3 | "run": [
4 | {
5 | "method": "set",
6 | "params": {
7 | "local": {
8 | "items": []
9 | }
10 | }
11 | },
12 | {
13 | "method": "set",
14 | "params": {
15 | "local": {
16 | "items": "{{local.items.concat(self.items)}}"
17 | }
18 | }
19 | },
20 | {
21 | "method": "log",
22 | "params": {
23 | "json": "{{local.items}}"
24 | }
25 | },
26 | {
27 | "method": "goto",
28 | "params": {
29 | "index": "{{local.items.length > 12 ? null : 1}}"
30 | }
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/datastructure/push_local.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [
3 | {
4 | "method": "set",
5 | "params": {
6 | "local": {
7 | "items": []
8 | }
9 | }
10 | },
11 | {
12 | "method": "set",
13 | "params": {
14 | "local": {
15 | "items": "{{local.items.concat(local.items.length)}}"
16 | }
17 | }
18 | },
19 | {
20 | "method": "log",
21 | "params": {
22 | "json": "{{local.items}}"
23 | }
24 | },
25 | {
26 | "method": "goto",
27 | "params": {
28 | "index": "{{local.items.length > 10 ? null : 1}}"
29 | }
30 | }
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/datastructure/push_self.json:
--------------------------------------------------------------------------------
1 | {
2 | "items": [],
3 | "run": [
4 | {
5 | "method": "set",
6 | "params": {
7 | "self": {
8 | "push_self.json": {
9 | "items": "{{self.items.concat(self.items.length)}}"
10 | }
11 | }
12 | }
13 | },
14 | {
15 | "method": "log",
16 | "params": {
17 | "json": "{{self.items}}"
18 | }
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/datastructure/rm_local.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [
3 | {
4 | "method": "net",
5 | "params": {
6 | "url": "https://jsonplaceholder.typicode.com/posts/1"
7 | },
8 | "returns": "local.post"
9 | },
10 | {
11 | "method": "log",
12 | "params": {
13 | "json2": "{{local.post}}"
14 | }
15 | },
16 | {
17 | "method": "rm",
18 | "params": {
19 | "local": ["post.userId"]
20 | }
21 | },
22 | {
23 | "method": "log",
24 | "params": {
25 | "json2": "{{local.post}}"
26 | }
27 | },
28 | {
29 | "method": "rm",
30 | "params": {
31 | "local": ["post.body"]
32 | }
33 | },
34 | {
35 | "method": "log",
36 | "params": {
37 | "json2": "{{local.post}}"
38 | }
39 | }
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/datastructure/rm_self.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [
3 | {
4 | "method": "net",
5 | "params": {
6 | "url": "https://jsonplaceholder.typicode.com/posts/1"
7 | },
8 | "returns": "local.post"
9 | },
10 | {
11 | "method": "log",
12 | "params": {
13 | "json2": "{{local.post}}"
14 | }
15 | },
16 | {
17 | "method": "set",
18 | "params": {
19 | "self": {
20 | "rm_self.json": {
21 | "post": "{{local.post}}"
22 | }
23 | }
24 | }
25 | },
26 | {
27 | "method": "log",
28 | "params": {
29 | "json2": "{{self.post}}"
30 | }
31 | },
32 | {
33 | "method": "rm",
34 | "params": {
35 | "self": {
36 | "rm_self.json": [
37 | "post.title",
38 | "post.body"
39 | ]
40 | }
41 | }
42 | },
43 | {
44 | "method": "log",
45 | "params": {
46 | "json2": "{{self.post}}"
47 | }
48 | }
49 | ]
50 | }
51 |
--------------------------------------------------------------------------------
/datastructure/set_global.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [
3 | {
4 | "method": "set",
5 | "params": {
6 | "local": {
7 | "counter": "{{local.counter ? local.counter+1 : 1}}"
8 | },
9 | "global": {
10 | "counter": "{{global.counter ? global.counter+1 : 1}}"
11 | }
12 | }
13 | },
14 | {
15 | "method": "log",
16 | "params": {
17 | "raw": "global: {{global.counter}} local: {{local.counter}}"
18 | }
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/datastructure/set_local.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [
3 | {
4 | "method": "net",
5 | "params": {
6 | "url": "https://random-word-api.herokuapp.com/word"
7 | }
8 | },
9 | {
10 | "method": "set",
11 | "params": {
12 | "local": {
13 | "word{{Date.now()}}": "{{input}}"
14 | }
15 | }
16 | },
17 | {
18 | "method": "log",
19 | "params": {
20 | "json2": "{{local}}"
21 | }
22 | },
23 | {
24 | "method": "goto",
25 | "params": {
26 | "index": "{{Object.keys(local).length > 3 ? null : 0}}"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/datastructure/set_self.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "set",
4 | "params": {
5 | "self": {
6 | "counter.json": {
7 | "count": "{{self.counter && self.counter.count ? self.counter.count+1 : 1}}"
8 | }
9 | }
10 | }
11 | }, {
12 | "method": "log",
13 | "params": {
14 | "json": "{{self.counter}}"
15 | }
16 | }]
17 | }
18 |
--------------------------------------------------------------------------------
/flow/goto.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "set",
4 | "params": {
5 | "local": {
6 | "counter": 0
7 | }
8 | }
9 | }, {
10 | "method": "log",
11 | "params": {
12 | "raw": "{{local.counter}}"
13 | }
14 | }, {
15 | "method": "set",
16 | "params": {
17 | "local": {
18 | "counter": "{{local.counter+1}}"
19 | }
20 | }
21 | }, {
22 | "method": "goto",
23 | "params": {
24 | "index": "{{ local.counter > 15 ? null : 1 }}"
25 | }
26 | }]
27 | }
28 |
--------------------------------------------------------------------------------
/flow/goto_with_input.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "goto",
4 | "params": {
5 | "index": 1,
6 | "input": "3"
7 | }
8 | }, {
9 | "method": "log",
10 | "params": {
11 | "raw": "{{input}}"
12 | }
13 | }]
14 | }
15 |
--------------------------------------------------------------------------------
/flow/sleep.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "set",
4 | "params": {
5 | "local": {
6 | "counter": 0
7 | }
8 | }
9 | }, {
10 | "method": "set",
11 | "params": {
12 | "local": {
13 | "counter": "{{local.counter+1}}"
14 | }
15 | }
16 | }, {
17 | "method": "process.wait",
18 | "params": {
19 | "sec": 1
20 | }
21 | }, {
22 | "method": "log",
23 | "params": {
24 | "raw": "{{local.counter}}"
25 | }
26 | }, {
27 | "method": "goto",
28 | "params": {
29 | "index": "{{ local.counter > 7 ? null : 1 }}"
30 | }
31 | }]
32 | }
33 |
--------------------------------------------------------------------------------
/flow/switch.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "set",
4 | "params": {
5 | "local": {
6 | "counter": 0
7 | }
8 | }
9 | }, {
10 | "method": "set",
11 | "params": {
12 | "local": {
13 | "counter": "{{local.counter+1}}"
14 | }
15 | }
16 | }, {
17 | "method": "goto",
18 | "params": {
19 | "index": "{{ local.counter%2 === 0 ? 3 : 4 }}"
20 | }
21 | }, {
22 | "method": "log",
23 | "params": {
24 | "raw": "{{local.counter}} is even"
25 | }
26 | }, {
27 | "method": "log",
28 | "params": {
29 | "raw": "{{local.counter}} is odd"
30 | }
31 | }, {
32 | "method": "goto",
33 | "params": {
34 | "index": "{{ local.counter > 7 ? null : 1 }}"
35 | }
36 | }]
37 | }
38 |
--------------------------------------------------------------------------------
/fs/.gitignore:
--------------------------------------------------------------------------------
1 | img.png
2 | index.html
3 | users.json
4 | bitcoin.pdf
5 |
--------------------------------------------------------------------------------
/fs/download_file.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "fs.download",
4 | "params": {
5 | "url": "https://bitcoin.org/bitcoin.pdf",
6 | "path": "bitcoin.pdf"
7 | }
8 | }]
9 | }
10 |
--------------------------------------------------------------------------------
/fs/read_base64.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "fs.download",
4 | "params": {
5 | "url": "https://via.placeholder.com/600/771796",
6 | "path": "img.png"
7 | }
8 | }, {
9 | "method": "fs.read",
10 | "params": {
11 | "path": "img.png",
12 | "encoding": "base64"
13 | }
14 | }, {
15 | "method": "log",
16 | "params": {
17 | "raw": "data:image/png;base64,{{input}}"
18 | }
19 | }]
20 | }
21 |
--------------------------------------------------------------------------------
/fs/read_text.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "fs.download",
4 | "params": {
5 | "url": "https://ipfs.io/ipfs/Qme2sLfe9ZMdiuWsEtajWMDzx6B7VbjzpSC2VWhtB6GoB1/wiki/Anasayfa.html",
6 | "path": "index.html"
7 | }
8 | }, {
9 | "method": "fs.read",
10 | "params": {
11 | "path": "index.html",
12 | "encoding": "utf8"
13 | }
14 | }, {
15 | "method": "log",
16 | "params": {
17 | "raw": "{{input}}"
18 | }
19 | }]
20 | }
21 |
--------------------------------------------------------------------------------
/fs/write_buffer.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "get",
6 | "url": "https://via.placeholder.com/600/771796",
7 | "responseType": "arraybuffer"
8 | },
9 | "returns": "local.buf"
10 | }, {
11 | "method": "log",
12 | "params": {
13 | "raw": "{{local.buf.toString('base64')}}"
14 | }
15 | }, {
16 | "method": "fs.write",
17 | "params": {
18 | "path": "img.png",
19 | "buffer": "{{local.buf}}"
20 | }
21 | }]
22 | }
23 |
--------------------------------------------------------------------------------
/fs/write_json.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "get",
6 | "url": "https://jsonplaceholder.typicode.com/users"
7 | },
8 | "returns": "local.users"
9 | }, {
10 | "method": "log",
11 | "params": {
12 | "json2": "{{local.users}}"
13 | }
14 | }, {
15 | "method": "fs.write",
16 | "params": {
17 | "path": "users.json",
18 | "json": "{{local.users}}"
19 | }
20 | }]
21 | }
22 |
--------------------------------------------------------------------------------
/fs/write_text.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "get",
6 | "url": "https://ipfs.io/ipfs/Qme2sLfe9ZMdiuWsEtajWMDzx6B7VbjzpSC2VWhtB6GoB1/wiki/Anasayfa.html",
7 | "responseType": "document"
8 | },
9 | "returns": "local.html"
10 | }, {
11 | "method": "log",
12 | "params": {
13 | "raw": "{{local.html}}"
14 | }
15 | }, {
16 | "method": "fs.write",
17 | "params": {
18 | "path": "index.html",
19 | "text": "{{local.html}}"
20 | }
21 | }]
22 | }
23 |
--------------------------------------------------------------------------------
/graphics/index.js:
--------------------------------------------------------------------------------
1 | const os = require('os')
2 | module.exports = async (kernel) => {
3 | const platform = os.platform()
4 | const graphics = await kernel.system.graphics()
5 | const vendor = graphics.controllers[0].vendor
6 | return {
7 | run: [{
8 | "method": "log",
9 | "params": {
10 | "json2": graphics.controllers
11 | }
12 | }, {
13 | "method": "notify",
14 | "params": {
15 | "html": platform
16 | }
17 | }]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cocktailpeanut/tutorial.pinokio/f37449a017ade5c787e58ae5dd49cf5847ba15a5/icon.png
--------------------------------------------------------------------------------
/input/allfields.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Setup",
6 | "type": "notify",
7 | "form": [{
8 | "key": "username",
9 | "description": "The login username",
10 | "placeholder": "enter username",
11 | "title": "username"
12 | }, {
13 | "key": "password",
14 | "description": "The login password",
15 | "placeholder": "enter login password",
16 | "type": "password",
17 | "title": "password"
18 | }]
19 | }
20 | }, {
21 | "method": "set",
22 | "params": {
23 | "self": {
24 | "config.json": "{{input}}"
25 | }
26 | }
27 | }]
28 | }
29 |
--------------------------------------------------------------------------------
/input/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "username": "",
3 | "password": ""
4 | }
--------------------------------------------------------------------------------
/input/formless.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Formless Input",
6 | "type": "notify",
7 | "description": "Install and come back.
Install"
8 | }
9 | }, {
10 | "method": "notify",
11 | "params": {
12 | "html": "OK"
13 | }
14 | }]
15 | }
16 |
--------------------------------------------------------------------------------
/input/inbetween.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": "mkdir test"
6 | }
7 | }, {
8 | "method": "shell.start",
9 | "params": {
10 | "path": "test"
11 | }
12 | }, {
13 | "method": "shell.enter",
14 | "params": {
15 | "message": "npm init",
16 | "on": [{
17 | "event": "/^(.+):/gm",
18 | "return": "{{event.matches[0][1]}}"
19 | }]
20 | }
21 | }, {
22 | "method": "set",
23 | "params": {
24 | "local": {
25 | "key": "id_{{Buffer.from(input).toString('hex')}}",
26 | "title": "{{input}}"
27 | }
28 | }
29 | }, {
30 | "method": "input",
31 | "params": {
32 | "title": "{{local.title}}",
33 | "form": [{
34 | "key": "{{local.key}}"
35 | }]
36 | }
37 | }, {
38 | "method": "shell.enter",
39 | "params": {
40 | "message": "{{input[local.key]}}",
41 | "path": "test",
42 | "on": [{
43 | "event": "/^(.+):/gm",
44 | "return": {
45 | "index": 3,
46 | "input": "{{event.matches[0][1]}}"
47 | }
48 | }, {
49 | "event": null,
50 | "return": {
51 | "index": null
52 | }
53 | }]
54 | }
55 | }, {
56 | "method": "goto",
57 | "params": "{{input}}"
58 | }]
59 | }
60 |
--------------------------------------------------------------------------------
/input/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Setup",
6 | "form": [{
7 | "key": "username",
8 | "title": "username"
9 | }, {
10 | "key": "password",
11 | "title": "password"
12 | }]
13 | }
14 | }, {
15 | "method": "set",
16 | "params": {
17 | "self": {
18 | "config.json": "{{input}}"
19 | }
20 | }
21 | }]
22 | }
23 |
--------------------------------------------------------------------------------
/input/key.json:
--------------------------------------------------------------------------------
1 | {
2 | "key": {
3 | "key": "asfadfasddfa"
4 | }
5 | }
--------------------------------------------------------------------------------
/input/login.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Login",
6 | "form": [{
7 | "key": "username",
8 | "title": "username"
9 | }, {
10 | "key": "password",
11 | "title": "password"
12 | }]
13 | }
14 | }, {
15 | "method": "set",
16 | "params": {
17 | "local": "{{input}}"
18 | }
19 | }]
20 | }
21 |
--------------------------------------------------------------------------------
/input/notifyinput.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Setup",
6 | "type": "notify",
7 | "form": [{
8 | "key": "username",
9 | "title": "username"
10 | }, {
11 | "key": "password",
12 | "title": "password"
13 | }]
14 | }
15 | }, {
16 | "method": "set",
17 | "params": {
18 | "self": {
19 | "config.json": "{{input}}"
20 | }
21 | }
22 | }]
23 | }
24 |
--------------------------------------------------------------------------------
/input/test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "abc",
3 | "version": "1.0.0",
4 | "description": "sfasdfsadf",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "cocktailpeanut",
10 | "license": "MIT"
11 | }
12 |
--------------------------------------------------------------------------------
/load/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "load",
4 | "params": {
5 | "automatic1111": "https://github.com/malfunctionize/auto.git/start.json",
6 | "llama": "https://github.com/malfunctionize/llama.git/example/stable-vicuna-13b-q4_0.json"
7 | }
8 | }]
9 | }
10 |
--------------------------------------------------------------------------------
/load/load_and_set.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "load",
4 | "params": {
5 | "automatic1111": "https://github.com/malfunctionize/auto.git/start.json",
6 | "llama": "https://github.com/malfunctionize/llama.git/example/stable-vicuna-13b-q4_0.json"
7 | }
8 | }, {
9 | "method": "set",
10 | "params": {
11 | "self": {
12 | "prompt.json": {
13 | "prompt": "{{input.llama.run[0].params.text}}"
14 | }
15 | }
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/load/local_load.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "load",
4 | "params": {
5 | "prompt": "./prompt.json",
6 | "self": "./local_load.json"
7 | }
8 | }]
9 | }
10 |
--------------------------------------------------------------------------------
/load/prompt.json:
--------------------------------------------------------------------------------
1 | {
2 | "prompt": [
3 | "### Instruction",
4 | "",
5 | "Give me three movie characters and why you like them. Be brief.",
6 | "",
7 | "### Response",
8 | "",
9 | ""
10 | ]
11 | }
--------------------------------------------------------------------------------
/memory/current.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "log",
4 | "params": {
5 | "raw": "running instruction {{current}}"
6 | }
7 | }, {
8 | "method": "log",
9 | "params": {
10 | "raw": "running instruction {{current}}"
11 | }
12 | }, {
13 | "method": "log",
14 | "params": {
15 | "raw": "running instruction {{current}}"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/memory/next.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "log",
4 | "params": {
5 | "raw": "running instruction {{current}}. next instruction is {{next}}"
6 | }
7 | }, {
8 | "method": "log",
9 | "params": {
10 | "raw": "running instruction {{current}}. next instruction is {{next}}"
11 | }
12 | }, {
13 | "method": "log",
14 | "params": {
15 | "raw": "running instruction {{current}}. next instruction is {{next}}"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/memory/undefined.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "set",
4 | "params": {
5 | "local": {
6 | "a": 1,
7 | "b": 2,
8 | "{{os.platform() === 'darwin' && os.arch() === 'arm64' ? 'os' : null }}": "mac m1/m2",
9 | "{{os.platform() === 'darwin' && os.arch() !== 'arm64' ? 'os' : null }}": "mac intel"
10 | }
11 | }
12 | }, {
13 | "method": "log",
14 | "params": {
15 | "json": "{{local}}"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/net/get_json.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "get",
6 | "url": "https://jsonplaceholder.typicode.com/users"
7 | }
8 | }, {
9 | "method": "log",
10 | "params": {
11 | "json2": "{{input}}"
12 | }
13 | }]
14 | }
15 |
--------------------------------------------------------------------------------
/net/get_text.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "get",
6 | "url": "https://ipfs.io/ipfs/Qme2sLfe9ZMdiuWsEtajWMDzx6B7VbjzpSC2VWhtB6GoB1/wiki/Anasayfa.html",
7 | "responseType": "text"
8 | }
9 | }, {
10 | "method": "log",
11 | "params": {
12 | "raw": "{{input}}"
13 | }
14 | }]
15 | }
16 |
--------------------------------------------------------------------------------
/net/post_json.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "net",
4 | "params": {
5 | "method": "post",
6 | "url": "https://postman-echo.com/post",
7 | "data": {
8 | "hello": "world"
9 | }
10 | }
11 | }, {
12 | "method": "log",
13 | "params": {
14 | "json2": "{{input}}"
15 | }
16 | }]
17 | }
18 |
--------------------------------------------------------------------------------
/notify/image_notification.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "notify",
4 | "params": {
5 | "html": "",
6 | "href": "https://pinokio.computer",
7 | "target": "_blank"
8 | }
9 | }]
10 | }
11 |
--------------------------------------------------------------------------------
/notify/open_in_browser.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "notify",
4 | "params": {
5 | "html": "clck to open Reddit",
6 | "href": "https://reddit.com",
7 | "target": "_blank"
8 | }
9 | }]
10 | }
11 |
--------------------------------------------------------------------------------
/notify/open_in_pinokio.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "notify",
4 | "params": {
5 | "html": "[Try] clck to open Pinokio in a new window",
6 | "href": "/",
7 | "target": "_blank",
8 | "features": "app"
9 | }
10 | }, {
11 | "method": "notify",
12 | "params": {
13 | "html": "[Try] clck to visit another example",
14 | "href": "image_notification.json"
15 | }
16 | }]
17 | }
18 |
--------------------------------------------------------------------------------
/pinokio.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | title: "Pinokio Tutorial",
3 | description: "Simple script examples that highlight all the Pinokio APIs",
4 | icon: "icon.png"
5 | }
6 |
--------------------------------------------------------------------------------
/python.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": [
6 | "{{platform === 'win32' ? 'where' : 'which'}} python",
7 | "{{platform === 'win32' ? 'where' : 'which'}} python3"
8 | ]
9 | }
10 | }]
11 | }
12 |
--------------------------------------------------------------------------------
/requires/brew.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": [{
3 | "name": "brew"
4 | }, {
5 | "platform": "darwin",
6 | "type": "brew",
7 | "name": "wget"
8 | }],
9 | "run": [{
10 | "method": "shell.run",
11 | "params": {
12 | "message": "which wget"
13 | }
14 | }]
15 | }
16 |
--------------------------------------------------------------------------------
/requires/conda.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": [{
3 | "type": "conda",
4 | "name": "ffmpeg",
5 | "args": "-c conda-forge"
6 | }],
7 | "run": [{
8 | "method": "shell.run",
9 | "params": {
10 | "message": "which ffmpeg"
11 | }
12 | }]
13 | }
14 |
--------------------------------------------------------------------------------
/requires/npm.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": [{
3 | "name": "nodejs",
4 | "type": "conda",
5 | "args": "-c conda-forge"
6 | }],
7 | "run": [{
8 | "method": "shell.run",
9 | "params": {
10 | "message": "which npm"
11 | }
12 | }, {
13 | "method": "shell.run",
14 | "params": {
15 | "message": "npx --yes vtop"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/requires/pip.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": [{
3 | "type": "pip",
4 | "name": "jsonschema"
5 | }],
6 | "run": [{
7 | "method": "shell.run",
8 | "params": {
9 | "message": "pip list"
10 | }
11 | }]
12 | }
13 |
--------------------------------------------------------------------------------
/requires/platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": [{
3 | "platform": "darwin",
4 | "type": "brew",
5 | "name": "rust"
6 | }, {
7 | "platform": "win32",
8 | "type": "conda",
9 | "name": "rust",
10 | "args": "-c conda-forge"
11 | }],
12 | "run": [{
13 | "method": "shell.run",
14 | "params": {
15 | "message": "{{os.platform() === 'win32' ? 'where' : 'which'}} rustc"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/shell/array_env.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "description": "Prepend the current context (cwd) to the PATH",
4 | "method": "shell.run",
5 | "params": {
6 | "message": "{{platform === 'win32' ? 'echo %custom_vars%' : 'echo $custom_vars'}}",
7 | "env": {
8 | "custom_vars": ["abc", "def", "ghi"]
9 | }
10 | }
11 | }]
12 | }
13 |
--------------------------------------------------------------------------------
/shell/array_prepend_PATH.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "description": "Prepend the current context (cwd) to the PATH",
4 | "method": "shell.run",
5 | "params": {
6 | "message": "{{platform === 'win32' ? 'echo %PATH%' : 'echo $PATH'}}",
7 | "env": {
8 | "PATH": ["{{cwd}}"]
9 | }
10 | }
11 | }, {
12 | "description": "Should print an error because the PATH should be an array",
13 | "method": "shell.run",
14 | "params": {
15 | "message": "{{platform === 'win32' ? 'echo %PATH%' : 'echo $PATH'}}",
16 | "env": {
17 | "PATH": "{{cwd}}"
18 | }
19 | }
20 | }]
21 | }
22 |
--------------------------------------------------------------------------------
/shell/capturing_url_in_terminal.json:
--------------------------------------------------------------------------------
1 | {
2 | "daemon": true,
3 | "requires": [{ "type": "conda", "name": "nodejs", "args": "-c conda-forge" }],
4 | "run": [{
5 | "method": "shell.run",
6 | "params": {
7 | "message": "npx http-server",
8 | "on": [{ "event": "/http:\\S+\\s+/i", "done": true }]
9 | }
10 | }, {
11 | "method": "browser.open",
12 | "params": {
13 | "uri": "{{input.stdout.match(/http:\\S+/gi)[0]}}",
14 | "target": "_blank"
15 | }
16 | }]
17 | }
18 |
--------------------------------------------------------------------------------
/shell/conda.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": " ",
6 | "conda": "test_conda_env"
7 | }
8 | }, {
9 | "method": "shell.run",
10 | "params": {
11 | "message": "{{platform === 'win32' ? 'dir' : 'ls'}} test_conda_env/lib/python3.10/site-packages",
12 | "conda": "test_conda_env"
13 | }
14 | }, {
15 | "method": "shell.run",
16 | "params": {
17 | "message": "pip install torch",
18 | "conda": "test_conda_env"
19 | }
20 | }, {
21 | "method": "shell.run",
22 | "params": {
23 | "message": "{{platform === 'win32' ? 'dir' : 'ls'}} test_conda_env/lib/python3.10/site-packages",
24 | "conda": "test_conda_env"
25 | }
26 | }, {
27 | "method": "shell.run",
28 | "params": {
29 | "message": "conda install numpy -y",
30 | "conda": "test_conda_env"
31 | }
32 | }, {
33 | "method": "shell.run",
34 | "params": {
35 | "message": "{{platform === 'win32' ? 'dir' : 'ls'}} test_conda_env/lib/python3.10/site-packages",
36 | "conda": "test_conda_env"
37 | }
38 | }]
39 | }
40 |
--------------------------------------------------------------------------------
/shell/done_shell_event.json:
--------------------------------------------------------------------------------
1 | {
2 | "daemon": true,
3 | "requires": [{
4 | "type": "conda",
5 | "name": "nodejs",
6 | "args": "-c conda-forge"
7 | }],
8 | "run": [{
9 | "method": "shell.run",
10 | "params": {
11 | "message": "npx http-server",
12 | "on": [{
13 | "event": "/Hit CTRL-C to stop the server/i",
14 | "done": true
15 | }]
16 | }
17 | }, {
18 | "method": "log",
19 | "params": {
20 | "json2": {
21 | "input": "{{input}}",
22 | "match": "{{[...input.response.matchAll(/(http:\\S+)/gi)].map(x => x[1])}}"
23 | }
24 | }
25 | }]
26 | }
27 |
--------------------------------------------------------------------------------
/shell/env.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "description": "prints the default HF_HOME env",
4 | "method": "shell.run",
5 | "params": {
6 | "message": "{{platform === 'win32' ? 'set' : 'env'}}"
7 | }
8 | }, {
9 | "description": "prints the injected HF_HOME env",
10 | "method": "shell.run",
11 | "params": {
12 | "env": {
13 | "HF_HOME": "{{cwd}}"
14 | },
15 | "message": "{{platform === 'win32' ? 'set' : 'env'}}"
16 | }
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/shell/event.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.start",
4 | "params": {
5 | "id": "{{cwd}}"
6 | }
7 | }, {
8 | "method": "shell.enter",
9 | "params": {
10 | "id": "{{cwd}}",
11 | "message": "curl https://jsonplaceholder.typicode.com/users",
12 | "on": [{
13 | "event": "/.*(\\[.*\\]).*/gs",
14 | "return": "{{event.matches[0][1]}}"
15 | }]
16 | }
17 | }, {
18 | "method": "fs.write",
19 | "params": {
20 | "path": "users.json",
21 | "text": "{{input}}"
22 | }
23 | }]
24 | }
25 |
--------------------------------------------------------------------------------
/shell/kill_shell_event.json:
--------------------------------------------------------------------------------
1 | {
2 | "daemon": true,
3 | "requires": [{
4 | "type": "conda",
5 | "name": "nodejs",
6 | "args": "-c conda-forge"
7 | }],
8 | "run": [{
9 | "method": "shell.run",
10 | "params": {
11 | "message": "npx http-server",
12 | "on": [{
13 | "event": "/Hit CTRL-C to stop the server/i",
14 | "kill": true
15 | }]
16 | }
17 | }, {
18 | "method": "log",
19 | "params": {
20 | "json2": {
21 | "input": "{{input}}",
22 | "match": "{{[...input.response.matchAll(/(http:\\S+)/gi)].map(x => x[1])}}"
23 | }
24 | }
25 | }]
26 | }
27 |
--------------------------------------------------------------------------------
/shell/locate.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "input",
4 | "params": {
5 | "title": "Setup",
6 | "form": [{
7 | "key": "command",
8 | "title": "command"
9 | }]
10 | }
11 | }, {
12 | "method": "shell.run",
13 | "params": {
14 | "message": "{{platform === 'win32' ? `where ${input.command}` : `which ${input.command}`}}"
15 | }
16 | }]
17 | }
18 |
--------------------------------------------------------------------------------
/shell/multi.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": [
6 | "ls",
7 | "ls -las",
8 | "ls *.json"
9 | ]
10 | }
11 | }]
12 | }
13 |
--------------------------------------------------------------------------------
/shell/node.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.start"
4 | }, {
5 | "method": "shell.write",
6 | "params": {
7 | "message": "node\n",
8 | "on": [{
9 | "event": "/.*(> ).*/gs",
10 | "return": null
11 | }]
12 | }
13 | }, {
14 | "method": "shell.write",
15 | "params": {
16 | "message": "os.platform()\n",
17 | "on": [{
18 | "event": "/'(.+)'.*(> )/gs",
19 | "return": {
20 | "raw": "{{event.matches[0][1]}}"
21 | }
22 | }]
23 | }
24 | }, {
25 | "method": "shell.enter",
26 | "params": {
27 | "message": ".exit",
28 | "on": [{
29 | "event": null,
30 | "return": null
31 | }]
32 | }
33 | }]
34 | }
35 |
--------------------------------------------------------------------------------
/shell/npminitializer/initialize.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.start"
4 | }, {
5 | "method": "shell.enter",
6 | "params": {
7 | "message": "npm init",
8 | "on": [{
9 | "event": "/.*: /",
10 | "return": true
11 | }]
12 | }
13 | }, {
14 | "method": "process.wait",
15 | "params": {
16 | "sec": 1
17 | }
18 | }, {
19 | "method": "shell.enter",
20 | "params": {
21 | "message": "",
22 | "on": [{
23 | "event": "/.+: /",
24 | "return": 2
25 | }, {
26 | "event": null,
27 | "return": null
28 | }, {
29 | "event": "/Is this OK/",
30 | "return": 2
31 | }]
32 | },
33 | "notify": true
34 | }, {
35 | "method": "goto",
36 | "params": {
37 | "index": "{{input}}"
38 | },
39 | "notify": true
40 | }]
41 | }
42 |
--------------------------------------------------------------------------------
/shell/npx.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.start"
4 | }, {
5 | "method": "shell.write",
6 | "params": {
7 | "message": "npx http-server\n",
8 | "on": [{
9 | "event": "/.+/",
10 | "return": true
11 | }]
12 | },
13 | "notify": true
14 | }, {
15 | "method": "shell.write",
16 | "params": {
17 | "message": "\n",
18 | "on": [{
19 | "event": "/.+/",
20 | "return": true
21 | }]
22 | },
23 | "notify": true
24 | }, {
25 | "method": "browser.open",
26 | "params": {
27 | "uri": "http://127.0.0.1:8080",
28 | "target": "_blank"
29 | },
30 | "notify": true
31 | }, {
32 | "method": "process.wait",
33 | "notify": true
34 | }]
35 | }
36 |
--------------------------------------------------------------------------------
/shell/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shelltest",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC"
11 | }
12 |
--------------------------------------------------------------------------------
/shell/parse_shell.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": "ls -las"
6 | }
7 | }, {
8 | "method": "log",
9 | "params": {
10 | "json2": {
11 | "files": "{{_.flatten([...input.response.matchAll(/\\S+\\.json/gi)])}}",
12 | "folders": "{{[...input.response.matchAll(/drwx.+\\s+(\\S+)[\\r\\n]+/gi)].map(x => x[1])}}"
13 | }
14 | }
15 | }]
16 | }
17 |
--------------------------------------------------------------------------------
/shell/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "run": [{
3 | "method": "shell.run",
4 | "params": {
5 | "message": "mkdir helloserver"
6 | },
7 | "notify": true
8 | }, {
9 | "method": "shell.run",
10 | "params": {
11 | "message": "npm init -y",
12 | "path": "helloserver"
13 | },
14 | "notify": true
15 | }, {
16 | "method": "shell.run",
17 | "params": {
18 | "message": "npm install express",
19 | "path": "helloserver"
20 | },
21 | "notify": true
22 | }, {
23 | "method": "fs.write",
24 | "params": {
25 | "path": "helloserver/index.js",
26 | "text": [
27 | "const express = require('express');",
28 | "const app = express();",
29 | "app.get('/', function (req, res) {",
30 | " res.send('