@@ -4,42 +4,48 @@ sort: 2
4title: Shell
4title: Shell
7# `:dojo` (Shell)
10# `:dojo` (Shell)
9−The dojo is a typed functional shell.
12+The `:dojo` is the place to quickly experiment with Urbit. At first glance the `:dojo` is just a Hoon REPL. Looking a bit deeper the `:dojo` is set up to make operating on and transforming data in Urbit easy.
11## Quickstart
17## Quickstart
13Evaluate a hoon expression:
19Evaluate a hoon expression:
15− ~fintud-macrep:dojo> (add 2 2)
21+ ~your-urbit:dojo> (add 2 2)
16− ~fintud-macrep:dojo> %+ add 2 2
22+ ~your-urbit:dojo> %+ add 2 2
18Tall form Hoon will be prompted for:
24Tall form Hoon will be prompted for:
20− ~fintud-macrep:dojo> %+ add
26+ ~your-urbit:dojo> %+ add
21− ~fintud-macrep:dojo< 2
27+ ~your-urbit:dojo< 2
22− ~fintud-macrep:dojo< 2
28+ ~your-urbit:dojo< 2
24Use `=var` to save a shell variable:
30Use `=var` to save a shell variable:
26− ~fintud-macrep:dojo> =foo (add 2 2)
32+ ~your-urbit:dojo> =foo (add 2 2)
28Use `=dir` to set the current working directory:
34Use `=dir` to set the current working directory:
30− ~fintud-macrep:dojo> =dir %/web
36+ ~your-urbit:dojo> =dir %/web
32Generators (files in `/gen`) are run with `+`:
38Generators (files in `/gen`) are run with `+`:
34− ~fintud-macrep:dojo> +hello 'world'
40+ ~your-urbit:dojo> +hello 'world'
36Save output to a file in `%clay` with `*`:
42Save output to a file in `%clay` with `*`:
38− ~fintud-macrep:dojo> *foo/bar/hoon 'hello world'
44+ ~your-urbit:dojo> *foo/bar/hoon 'hello world'
40Run system commands from `:hood`, like `reload`, using `|`:
46Run system commands from `:hood`, like `reload`, using `|`:
42− ~fintud-macrep:dojo> |reload %eyre
48+ ~your-urbit:dojo> |reload %eyre
@@ -55,8 +61,8 @@ Sources can be chained together, but we can only produce one effect per command.
56Set any envronment variable:
62Set any envronment variable:
58− ~fintud-macrep:dojo> =foo 42
64+ ~your-urbit:dojo> =foo 42
59− ~fintud-macrep:dojo> (add 2 foo)
65+ ~your-urbit:dojo> (add 2 foo)
@@ -68,7 +74,7 @@ Set any envronment variable:
69Send a `helm-hi` message to `hood`:
75Send a `helm-hi` message to `hood`:
71− ~fintud-macrep:dojo> :hood &helm-hi 'hi'
77+ ~your-urbit:dojo> :hood &helm-hi 'hi'
73App usually expect marked data, so `&` is often used here.
79App usually expect marked data, so `&` is often used here.
@@ -76,7 +82,7 @@ App usually expect marked data, so `&` is often used here.
77Save a new `md` file in `web`:
83Save a new `md` file in `web`:
79− ~fintud-macrep:dojo> *%/web/foo/md '# hello'
85+ ~your-urbit:dojo> *%/web/foo/md '# hello'
81The last component of the path is expected to be the mark (or mime type).
87The last component of the path is expected to be the mark (or mime type).
@@ -84,13 +90,13 @@ The last component of the path is expected to be the mark (or mime type).
85Download a noun to Unix with `.`:
91Download a noun to Unix with `.`:
87− ~fintud-macrep:dojo> .foo/bar/baz (add 2 2)
93+ ~your-urbit:dojo> .foo/bar/baz (add 2 2)
89Which creates a file at `pier/.urb/put/foo/bar.baz`.
95Which creates a file at `pier/.urb/put/foo/bar.baz`.
91This is very often used with `+solid`:
97This is very often used with `+solid`:
93− ~fintud-macrep:dojo> .urbit/pill +solid
99+ ~your-urbit:dojo> .urbit/pill +solid
95Which outputs a new `urbit.pill` to `pier/.urb/put/urbit.pill`
101Which outputs a new `urbit.pill` to `pier/.urb/put/urbit.pill`
@@ -100,7 +106,7 @@ Which outputs a new `urbit.pill` to `pier/.urb/put/urbit.pill`
101Convert between marks using `&`:
107Convert between marks using `&`:
103− ~fintud-macrep:dojo> &html &md '# hello'
109+ ~your-urbit:dojo> &html &md '# hello'
104 :: produces
110 :: produces
105 '<html><head></head><body><div><h1 id="-hello">hello</h1></div></body></html>'
111 '<html><head></head><body><div><h1 id="-hello">hello</h1></div></body></html>'
@@ -109,11 +115,11 @@ Convert between marks using `&`:
109Use `_` to run a gate (or function):
115Use `_` to run a gate (or function):
111 :: assign an arbitrary function and pass data to it
117 :: assign an arbitrary function and pass data to it
112− ~fintud-macrep:dojo> _|=({a/@} (mul a 3)) 3
118+ ~your-urbit:dojo> _|=({a/@} (mul a 3)) 3
113 :: produces
119 :: produces
115 :: assign an arbitrary function to get the status code from an http request
121 :: assign an arbitrary function to get the status code from an http request
116− ~fintud-macrep:dojo> _|=({p/@ud q/* r/*} p) +http://google.com
122+ ~your-urbit:dojo> _|=({p/@ud q/* r/*} p) +http://google.com
117 :: produces
123 :: produces
@@ -131,9 +137,9 @@ Generators are simple hoon scripts loaded from the filesystem. They live in `ge
132Create a random moon (from any planet):
138Create a random moon (from any planet):
134− ~fintud-macrep:dojo> +moon
140+ ~your-urbit:dojo> +moon
135 :: produces
141 :: produces
136− "moon: ~docsun-tamtem-fintud-macrep; ticket: ~bartug-hodbyr-fognum-ralmud"
142+ "moon: ~docsun-tamtem-your-urbit; ticket: ~bartug-hodbyr-fognum-ralmud"
138### Variables
144### Variables
@@ -145,8 +151,8 @@ Current working `%clay` desk and revision. Read / write.
146**Examples:**
152**Examples:**
148− ~fintud-macrep:dojo> =dir %/web
154+ ~your-urbit:dojo> =dir %/web
149− ~fintud-macrep:dojo> +ls %
155+ ~your-urbit:dojo> +ls %
151 404/hoon docs/ dojo/hoon lib/ listen/hoon md static/md talk/ tree/main/
157 404/hoon docs/ dojo/hoon lib/ listen/hoon md static/md talk/ tree/main/
@@ -156,11 +162,11 @@ Current set of libraries (`/lib`) in your environment. Can also be set with `/+
157**Examples:**
163**Examples:**
159− ~fintud-macrep:dojo> =lib ~[[%react ~]]
165+ ~your-urbit:dojo> =lib ~[[%react ~]]
160− ~fintud-macrep:dojo> :: this also works:
166+ ~your-urbit:dojo> :: this also works:
161− ~fintud-macrep:dojo> /+ react
167+ ~your-urbit:dojo> /+ react
162− ~fintud-macrep:dojo> :: now we can use arms from lib/react.hoon
168+ ~your-urbit:dojo> :: now we can use arms from lib/react.hoon
163− ~fintud-macrep:dojo> (react-vale:react %div)
169+ ~your-urbit:dojo> (react-vale:react %div)
165#### `sur`
171#### `sur`
@@ -168,11 +174,11 @@ Current set of structures (`/sur`) in your environment. Can also be set with `/
169**Examples:**
175**Examples:**
171− ~fintud-macrep:dojo> =sur ~[[%sole ~]]
177+ ~your-urbit:dojo> =sur ~[[%sole ~]]
172− ~fintud-macrep:dojo> :: this also works:
178+ ~your-urbit:dojo> :: this also works:
173− ~fintud-macrep:dojo> /- sole
179+ ~your-urbit:dojo> /- sole
174− ~fintud-macrep:dojo> :: now we can use arms in sur/sole.hoon
180+ ~your-urbit:dojo> :: now we can use arms in sur/sole.hoon
175− ~fintud-macrep:dojo> `sole-effect:sole`[%bel ~]
181+ ~your-urbit:dojo> `sole-effect:sole`[%bel ~]
177#### `now`
183#### `now`
@@ -180,7 +186,7 @@ The current (128-bit `@da`) time. Read-only.
181**Example:**
187**Example:**
183− ~fintud-macrep:dojo> now
189+ ~your-urbit:dojo> now
184 :: produces
190 :: produces
185 ~2016.3.21..21.10.57..429a
191 ~2016.3.21..21.10.57..429a
@@ -190,9 +196,9 @@ The current urbit plot. Read-only.
191**Example:**
197**Example:**
193− ~fintud-macrep:dojo> our
199+ ~your-urbit:dojo> our
194 :: produces
200 :: produces
195− ~fintud-macrep
201+ ~your-urbit
197#### `eny`
203#### `eny`
@@ -200,7 +206,7 @@ The current urbit plot. Read-only.
201**Example:**
207**Example:**
203− ~fintud-macrep:dojo> eny
209+ ~your-urbit:dojo> eny
204 :: produces
210 :: produces
205 0v1o.m2vio.j5ieb.7tq84.5kcnp.gjn04.9gl2e.tkj5v.0oqk3.iugk8.rhu6o
211 0v1o.m2vio.j5ieb.7tq84.5kcnp.gjn04.9gl2e.tkj5v.0oqk3.iugk8.rhu6o
@@ -208,35 +214,35 @@ The current urbit plot. Read-only.
209**`+cat`** - Similar to Unix `cat`. Accepts a path.
215**`+cat`** - Similar to Unix `cat`. Accepts a path.
211− ~fintud-macrep:dojo> +cat %/web/md
217+ ~your-urbit:dojo> +cat %/web/md
212− ~fintud-macrep:dojo> +cat /~talsur-todres/home/2/web/notes/md
218+ ~your-urbit:dojo> +cat /~talsur-todres/home/2/web/notes/md
214**`+curl`** - Similar to Unix `curl`. Accepts a `tape`.
220**`+curl`** - Similar to Unix `curl`. Accepts a `tape`.
216− ~fintud-macrep:dojo> +curl "http://nyt.com"
222+ ~your-urbit:dojo> +curl "http://nyt.com"
218**`+hello`** - Just prints the argument. Accepts a `@ta`.
224**`+hello`** - Just prints the argument. Accepts a `@ta`.
220− ~fintud-macrep:dojo> +hello 'mars'
226+ ~your-urbit:dojo> +hello 'mars'
222**`+ls`** - Similar to Unix `ls`. Accepts a path.
228**`+ls`** - Similar to Unix `ls`. Accepts a path.
224− ~fintud-macrep:dojo> +ls %/web
230+ ~your-urbit:dojo> +ls %/web
225− ~fintud-macrep:dojo> +ls /~talsur-todres/home/2/web/notes
231+ ~your-urbit:dojo> +ls /~talsur-todres/home/2/web/notes
227**`+moon`** - Generate a random moon from a planet. No arguments.
233**`+moon`** - Generate a random moon from a planet. No arguments.
229**`+solid`** - Compile the current state of the kernel and output a noun. Usually downloaded to a file in unix. No arguments.
235**`+solid`** - Compile the current state of the kernel and output a noun. Usually downloaded to a file in unix. No arguments.
231− ~fintud-macrep:dojo> .urbit/pill +solid
237+ ~your-urbit:dojo> .urbit/pill +solid
233**`+ticket`** - Generate a ticket for an Urbit plot. Takes an Urbit name (`@p`).
239**`+ticket`** - Generate a ticket for an Urbit plot. Takes an Urbit name (`@p`).
235− ~fintud-macrep:dojo> +ticket ~talsur-todres-fintud-macrep
241+ ~your-urbit:dojo> +ticket ~talsur-todres-your-urbit
237**`+tree`** - Generate a recursive directory listing. Takes a path.
243**`+tree`** - Generate a recursive directory listing. Takes a path.
239− ~fintud-macrep:dojo> +tree %/web
245+ ~your-urbit:dojo> +tree %/web
@@ -244,20 +250,20 @@ The hood is the system daemon. See `gen/hood` and `app/hood`.
245**`|hi`** - Sends a direct message. Sort of like `finger`. Accepts an urbit name (`@p`) and a string (`cord`).
251**`|hi`** - Sends a direct message. Sort of like `finger`. Accepts an urbit name (`@p`) and a string (`cord`).
247− ~fintud-macrep:dojo> |hi ~doznec 'you there?'
253+ ~your-urbit:dojo> |hi ~doznec 'you there?'
249**`|link`** / **`|unlink`** - Link / unlink a remote app. Accepts an Urbit name and an app name.
255**`|link`** / **`|unlink`** - Link / unlink a remote app. Accepts an Urbit name and an app name.
251− ~fintud-macrep:dojo> |link ~talsur-todres %octo
257+ ~your-urbit:dojo> |link ~talsur-todres %octo
253**`|mass`** - Prints the current memory usage of all the kernel modules. No arguments.
259**`|mass`** - Prints the current memory usage of all the kernel modules. No arguments.
255**`|reload`** - Reloads a kernel module (vane) from source. Accepts any number of vane names.
261**`|reload`** - Reloads a kernel module (vane) from source. Accepts any number of vane names.
257− ~fintud-macrep:dojo> |reload %clay %eyre
263+ ~your-urbit:dojo> |reload %clay %eyre
259**`|reset`** - Reloads `hoon.hoon`. No arguments.
265**`|reset`** - Reloads `hoon.hoon`. No arguments.
261**`|start`** - Starts an app. Accepts an app name.
267**`|start`** - Starts an app. Accepts an app name.
263− ~fintud-macrep:dojo> |start %curl
269+ ~your-urbit:dojo> |start %curl