Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions pkgs/id/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ just serve
### With Cargo

```bash
# Library-only (no web UI)
cargo build --no-default-features
cargo run --no-default-features -- serve
# Default build: sandbox and world included, no web UI
# (--no-default-features would also remove sandbox and world)
cargo build
cargo run -- serve

# With web UI (build assets first)
cd web && bun install && bun run build && cd ..
Expand All @@ -66,8 +67,8 @@ id get myfile.txt
# List all files
id list

# Find files by pattern
id find "*.rs"
# Find files by query (case-insensitive substring; no glob matching)
id find ".rs"

# Search files
id search "hello"
Expand Down Expand Up @@ -256,7 +257,7 @@ it is — a valid world capability, minted by the host's admin with
| `peek` | | Preview with configurable head/tail lines |
| `find` | | Find files by query, optionally output content |
| `search` | | Search files and list all matches |
| `list` | `ls` | List all stored files |
| `list` | | List all stored files |
| `tag` | `label`, `link` | Manage metadata tags on files |
| `migrate-tags` | `migrate` | Add name/file auto-tags to existing files |
| `id` | | Print local node public ID |
Expand Down Expand Up @@ -313,7 +314,8 @@ id repl
> tag search author:Jane # Structured search syntax
> tag find readme # find = search alias
> migrate-tags # Add name/file tags to all files
> cat myfile.txt | head -5 # Pipe output to shell
> !head -5 myfile.txt # Shell escape: run any shell command
> printf 'bread\n' |> put - bakery.txt # Pipe shell output into a stored file
> $(id id) # Subshell expansion
> help # Show all commands
```
Expand Down
18 changes: 10 additions & 8 deletions pkgs/id/book/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ The root package's feature table is the authority:
- `currency-poc-tb` adds the TigerBeetle client for the currency proof of
concept. It adds no CLI surface.

### The `--no-default-features` trap (disagreement CLI-2)
### The `--no-default-features` trap (disagreement CLI-2, resolved)

The README's Cargo quick start presents this command as the library-only
build:
The README's Cargo quick start once presented this command as the
library-only build:

