|
| 1 | +# CLI Reference |
| 2 | + |
| 3 | +## Binary |
| 4 | + |
| 5 | +`dustpkg` |
| 6 | + |
| 7 | +## Global Form |
| 8 | + |
| 9 | +```text |
| 10 | +dustpkg <COMMAND> [OPTIONS] |
| 11 | +``` |
| 12 | + |
| 13 | +## Commands |
| 14 | + |
| 15 | +## `init` |
| 16 | + |
| 17 | +Initialize a new package in the current directory. |
| 18 | + |
| 19 | +```text |
| 20 | +dustpkg init |
| 21 | +``` |
| 22 | + |
| 23 | +Behavior: |
| 24 | + |
| 25 | +- Creates `Dust.toml` with default package metadata. |
| 26 | +- Fails if `Dust.toml` already exists. |
| 27 | + |
| 28 | +## `add` |
| 29 | + |
| 30 | +Add one dependency to manifest and regenerate lockfile. |
| 31 | + |
| 32 | +```text |
| 33 | +dustpkg add <name> <version> [--seed <u64>] |
| 34 | +``` |
| 35 | + |
| 36 | +Arguments: |
| 37 | + |
| 38 | +- `name`: dependency key. |
| 39 | +- `version`: dependency version string. |
| 40 | + |
| 41 | +Options: |
| 42 | + |
| 43 | +- `--seed <u64>`: deterministic seed for dependency ordering. |
| 44 | + |
| 45 | +Behavior: |
| 46 | + |
| 47 | +- Requires `Dust.toml` to already exist. |
| 48 | +- Updates `[dependencies]` in manifest. |
| 49 | +- Rewrites `dustpkg.lock` using `resolve`. |
| 50 | + |
| 51 | +## `update` |
| 52 | + |
| 53 | +Regenerate lockfile from current manifest. |
| 54 | + |
| 55 | +```text |
| 56 | +dustpkg update [--seed <u64>] |
| 57 | +``` |
| 58 | + |
| 59 | +Options: |
| 60 | + |
| 61 | +- `--seed <u64>`: deterministic seed for dependency ordering. |
| 62 | + |
| 63 | +Behavior: |
| 64 | + |
| 65 | +- Requires `Dust.toml`. |
| 66 | +- Does not change manifest. |
| 67 | +- Rewrites `dustpkg.lock`. |
| 68 | + |
| 69 | +## `build` |
| 70 | + |
| 71 | +Validate manifest and lockfile consistency. |
| 72 | + |
| 73 | +```text |
| 74 | +dustpkg build [--seed <u64>] |
| 75 | +``` |
| 76 | + |
| 77 | +Options: |
| 78 | + |
| 79 | +- `--seed <u64>`: if provided, lockfile is updated first with this seed. |
| 80 | + |
| 81 | +Behavior: |
| 82 | + |
| 83 | +- Requires `Dust.toml`. |
| 84 | +- Calls `update_lock` before validation. |
| 85 | +- Ensures each manifest dependency exists in lockfile with matching version. |
| 86 | +- Prints success on pass. |
| 87 | + |
| 88 | +## Current Exit/Failure Conditions |
| 89 | + |
| 90 | +Representative failures: |
| 91 | + |
| 92 | +- `Dust.toml not found in <cwd>` |
| 93 | +- `Dust.toml already exists in <dir>` |
| 94 | +- Parse/read/write failures with path context |
| 95 | +- `dependency '<name>' missing from lock file` |
| 96 | +- `version mismatch for dependency '<name>'` |
0 commit comments