Sharing and Space networks

Share a port, file or folder as a link or a public TCP address, set what a Space can reach and where its traffic leaves, the exit through this computer, and the paths between your computers.

CommandDescription
cua shareShare a link to a port, a file or a folder that opens on your other signed-in devices (never localhost): cua share 3000, cua share ./report.html, cua share ls, cua share stop ID.
cua share lsList the active shares.
cua share stopStop a share (its link stops working at once), or all.
cua share checkOpen a share's link once, as its owner, and say what came back.
cua share approveLet a waiting public TCP share go live: one an agent in a Space asked for, or the first through a share edge in your cloud.
cua share denyTurn down a waiting public TCP share.
cua share settingsWhere public TCP shares go, the daily data cap, the default allowlist and the approval rule; with no flags, shows them.
cua networkWhat a Space can reach on the network, and changing it: show, set, log.
cua network showWhat a Space can reach: its preset, what it opens, where it is enforced, and what is always blocked.
cua network setChange what a Space can reach.
cua network logWhat a Space tried to reach and was blocked, most recent first.
cua hotspotSend a Space's internet traffic out through this computer for a while: start, stop, status.
cua hotspot startSend a Space's internet traffic out through this computer's network until cua hotspot stop (its own rules still apply).
cua hotspot stopStop it.
cua hotspot statusWhether it is on, and what it carried.
cua meshHow traffic reaches your other computers: status (and --prefer).
cua mesh statusThe path to each other computer (local network, direct or relay), its round trip and why it was chosen.

Every command also accepts the global options.

cua share#

Share a link to a port, a file or a folder that opens on your other signed-in devices (never localhost): cua share 3000, cua share ./report.html, cua share ls, cua share stop ID.

cua share [OPTIONS] <TARGET>
       cua share <COMMAND>
ArgumentTypeDefaultDescription
<TARGET>stringrequiredWhat to share: a port (3000), a port in a Space (space:NAME:3000), or a file or folder (./report.html, ./build/). Paths are read-only; use ./ls for a file called ls.
FlagShortTypeDefaultDescription
--ttlstringHow long the share lasts (10m, 1h, 60s to 24h). Public shares default to 1h; the others have no end unless you set one.
--namestringA name for cua share ls (and cua share stop NAME).
--servicestringWith --tcp: the game or service (minecraft), for a name people can type instead of the address.
--routeauto | host | edge | relayWith --tcp: how people reach it. auto (default) takes the Space's own host in your cloud, else a small server in your linked cloud (a share edge), else Cua's relay, within cua share settings.
--allowstringWith --tcp: only these addresses or CIDRs may connect (repeat it). Default: the settings' allowlist, usually anyone. Repeatable.
--teambooleanfalseShare with the members of your team.
--publicbooleanfalseAnyone with the link can open it. Expires (default 1h, 60s to 24h).
--tcpbooleanfalseShare a raw TCP service in a Space (a game server, for example) at a public address instead of a link: anyone with the address can connect, for 24h unless --ttl says less. Needs --public and a port in a Space (inside a Space, a bare port is its own). An experiment: turn on Public TCP shares in Settings, Labs.
--check-hostbooleanfalseWith --tcp --service minecraft: drop connections that did not dial this share's address (scanners, stale addresses).
--yes-ybooleanfalseWith --tcp: agree to the share edge's cost without asking (the first share through your cloud creates a small server there).

Examples

# A dev server on this machine, for your own devices (phone included)
cua share 3000
 
# A port inside a Space
cua share space:dev:3000
 
# A report or a folder, read-only
cua share ./report.html
cua share ./build/
 
# Members of your team
cua share 3000 --team
 
# Anyone with the link, for an hour
cua share ./report.html --public --ttl 1h
 
# A game server in a Space, at a public address (Labs: Public TCP shares)
cua share space:mc:25565 --tcp --public --service minecraft
 
# The same from an agent inside the Space (its own port)
cua share 25565 --tcp --public --service minecraft
 
