# depends

> Dependency graphs showing the state of everything you depend on. depends keeps a dependency graph for each namespace on depends.cc. A node is one thing in the graph, such as `api` or `db`; whatever runs it writes the node's state: `green` (working), `yellow` (unknown or stale) or `red` (failing). A node that depends on a red node shows red too, so the tree shows where a failure starts and what it reaches.

## Install

`curl -fsSL https://depends.cc/install.sh | sh` installs `depends`, the CLI: it clones the source, runs `bun install` and links `depends`. Running it again upgrades.

## CLI

Every command but `depends skill` and `depends help` takes `--json`. An error is one line on stderr, and stdout stays empty. Exit codes: 0 done, 1 not found, 2 anything else: read the line on stderr. A node is named `<namespace>/<node>`, such as `acme/api`.

- `depends login [--base URL]` — pair this machine with the account. It prints a link for a human to approve in a browser; an agent cannot finish a login alone.
- `depends logout` — revoke this machine's login and forget it.
- `depends namespaces` — the account's namespaces, each with its red, yellow and green counts.
- `depends graph [<namespace>]` — the namespace's tree, each node with its state. Read `--json` rather than the tree.
- `depends init` — write a first `./depends.yaml` to edit.
- `depends push [--dry-run] [--prune]` — make the namespace match `./depends.yaml`: its nodes, their edges and its notifications.
- `depends pull [<namespace>] [--dry-run] [--force]` — write the `depends.yaml` the last push kept to `./depends.yaml`.
- `depends share <namespace> <read|set>` — make a share on the namespace and print its link. The part after `#` is its token: in `DEPENDS_TOKEN`, it lets a service with no login read the namespace (`read`) or also write node states (`set`).
- `depends shares [<namespace>]` — the shares this account made, or those on one namespace.
- `depends revoke <grant>` — end a share, by the grant id `depends shares` prints.
- `depends status <namespace>/<node>` — one node: its state, reason and solution, what it depends on and what depends on it.
- `depends set <namespace>/<node> <green|yellow|red> [--reason TEXT] [--solution TEXT]` — write the node's state, making the node if need be.
- `depends events <namespace>[/<node>] [--limit N]` — the namespace's or the node's state changes, newest first.
- `depends check [--dry-run]` — run the health checks `./depends.yaml` holds in each node's `checks`, then write each node's state.
- `depends delete <namespace>[/<node>]` — delete a namespace with its nodes, or one node. It prints the command that undoes it.
- `depends restore <namespace>[/<node>]` — bring back a deleted namespace with its nodes, or a deleted node.
- `depends version` — the CLI's version.

`depends skill` installs the guide for agents. `depends help` lists every command.
