shrub/pub/doc/arvo/util.md

349 lines
9.2 KiB
Markdown
Raw Normal View History

2015-02-18 06:03:21 +03:00
<div class="short">
CLI Apps
========
2015-04-29 00:03:11 +03:00
Our simple command-line applications.
2015-02-18 06:03:21 +03:00
You can find them in `/main/app`.
</div>
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`:?begin`](#begin)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> :?begin [~ship-name [~valid-ticket-for-ship]]`
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
Start a ship. `:?begin` collects all of the necessary information to
2015-02-18 06:03:21 +03:00
start an Urbit ship. Takes an option `[~ship-name]` or
`[~ship-name [~valid-ticket-for-ship]]` pair.
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`+cat`](#cat)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> +cat /path/to/file [...]`
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
"cat" a file. `+cat` either prints a file, or concatenates and then
2015-02-18 06:03:21 +03:00
prints multiple files to the terminal.
2015-06-30 03:55:53 +03:00
~zod:dojo> +cat %/spec/nock/5/txt
> +cat %/spec/nock/5/txt
/~zod/home/~2015.6.29..22.33.04..fc76/spec/nock/5/txt
A noun is an atom or a cell.
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|cp`](#cp)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |cp /path/to/source /path/to/destination`
2015-02-18 06:03:21 +03:00
Copy a file to a given location.
2015-06-30 03:55:53 +03:00
~zod:dojo> |cp %/spec/nock/5/txt %/try/6/txt
> |cp %/spec/nock/5/txt %/try/6/txt
+ /~zod/home/2/try/6/txt
>=
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`grep`](#grep)
<mark>GONE</mark>
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
<s>`~zod:dojo> :grep 'literal'`
2015-02-18 06:03:21 +03:00
2015-03-06 22:22:12 +03:00
"grep" a file or standard input. Currently only supports a literal cord,
2015-06-30 03:55:53 +03:00
but will eventuall support regular expressions.</s>
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|hi`](#hi)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |hi ~ship ["message"]`
2015-02-18 06:03:21 +03:00
Send a ship a message which is empty by default, becoming their neighbor
in the process. Often used to ping ships to check connectivity.
2015-06-30 03:55:53 +03:00
~zod:dojo> |hi ~doznec
> |hi ~doznec
ames: czar zod.urbit.org: ip .192.241.195.84
>=
hi ~doznec succesful
; ~doznec is your neighbor
; ~doznec is your neighbor
and on ~doznec
~doznec:dojo>
< ~zod:
; ~zod is your neighbor
send a message
~zod:dojo> |hi ~doznec "say something"
>=
hi ~doznec succesful
and on ~doznec
< ~zod: say something
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
### [`:into`](#into)
2015-06-30 03:55:53 +03:00
<mark>GONE</mark>
<s>
`~zod:dojo> :into /path/to/file 'contents'`
2015-02-18 06:03:21 +03:00
Write text to a file. If the specified file does not exist, create a
2015-03-06 22:22:12 +03:00
file by that name. If it does exist, replace its contents.
2015-06-30 03:55:53 +03:00
</s>
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|label`](#label)
<mark>GONE? returns file not found</mark>
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
<s>
`~zod:dojo> |label %path %label`
2015-02-18 06:03:21 +03:00
"label". Add a label to a change number.
2015-06-30 03:55:53 +03:00
~zod:dojo> |label %try %zebra
2015-02-18 06:03:21 +03:00
= new /~zod/try/3
2015-06-30 03:55:53 +03:00
~zod:dojo> :ls /=try/zebra
2015-02-18 06:03:21 +03:00
readme
Note that adding a label is part of the delta stream and creates a new
change number, `3`.
2015-06-30 03:55:53 +03:00
</s>
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`+ls`](#ls)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> :+ls path/to/directory`
2015-02-18 06:03:21 +03:00
"ls". List files at a path. Unlike "ls" in Unix, the current path `%`
2015-06-30 03:55:53 +03:00
must be explicitly given (you cannot call `+ls` with no arguments to
2015-02-18 06:03:21 +03:00
display the files at the current path).
2015-06-30 03:55:53 +03:00
~zod:dojo> +ls %try
> +ls %/try/
readme/md
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
### [`|mount`](#mount)
2015-06-30 03:55:53 +03:00
`~zod:dojo> |mount /path/to/directory/version %mount-point`
Your files are not synced to unix by default.
To sync a subtree to unix, run `|mount /path/to/directory %mount-point`.
This will sync it into <pier>/<mount-point>.
If you want to sync your whole home desk into f0/home, for example,
run `|mount % %home` You can also [`|unmount`](#unmount).
2015-06-30 03:55:53 +03:00
~zod:dojo> |mount /~zod/base/0 %base
> |mount /~zod/base %base
>=
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|mv`](#mv)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |mv /path/to/source /path/to/destination`
2015-02-18 06:03:21 +03:00
Move a file to a given location, creating a new revision of the source
that omits the moved file.
2015-06-30 03:55:53 +03:00
~zod:dojo> |mv %/try/6/txt %/try/7/txt
> |mv %/try/6/txt %/try/7/txt
+ /~zod/home/3/try/7/txt
>=
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|reload`](#reload)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |reload %vane-name [...]`
2015-02-18 06:03:21 +03:00
Reload the standard library (zuse) and/or arvo vanes. If zuse is
reloaded, vanes depending on the changes must be reloaded as well. For
2015-06-30 03:55:53 +03:00
example `|reload %zuse %ford` is necessary to make use of changes in
2015-02-18 06:03:21 +03:00
application code or the REPL.
2015-05-27 22:20:23 +03:00
Possible values for %vane-name see [Overview](overview "overview"):
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
~zod:dojo> |reload %zuse
[%tang /~zod/home/~2015.6.29..23.50.29..134d/arvo/zuse ~hillyx-salhet]
> |reload %zuse
>=
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
------------------------------------------------------------------------
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
### [`|reset`](#reset)
`~zod:dojo> |reset`
Reloads all vanes. See [`|reload`](#reload) for reloading only or a specific vane.
~zod:dojo> |reset
[%vega-start /~zod/home/~2015.6.29..23.51.42..f335/arvo/hoon]
%vega-parsed
[%vega-compiled %163 163]
%hoon-load
[%tang /~zod/home/~2015.6.29..23.51.42..f335/arvo/zuse ~hillyx-salhet]
[%vane %a /~zod/home/~2015.6.29..23.51.42..f335/arvo/ames ~tilwyl-talren]
%ames-reload
[%vane %c /~zod/home/~2015.6.29..23.51.42..f335/arvo/clay ~molmur-panlus]
[%vane %d /~zod/home/~2015.6.29..23.51.42..f335/arvo/dill ~sicbet-miphes]
[%vane %e /~zod/home/~2015.6.29..23.51.42..f335/arvo/eyre ~solrux-sibnep]
[gub=30 hov=19 ged=18 ded=1 pox=1 ask=1 kes=1 ney=35 dop=1 liz=1 wup=1 sop=1 wix=1]
[%vane %f /~zod/home/~2015.6.29..23.51.42..f335/arvo/ford ~librem-sopseg]
[%vane %g /~zod/home/~2015.6.29..23.51.42..f335/arvo/gall ~sidsub-fasrev]
[%vane %t /~zod/home/~2015.6.29..23.51.42..f335/arvo/time ~ritwyn-lanrev]
> |reset
<<<reset>>>
>=
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|rm`](#rm)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |rm /path/to/source`
2015-02-18 06:03:21 +03:00
Remove a file.
2015-06-30 03:55:53 +03:00
~zod:dojo> |rm %/try/7/txt
>=
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`+solid`](#solid)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> +solid`
2015-02-18 06:03:21 +03:00
compiles a kernel into a new full urbit.pill
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|sync`](#sync)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |sync %source-desk ~hidduc-posmeg %target-desk`
2015-02-18 06:03:21 +03:00
Sets up a subscription to the source desk on the target ship name to the
target desk on your ship.
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`+ticket`](#ticket)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> +ticket ~ship-name`
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
Creates a will for a ship. `+ticket` outputs the ticket for a Urbit
2015-02-18 06:03:21 +03:00
ship. Takes an option `[~ship-name]`. On destroyes this command creates
a yacht and takes the option \`[\~yacht-name-destroyer-name]
------------------------------------------------------------------------
### [`:thumb`](#thumb)
2015-06-30 03:55:53 +03:00
<mark>GONE</mark>
<s>
`~zod:dojo> :thumb ~ship-name`
2015-02-18 06:03:21 +03:00
Show the ships information. Only works if you issued a [`:hi`]
[\`\~ship-name] beforehand.
This command is not avaible since the switch from batz to `%gall`!
Use this for the time beeing: - will:
`~zod/try=> ((hard (unit gcos)) .^(%a /=gcos=/~ship-name))` - raw will:
`~zod/try=> ((hard will) .^(%a /=will=/~ship-name))`
2015-06-30 03:55:53 +03:00
</s>
2015-02-18 06:03:21 +03:00
------------------------------------------------------------------------
### [`|unmount`](#unmount)
`~zod:dojo> |unmount /path/to/directory`
Your files are not synced to unix by default.
To sync a subtree to unix, run [`|mount`](#mount).
You can unmount with either `|unmount /path/to/directory`
or `|unmount %mount-point`.
2015-06-30 03:55:53 +03:00
~zod:dojo> |unmount %base
> |unmount %base
>=
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|unsync`](#unsync)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |unsync %source-desk ~hidduc-posmeg %target-desk`
2015-02-18 06:03:21 +03:00
Cancels the subscription to the source desk on the target ship name to
the target desk on your ship.
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|verb`](#verb)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |verb`
2015-02-18 06:03:21 +03:00
Turn verbose arvo mode on/off.
You'll see events, internal cards, and effects.
[%unix p=%wake //temp]
[ %give
%t
%wake
~[
/c/tyme
/g/a/~zod/._~~.58_~~.shell_~~.terminal__/w/drug/~zod/main
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/began/u
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/._~~.2_~~.shell_~~.terminal__/u/to-gan
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/._~~.shell_~~.terminal__/u/child/2/main
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/terminal/u/txt
/d/term-mess
//term/1
]
]
[ %give
%c
%writ
~[
/g/a/~zod/._~~.58_~~.shell_~~.terminal__/w/drug/~zod
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/began/u
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/._~~.2_~~.shell_~~.terminal__/u/to-gan
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/._~~.shell_~~.terminal__/u/child/2/main
/g/a/~harnyr-darlux-bitrux-litnum--falbec-tacsev-magdus-tobsyn/terminal/u/txt
/d/term-mess
//term/1
]
]
...
------------------------------------------------------------------------
2015-06-30 03:55:53 +03:00
### [`|ye`](#ye)
2015-02-18 06:03:21 +03:00
2015-06-30 03:55:53 +03:00
`~zod:dojo> |ye ["message"]`
2015-02-18 06:03:21 +03:00
Send a message to all ships. Often used to announce a continuity breach.
------------------------------------------------------------------------