Skip to content

Commit 184ed0c

Browse files
docs: align identity command reference
1 parent 4f1f830 commit 184ed0c

4 files changed

Lines changed: 57 additions & 6 deletions

File tree

docs/cli/identity-commands.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,24 @@ title: Identity Commands
1111
# Create with default path
1212
modal id create --path alice.passfile
1313

14-
# Create with password protection
15-
modal id create --path alice.passfile --password
14+
# Create with passfile encryption
15+
modal id create --path alice.passfile --encrypt
16+
17+
# Create in the standard passfile directory
18+
modal id create --name alice
1619
```
1720

21+
`modal id create` writes a passfile. Use `--path <PATH>` for an explicit
22+
location, `--dir <DIR>` for an output directory, or `--name <NAME>` for the
23+
standard `~/.modality/<name>.mod_passfile` location.
24+
1825
## Derive Sub-Identity
1926

2027
```bash
21-
modal id derive --path alice.passfile --sub "escrow-key" --output alice-escrow.passfile
28+
modal id derive --mnemonic "abandon abandon ..." --path alice-escrow.passfile
2229
```
2330

24-
Derives a deterministic sub-key from your main identity. Useful for:
31+
Derives a keypair from a BIP39 mnemonic seed phrase. Useful for:
2532
- Contract-specific keys
2633
- Rotating access keys
2734
- Hierarchical key management
@@ -38,13 +45,13 @@ modal id get --path alice.passfile
3845
### Encrypt a Passfile
3946

4047
```bash
41-
modal passfile encrypt --path alice.passfile --password
48+
modal passfile encrypt --path alice.passfile
4249
```
4350

4451
### Decrypt a Passfile
4552

4653
```bash
47-
modal passfile decrypt --path alice.passfile.enc --password
54+
modal passfile decrypt --path alice.passfile
4855
```
4956

5057
## Best Practices

tests/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ keeps the `modal` contract CLI and `modality` model CLI split explicit, checks
1919
that the CLI overview keeps the lean onboarding wrapper separate from full
2020
runtime command groups, checks that the contract command reference preserves the
2121
current `create`, `checkout`, `set`, and `set-named-id` help shapes, checks
22+
that the identity command reference preserves the current passfile creation,
23+
mnemonic derivation, and encrypt/decrypt flag shapes, checks
2224
that older tutorials still use the current
2325
`set-named-id <path> <passfile>` and `commit --sign <passfile>` shapes, checks
2426
that the real `modality` model help surface matches the documented language CLI
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
DOC="$ROOT_DIR/docs/cli/identity-commands.md"
6+
7+
required_patterns=(
8+
"# Identity Commands (\`modal id\`)"
9+
"modal id create --path alice.passfile"
10+
"modal id create --path alice.passfile --encrypt"
11+
"modal id create --name alice"
12+
"\`--path <PATH>\`"
13+
"\`--dir <DIR>\`"
14+
"\`--name <NAME>\`"
15+
"modal id derive --mnemonic"
16+
"BIP39 mnemonic seed phrase"
17+
"modal id get --path alice.passfile"
18+
"modal passfile encrypt --path alice.passfile"
19+
"modal passfile decrypt --path alice.passfile"
20+
)
21+
22+
for pattern in "${required_patterns[@]}"; do
23+
if ! grep -Fq -- "$pattern" "$DOC"; then
24+
echo "identity command reference is missing current help-surface text: $pattern" >&2
25+
exit 1
26+
fi
27+
done
28+
29+
for forbidden_pattern in \
30+
"modal id create --path alice.passfile --password" \
31+
"modal id derive --path alice.passfile --sub" \
32+
"--output alice-escrow.passfile" \
33+
"modal passfile encrypt --path alice.passfile --password" \
34+
"modal passfile decrypt --path alice.passfile.enc --password"; do
35+
if grep -Fq -- "$forbidden_pattern" "$DOC"; then
36+
echo "identity command reference still contains stale help-surface text: $forbidden_pattern" >&2
37+
exit 1
38+
fi
39+
done
40+
41+
echo "identity command doc check passed"

tests/run-onboarding-smokes.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ fi
8686
"$ROOT_DIR/tests/docs/check-installation-doc.sh"
8787
"$ROOT_DIR/tests/docs/check-cli-index-doc.sh"
8888
"$ROOT_DIR/tests/docs/check-cli-contract-doc.sh"
89+
"$ROOT_DIR/tests/docs/check-cli-identity-doc.sh"
8990
"$ROOT_DIR/tests/docs/check-cli-tutorials-doc.sh"
9091
"$ROOT_DIR/tests/docs/check-first-contract-doc.sh"
9192
"$ROOT_DIR/tests/docs/check-verifier-rejections-doc.sh"

0 commit comments

Comments
 (0)