ManualReference
Commands
Every chan command and subcommand, the chan serve flags no other page covers, and the other names of the chan binary.
chan
chan serves workspaces, runs devservers and changes chan's settings, from any shell. Add --help to any command for its flags and examples.
A prefix that names one command is enough, at every level: chan w ls is chan workspace ls, and chan de status is chan devserver status. A prefix that fits two commands, such as s for serve and shell, is refused.
Serve a workspace
| Command | What it does | More |
|---|---|---|
chan serve PATH, chan open PATH | Registers PATH as a workspace and serves it: in Chan Desktop or a devserver when one runs, otherwise on its own for a browser. | Workspaces |
chan close PATH | Stops serving a workspace and keeps it registered. --forget also forgets it. | Workspaces |
chan ps | Lists the registered workspaces and what serves each. --json prints it for scripts. | Workspaces |
chan workspace
chan workspace | What it does | More |
|---|---|---|
add PATH | Registers a directory without serving it. --semantic-search turns on semantic search for it. | Workspaces |
ls | Lists the registered workspaces, most recent first, with each one's key. Takes --json. | Workspaces |
serve, close | The same as chan serve and chan close. | |
forget PATH | Stops serving a workspace, unregisters it, and deletes chan's data for it. Your files stay. | Workspaces |
index rebuild PATH | Builds the search index and graph again. | Index |
index download-model, list-models, set-model, enable-semantic, disable-semantic, status | Fetch, list and choose the embedding model, turn a workspace's semantic search on or off, and report it. | Semantic search |
reports enable, reports disable | Turn a workspace's code reports on or off, named with --path PATH. Off deletes the report and asks first; -y skips the question. | Code reports |
search QUERY | Searches and walks the workspace you are in, the one --workspace names, or all with --all-workspaces, as cs search does. | Search |
graph --from TYPE:VALUE | Walks the graph's relationships from a node, such as file:notes/a.md. | Search |
status PATH | Reports a workspace's index, graph and code report. Takes --json. | |
metadata export PATH ARCHIVE, import, inspect | Save chan's data for a workspace to a .tar.zst archive, restore it, or list what an archive holds. | Settings |
contacts import csv FILE | Writes one contact note per row of a Google Contacts CSV, into --into DIR of --workspace PATH. --dry-run writes nothing. | Contacts |
chan devserver
The first commands run the devserver of the machine you type them on. The rest manage the devservers on Chan Desktop's Computers screen, so they need Chan Desktop running; NAME is the name or URL chan devserver ls shows.
chan devserver | What it does | More |
|---|---|---|
run | Runs the devserver in this terminal until Ctrl+C. | Run a devserver |
start, stop, restart | Start the background service and enable it at login or boot, stop and disable it, or restart it on the current binary. | Run a devserver |
status | Prints the service's state and, in a terminal or with --url, its URL with the token. | The token |
join | Starts the service if it is down and stays attached until Ctrl+C. Connect scripts run it. | The token |
rotate-token | Replaces the token and prints the new URL. | The token |
register URL | Adds a devserver to the Computers screen without connecting. --name and --script fill the form's Name and Connect script. | Connect |
ls | Lists the devservers on the Computers screen with their state. Takes --json. | Connect |
connect NAME, disconnect NAME | Connect to a devserver, or drop the connection; it keeps running. | Connect |
forget NAME | Removes a devserver and its stored token. A connected one is refused unless you add --force. | Connect |
The commands for a machine's own devserver share --bind, --port and --service, and the tunnel flags that publish a devserver through a gateway.
Other commands
| Command | What it does | More |
|---|---|---|
chan metrics | Prints the running devserver's readings: CPU, memory, traffic and disk. --watch repeats them, and --url reads another chan server. | Metrics |
chan config get [KEY], chan config set KEY VALUE | Read and write the settings that live outside a workspace, as Settings does, with nothing running. | Settings |
chan completions SHELL | Prints a completion script for bash, elvish, fish, powershell or zsh. | |
chan dump-skill | Prints chan's manual for agents, built from its own help: --list for its topics, --topic SLUG for one, --full for all of it. | Agent teams |
chan upgrade | Replaces this chan with the latest release after asking. --check only reports, --version V picks a release, and -y skips the question. | |
chan shell | The same command as cs. | Below |
chan serve flags
Workspaces explains --standalone, --desktop, --devserver and --on. Chan in a browser explains --port, --host, --no-browser, --here, --timeout, --no-settings and --no-token. The rest:
| Flag | What it does |
|---|---|
-4, --ipv4 | Listens on IPv4 only, on 127.0.0.1 unless --host names another IPv4 address. |
-6, --ipv6 | Listens on IPv6 only, on ::1 unless --host names another IPv6 address. |
--search-aggression LEVEL | Sets how hard the indexer works for this run: conservative, balanced or aggressive. It overrides Settings → Search → Search indexing. |
--prefix /team/alice | Serves under a URL path, so a reverse proxy can put several servers on one host. Each segment takes letters, digits and -. |
Details and limits
- Only a server the command binds itself can enforce
--no-settings, so a serve that would hand the workspace to Chan Desktop or a devserver is refused. Add--standalone. --timeouttakes a whole number withs,morh, such as30s; zero is refused.--devserver=PORTalso takes a URL on the same machine, such as--devserver=http://127.0.0.1:9999, always with=. A URL of another host is refused.--on NAMEtakes no other serve flag, and its PATH is a path on that devserver.-4or-6with a--hostof the other kind is refused.chan servetakes a path only; a URL is refused with a pointer tochan devserver register.- A path inside a Git, Mercurial or Subversion working tree exits with status 70. See Troubleshooting.
chan closeandchan workspace forgetexit with status 75 while a workspace is still releasing; run them again.-v,-vvand-vvvraise logging on every command.chan --versionprints the release and the build.
cs
cs runs inside a chan terminal and drives the window it runs in: it opens files, terminals and panes, writes to and reads other terminals, and reports a program's status on its tab. chan shell is the same command, and prefixes work the same way: cs te l is cs terminal list.
Other names of chan
The chan program also answers to four other names, and does what the name it runs under says.
| Name | What it does | More |
|---|---|---|
cs | Drives the chan window a terminal runs in. | cs |
chan-term | Opens a Chan Desktop terminal window: your shell, or a command in a window of its own. | Standalone |
chan-files PATH | Opens a directory in a standalone terminal window's file browser. | Standalone |
chan-edit PATH | Opens a file in a standalone terminal window's editor. | Standalone |
| Installed by | Names |
|---|---|
The CLI installer for macOS, Linux and FreeBSD, and Homebrew's chan | chan, cs |
| The Windows CLI installer | chan, and cs as cs.cmd and a Git Bash cs |
| Chan Desktop | All five, in ~/.local/bin. On Windows, only chan and cs. |
The Arch, Ubuntu, Fedora and Nix packages of chan and of Chan Desktop | All five |
If command -v cs finds nothing, link it once:
$ln -s "$(command -v chan)" ~/.local/bin/csDetails and limits
- Chan Desktop repairs the names it wrote in
~/.local/binwhen they go stale, and leaves alone a name you put there yourself. - The
chanthat Chan Desktop installs hands a workspace to Chan Desktop, and itschan upgradeupdates Chan Desktop. - The
chan-term,chan-filesandchan-editof thechanpackages cannot start Chan Desktop; see Standalone.