Remote hosts
Run terminal sessions on a zidane server, open the whole window on one server, and lend this machine to a server.
The terminal app can run sessions on a zidane server. The server clients page covers hosts, machines and settings sync in every client.
| You want | Use |
|---|---|
| Some sessions on a server, others on this computer | Remote hosts |
| The whole window on one server | --host |
| A server's sessions working in your folders | Lend a machine |
Remote hosts#
Remote hosts are off by default. Turn on Settings › Agent › Remote hosts (kill switches). The Hosts tab then shows in Settings.
Add a server#
Get a token
On the server, run
zidane-server token create --name laptop. The command prints the token once (server tokens).Add it
In Settings › Hosts, press Enter on
+ add a server. Type the address (wss://host:port) and press Enter. Paste the token and press Enter to connect and save. zidane saves the server only if it answers.Use it
When you start a new session, zidane asks where it runs. The sessions list groups sessions by host.
| Key on a server row | Does |
|---|---|
| Enter or CtrlT | Test the connection |
| CtrlB | Machines lent to the server |
| CtrlS | Send this computer's settings to the server (settings sync) |
| CtrlE | Rename |
| CtrlU | Change its URL (prefilled). Keeps the token, and saves once the same server answers there. |
| CtrlX | Remove. Press Y to confirm or N to keep it. |
zidane saves the servers in hosts.json, which the desktop app also reads. The tokens go in the credentials file (files and folders). In a server session, Settings edits the server's side. ! commands run on the server, in the session's folder.
Open the app on one server#
--host points the whole window at one server. zidane does not save the server:
zidane --host wss://zidane.example.com --token-file ~/.config/zidane/box.token| Flag or variable | Use |
|---|---|
--host <wss-url> | The server |
--token-file <path> | Read the token from a file. - reads stdin. |
--token <t> | The token itself. It shows in ps and your shell history, and zidane prints a warning. --token - reads stdin. |
ZIDANE_HOST_URL | --host from the environment |
ZIDANE_HOST_TOKEN | The token from the environment |
--no-remote and ZIDANE_NO_REMOTE=1 refuse --host and ignore ZIDANE_HOST_URL with a warning. zidane run --json and --json-schema runs stay local and refuse --host. What runs where: server clients.
Lend a machine#
To add a computer as a machine that starts at boot, run zidane machine setup --join <url>#<code> on that computer. The <code> part is a join code, a one-time code from the server (servers and machines). On a server row in Settings › Hosts, CtrlB opens its machines. The add a machine row (Enter) shows that command with a new join code. C copies it and Esc closes it.
zidane machine share lends this computer's folders and a shell to a server's sessions:
zidane machine share --host wss://zidane.example.com --token-file machine.token --name studio --root ~/codeRepeat --root for several folders. File operations cannot reach outside these folders. Shell commands from the server run as your user, so share only with servers you trust.
Each flag can come from a ZIDANE_MACHINE_* variable instead (ZIDANE_MACHINE_HOST, _NAME, _ROOTS, _TOKEN_FILE, _DATA_DIR). Without a token file, ZIDANE_MACHINE_TOKEN holds the token itself. --env-file <file> reads them from a file of mode 600. A flag wins over the environment, and the environment wins over the file.
The token must have the machine scope. On the server, create it with zidane-server token create --name studio --scope machine (machines).
Local hosts#
| Host | Does |
|---|---|
zidane server | Runs a server on this computer for other windows (install the server) |
| The daemon | A background process that keeps runs going after you close the window and shares them with your other windows. Settings › Agent › Use daemon runtime turns it on. |