```bash
cargo build --no-default-features
Expand All @@ -84,8 +84,9 @@ Because `default = [sandbox, world]`, `--no-default-features` removes
in a `--no-default-features` build are:

- `id match-audit` and the four sandbox world commands — `id world dev`,
`id world measure`, `id world replay`, `id world verify` — do not exist
in the parser at all. Clap reports them as unrecognized subcommands.
`id world measure`, `id world replay`, `id world verify` — still parse
and print their `--help`, but fail at dispatch with the error
`this build has no sandbox support`.
- Every other `id world …` command still parses and still prints its full
`--help` tree, but fails at runtime with the error
`this build has no world support`.
Expand Down Expand Up @@ -136,9 +137,10 @@ Inside the data directory, the layout is:
| `groups.jsonl` | The group log used by `group`, `delegate`, and `revoke`. This is the runtime default of the global `--groups-log <FILE>` flag; a relative value is relative to the data directory. |

One disagreement is worth knowing before you go looking for the lock:
the module documentation in `crates/id-cli/src/commands/serve.rs` draws
the lock file as `.id-serve-lock`. That spelling is wrong (disagreement
CLI-5). The constant, the `--data-dir` help text, and the code all use
the module documentation in `crates/id-cli/src/commands/serve.rs` once
drew the lock file as `.id-serve-lock`. That spelling was wrong
(disagreement CLI-5, resolved — the module documentation now matches).
The constant, the `--data-dir` help text, and the code all use
`.iroh-serve.lock`.

`id serve --ephemeral` skips provisioning entirely: it uses in-memory
Expand Down
8 changes: 4 additions & 4 deletions pkgs/id/book/reference/cli-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Aliases: `in`, `add`, `store`, `import`.
Behaviour notes:

- Each `FILES` entry is a path. The form `path:name` renames the file during storage: the bytes come from `path` and the stored name is `name`.
- With `--content`, the single positional argument is the stored name, not a path. Supplying zero or more than one name fails with `--content requires exactly one name argument`. Discrepancy CLI-14: the `--help` summary line for `--content` ("Read content from stdin instead of file paths") omits the one-name requirement; the requirement is stated in the field documentation and enforced by the handler.
- With `--content`, the single positional argument is the stored name, not a path. Supplying zero or more than one name fails with `--content requires exactly one name argument`. The `--help` summary line for `--content` states the requirement ("Read content from stdin instead of file paths (requires exactly one name argument)"); an earlier summary line omitted it (discrepancy CLI-14, resolved). The requirement is also stated in the field documentation and enforced by the handler.
- With no files and no stdin input, `put` fails with `no files provided`.
- When several files are stored and some fail, the failures are collected into one aggregated error, `some puts failed:` followed by the individual failures, and the command exits 1.

Expand Down Expand Up @@ -204,7 +204,7 @@ id list [NODE]
Behaviour notes:

- Lists all stored files (names) in the local store, or in the remote node's store when `NODE` (a 64-character hex node ID) is given.
- Discrepancy CLI-1: `list` has no `ls` alias in the clap parser. `id ls` fails with `error: unrecognized subcommand 'ls'` and the tip "a similar subcommand exists: 'list'" (exit 2), even though the README command table lists `ls` as an alias. The `ls` spelling exists only inside the REPL, and as the alias of `tag list` (see [The tag family](cli-tags.md)).
- `list` has no `ls` alias in the clap parser. `id ls` fails with `error: unrecognized subcommand 'ls'` and the tip "a similar subcommand exists: 'list'" (exit 2). The README command table once listed `ls` as an alias (discrepancy CLI-1, resolved — the table no longer does). The `ls` spelling exists only inside the REPL, and as the alias of `tag list` (see [The tag family](cli-tags.md)).

Worked example (toy data):

Expand Down Expand Up @@ -250,7 +250,7 @@ Failure shapes: a store that cannot be opened is a handler error (exit 1).

- Queries are case-insensitive and match against both names and hashes.
- Match quality is ordered: exact match ranks above prefix match, which ranks above contains (substring) match.
- Discrepancy CLI-8: there is no glob or wildcard matching anywhere in the search implementation. A query of `*.rs` is the literal two-character substring `*.` followed by `rs`; in practice it matches nothing, despite the README usage example `id find "*.rs"` being labelled "Find files by pattern".
- There is no glob or wildcard matching anywhere in the search implementation. A query of `*.rs` is the literal two-character substring `*.` followed by `rs`; in practice it matches nothing. The README usage example once labelled `id find "*.rs"` "Find files by pattern" (discrepancy CLI-8, resolved — the example now uses a substring query).
- `--first [N]` and `--last [N]` are optional-value flags on all four commands. Each takes zero or one value (`num_args = 0..=1`); a bare `--first` or `--last` means `1`. The two flags conflict with each other. A value of `0` is rejected by the value parser with `zero is not a valid limit: use at least 1` (clap error, exit 2); a non-numeric value fails in the same parser.
- `--exclude <PAT>` is repeatable on all four commands and drops matches whose name or hash contains the pattern.
- `--name` is accepted by all four commands and makes name matches rank above hash matches.
Expand All @@ -267,7 +267,7 @@ Failure shapes: a store that cannot be opened is a handler error (exit 1).
| `group` | Matches grouped by query. |
| `union` | Matches deduplicated by hash. |

The clap default is `tag`. Discrepancy CLI-11: the REPL's `find` and `search` default to `union`, because the REPL hand parser enters with `union` as its default format. The same query therefore prints tag-grouped output from the command line and union-deduplicated output in the REPL, and neither side's help mentions the other's default.
The clap default is `tag`. The REPL's `find` and `search` default to `union`, because the REPL hand parser enters with `union` as its default format. The same query therefore prints tag-grouped output from the command line and union-deduplicated output in the REPL. Each side's help now names the other's default (discrepancy CLI-11, resolved).

## `find`

Expand Down
8 changes: 4 additions & 4 deletions pkgs/id/book/reference/cli-gallery-walk.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Three unrelated command groups share this chapter. `id gallery` administers the

Exit behaviour, all commands in this chapter unless a command states otherwise: success exits `0`; a handler error prints `Error: <message>` to stderr and exits `1`; a clap parse error (unknown subcommand or flag, missing required argument, conflicting flags, bad value) prints the error and usage to stderr and exits `2`.

Feature gating differs per group. `id gallery` and `id walk` are not feature-gated: both work in every build, including a `--no-default-features` build. `id match-audit` is gated on the `sandbox` cargo feature at the parser level: in a build without `sandbox` the command does not exist in help or in the parser, and invoking it is a clap error, exit `2`. That is one half of disagreement CLI-10; the other half is `id world`, which parses without its feature and fails only at runtime — see [World commands: joining and playing](cli-worlds.md).
Feature gating differs per group. `id gallery` and `id walk` are not feature-gated: both work in every build, including a `--no-default-features` build. `id match-audit` parses in every build but needs the `sandbox` cargo feature at dispatch: in a build without `sandbox` it fails with `this build has no sandbox support`, exit `1` — the same parse-everywhere, fail-at-dispatch pattern as `id world`, which parses without its feature and fails only at runtime (disagreement CLI-10, resolved; see [World commands: joining and playing](cli-worlds.md)).

## `gallery`

Expand Down Expand Up @@ -229,7 +229,7 @@ Failures: giving neither `--program` nor `--author` is a clap error, exit `2` (t

## `match-audit`

Exports and verifies match-audit v0 logs for tic-tac-toe. The whole command is gated on the `sandbox` cargo feature; see the gating note at the top of this chapter.
Exports and verifies match-audit v0 logs for tic-tac-toe. The whole command needs the `sandbox` cargo feature at dispatch; see the gating note at the top of this chapter.

### `match-audit export-tic-tac-toe`

Expand All @@ -249,7 +249,7 @@ Example:
$ id match-audit export-tic-tac-toe --output ./toy-match.log
```