# Through your own cloud only, for two friends' addresses
cua share space:mc:25565 --tcp --public --route edge --allow 203.0.113.7 --allow 198.51.100.0/24
 
# A share an agent asked for, waiting for you
cua share approve share-1a2b3c4d5e6f
 
# Where public TCP shares go, the daily data cap and the default allowlist
cua share settings
 
# What is shared, and stop it
cua share ls
cua share stop share-1a2b3c4d5e6f
cua share stop all

cua share ls#

List the active shares.

cua share ls [OPTIONS]

Examples

# What is shared right now
cua share ls
 
# The same as JSON
cua share ls --json

cua share stop#

Stop a share (its link stops working at once), or all.

cua share stop [OPTIONS] <ID>
ArgumentTypeDefaultDescription
<ID>stringrequiredThe share's id or name from cua share ls, or all.

Examples

# Stop one share by its id
cua share stop share-1a2b3c4d5e6f
 
# Stop everything this machine shares
cua share stop all

cua share check#

Open a share's link once, as its owner, and say what came back.

cua share check [OPTIONS] <ID> [PATH]
ArgumentTypeDefaultDescription
<ID>stringrequiredThe share's id or name.
<PATH>stringoptionalA path below the link to open.

Examples

# Does the link load?
cua share check share-1a2b3c4d5e6f
 
# Open a page below the link
cua share check share-1a2b3c4d5e6f /index.html

cua share approve#

Let a waiting public TCP share go live: one an agent in a Space asked for, or the first through a share edge in your cloud.

cua share approve [OPTIONS] <ID>
ArgumentTypeDefaultDescription
<ID>stringrequiredThe waiting share's id.
FlagTypeDefaultDescription
--alwaysbooleanfalseLet its Space's agents share without asking from now on.

Examples

# See what waits, then approve it
cua share ls
cua share approve share-1a2b3c4d5e6f
 
# And let that Space share without asking from now on
cua share approve share-1a2b3c4d5e6f --always

cua share deny#

Turn down a waiting public TCP share.

cua share deny [OPTIONS] <ID>
ArgumentTypeDefaultDescription
<ID>stringrequiredThe waiting share's id.

Examples

cua share deny share-1a2b3c4d5e6f

cua share settings#

Where public TCP shares go, the daily data cap, the default allowlist and the approval rule; with no flags, shows them.

cua share settings [OPTIONS]
FlagTypeDefaultDescription
--landauto | only-my-cloud | allow-relayauto, only-my-cloud or allow-relay.
--relayon | offWhether Cua's relay may carry public TCP shares at all.
--daily-capstringThe most data public TCP shares move in a day (2GB, 500MB, off).
--allowstringThe allowlist new shares start with (repeat it). Repeatable.
--approve-agentson | offAsk before an agent's share goes public (on, the default).
--allow-anyonebooleanfalseNew shares are open to anyone (clears the allowlist).
--remove-edgebooleanfalseRemove the share edge from your cloud now; its shares end.

Examples

# Show them
cua share settings
 
# Never through Cua: only your own cloud
cua share settings --land only-my-cloud
 
# A 5 GB daily data cap, or none
cua share settings --daily-cap 5GB
cua share settings --daily-cap off
 
# New shares only for these addresses
cua share settings --allow 203.0.113.0/24
 
# Remove the share edge from your cloud now
cua share settings --remove-edge

cua network#

What a Space can reach on the network, and changing it: show, set, log. An experiment: see cua experiments.

cua network [OPTIONS] <COMMAND>

cua network show#

What a Space can reach: its preset, what it opens, where it is enforced, and what is always blocked.