Failures: an unwritable output path fails the command, exit `1`. In a build without the `sandbox` feature the command does not exist: clap error, exit `2`.
Failures: an unwritable output path fails the command, exit `1`. In a build without the `sandbox` feature the command fails at dispatch with `this build has no sandbox support`, exit `1`.

### `match-audit verify`

Expand All @@ -269,7 +269,7 @@ Example:
$ id match-audit verify ./toy-match.log
```

Failures: a log that does not verify against the pinned program fails the command, exit `1`. A missing log file fails the command, exit `1`. In a build without the `sandbox` feature the command does not exist: clap error, exit `2`.
Failures: a log that does not verify against the pinned program fails the command, exit `1`. A missing log file fails the command, exit `1`. In a build without the `sandbox` feature the command fails at dispatch with `this build has no sandbox support`, exit `1`.

## `walk`

Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/book/reference/cli-groups-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Failures: a non-Admin author is refused, exit `1`, and the refused event stays i

### `group join`

Parses an invitation ticket, then always fails. Group admission and network joining are not implemented: no group membership is ever recorded by this command. This is the source behaviour, and it contradicts the top-level help, which lists `join` among the things `group` can do (disagreement CLI-9). The subcommand's own help states the truth in its first line: `Unavailable: group admission and network joining are not implemented yet`.
Parses an invitation ticket, then always fails. Group admission and network joining are not implemented: no group membership is ever recorded by this command. This is the source behaviour; the top-level help once listed `join` among the things `group` can do (disagreement CLI-9, resolved — it no longer does). The subcommand's own help states the truth in its first line: `Unavailable: group admission and network joining are not implemented yet`.

```
id group join <INVITE>
Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/book/reference/cli-serve.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ id serve [FLAGS]
| `--dht` | none (switch) | off | Enable mainline DHT address lookup and publishing for the server's endpoint. The flag exists in the parser regardless of the `dht` cargo feature. |
| `--iroh-port` | `PORT` | `0` | Port for the Iroh QUIC endpoint. `0` lets the OS assign a random available port. |

Topic and secret default caveat (discrepancy CLI-6): the help text for `--topic` states "Default: `id-peer-discovery-v1`" and the help text for `--topic-secret` states "Default: `id-public-discovery-v1`". Those two strings are the hardcoded constants, and the constants are the fallback, not the operative default. On a stock serve, the topic and secret are read first from `defaults.json`; the constants apply only when `defaults.json` supplies neither, or when `--no-default-topic` is passed. The `--version` provenance line (see [The id command line](cli.md)) reports which defaults source is in force. Help alone therefore misstates what a stock serve uses.
Topic and secret default caveat: the strings `id-peer-discovery-v1` (topic) and `id-public-discovery-v1` (secret) are the hardcoded constants, and the constants are the fallback, not the operative default. On a stock serve, the topic and secret are read first from `defaults.json`; the constants apply only when `defaults.json` supplies neither, or when `--no-default-topic` is passed. The `--version` provenance line (see [The id command line](cli.md)) reports which defaults source is in force. The `--topic`/`--topic-secret` help text once presented the constants as "the default" (discrepancy CLI-6, resolved — the help now describes them as the fallback).

### Web UI flags

Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/book/reference/cli-worlds.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Source: `pkgs/id/crates/id-cli/src/cli/world.rs` under https://github.com/develo

Every `id world` subcommand is a client. No `world` subcommand hosts a world: hosting is `id serve --world`, covered in [serve and publications](cli-serve.md). The commands in this chapter are the participant and authoring side: minting an invite, installing and compiling a program, reading records, joining and chatting, mirroring and downloading, and the local-only commands that scaffold, fork and inspect world directories on disk. The operator side — changing capabilities and profiles, drift, fixtures, replicas and journal files — is in [World commands: administering and verifying](cli-worlds-admin.md). The runtime model behind these commands is in [Worlds and the Roc guest runtime](../concepts/worlds.md) and [Capabilities, ceilings and providers](../concepts/capabilities.md).

Feature gating is inconsistent, and the source behaviour is what this chapter documents (disagreement CLI-10). `id world dev` is gated on the `sandbox` cargo feature at the parser level: in a build without `sandbox`, the subcommand does not exist and clap reports `unrecognized subcommand`, exit `2`. The rest of the `world` tree is not parser-gated: in a build without the `world` feature, `id world --help` prints the full tree, but every `id world` invocation fails at runtime with `this build has no world support`, exit `1`. The default build (`default = [sandbox, world]`) and both Nix packages (`id-web`, `id-lib`) include both features.
Feature gating follows one rule: everything parses, and a missing feature fails at dispatch (disagreement CLI-10, resolved — gating was once inconsistent). The whole `world` tree parses in every build: in a build without the `world` feature, `id world --help` prints the full tree, but every `id world` invocation fails at runtime with `this build has no world support`, exit `1`. The four sandbox commands — `id world dev`, `id world measure`, `id world replay`, `id world verify` — likewise parse in every build and fail at dispatch in a build without `sandbox` with `this build has no sandbox support`, exit `1`; `id match-audit` follows the same pattern. The default build (`default = [sandbox, world]`) and both Nix packages (`id-web`, `id-lib`) include both features.

Exit behaviour, all `world` commands unless a command states otherwise: success exits `0`; a handler error prints `Error: <message>` to stderr and exits `1`; a clap parse error (unknown subcommand or flag, missing required argument, conflicting flags, bad value) prints the error and usage to stderr and exits `2`. There is no per-command exit-code table in the binary.

Expand Down
Loading