cua network show [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.

Examples

cua network show studio
cua network show local:studio --json

cua network set#

Change what a Space can reach. A child Space stays within its parent's unless --widen.

cua network set [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.
FlagTypeDefaultDescription
--networkstringinternet, none, localhost:<ports> (or localhost:all), lan, custom, custom:none or unprotected (No protection). Left out: the preset it has (to change only --via).
--viastringWhere its internet traffic leaves: internet (its own network, the default), this-computer (this computer's network: the hotspot), space:<name> (a Space of its tree) or socks5://host:port. Its rules apply first; if the exit goes away, its internet stops (it never falls back). A child keeps its parent's. Left out: the exit it has.
--allowstringAllow this destination (IP, CIDR, or a name such as pypi.org or *.github.com on runtimes behind the Cua network gateway; repeat for more). Repeatable.
--denystringBlock this destination (IP, CIDR, all, or a name on runtimes behind the Cua network gateway; repeat for more). A deny wins over the Space's own tree: it blocks a member of the tree too. Repeatable.
--widenbooleanfalseA child Space: let it reach more than its parent (recorded on the Space).
--treebooleanfalseIts child Spaces get the same settings (each within its parent's).

Examples

# This computer's Postgres and dev server only
cua network set studio --network localhost:5432,3000
 
# Your local network too
cua network set studio --network lan
 
# Only these destinations
cua network set studio --network custom:none --allow 140.82.112.0/20
 
# Back to the default
cua network set studio --network internet
 
# Its internet traffic leaves through this computer (the hotspot)
cua network set studio --via this-computer
 
# ... or through another Space of its tree, or a SOCKS5 proxy
cua network set worker --via space:gateway
cua network set studio --via socks5://proxy.example:1080
 
# Its own network again
cua network set studio --via internet

cua network log#

What a Space tried to reach and was blocked, most recent first.

cua network log [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.

Examples

cua network log studio

cua hotspot#

Send a Space's internet traffic out through this computer for a while: start, stop, status. (cua network set --via this-computer keeps it.) Part of the Secure Spaces experiment.

cua hotspot [OPTIONS] <COMMAND>

cua hotspot start#

Send a Space's internet traffic out through this computer's network until cua hotspot stop (its own rules still apply).

cua hotspot start [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.
FlagTypeDefaultDescription
--bypassstringDestinations that keep the Space's own network (repeat). Repeatable.
--system-proxybooleanfalsePoint the Space's system proxy (and new processes' ALL_PROXY) at it. Otherwise apps use the SOCKS address it prints.

Examples

cua hotspot start studio
cua hotspot start studio --system-proxy --bypass 10.0.0.0/8

cua hotspot stop#

Stop it.

cua hotspot stop [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.

Examples

cua hotspot stop studio

cua hotspot status#

Whether it is on, and what it carried.

cua hotspot status [OPTIONS] <SPACE>
ArgumentTypeDefaultDescription
<SPACE>stringrequiredSpace id or name.

Examples

cua hotspot status studio --json

cua mesh#

How traffic reaches your other computers: status (and --prefer). Part of the Secure Spaces experiment.

cua mesh [OPTIONS] <COMMAND>

cua mesh status#

The path to each other computer (local network, direct or relay), its round trip and why it was chosen. --prefer pins it.

cua mesh status [OPTIONS]
FlagTypeDefaultDescription
--preferstringPin the path: lan (the local network whenever it answers), direct, relay, or auto (fastest; lifts the pin). Traffic never stops: a pinned path that goes away falls back.

Examples

cua mesh status
cua mesh status --prefer lan
cua mesh status --prefer auto

Exit codes#

CodeMeaning
0Success.
1Failure, or cua do reported an error.
2Invalid argument, or an ambiguous sandbox name (qualify it: local:NAME).
3Not found: sandbox, window, skill or image (or an image not published yet).
4Not supported, or not configured (for example no provider credentials).
5No cua-spacesd answered, or a transport failure.
6Unauthenticated or permission denied (by Cua or your cloud account).
7Not enough free disk space (see cua cache).
8No room on the machine: its VMs are at their memory or CPU limit, or it is low on memory.
130Cancelled (Ctrl-C during a create): what it made was removed.