This repository was archived by the owner on May 4, 2026. It is now read-only.
feat(cli): document CLI plugin system and leo-fmt as plugin#588
Merged
Conversation
Add new plugins documentation page covering the `leo plugins` command, plugin dispatch mechanism, available plugins, installation, and custom plugin authoring. Update `leo fmt` docs to reflect its migration from a built-in command to an external plugin binary. Update installation instructions across all methods (cargo, pre-built, source) to include `leo-fmt`. Add notes where plugin distribution details are subject to change per ProvableHQ/leo#29355.
Collaborator
|
Thanks! Will wait until after 4.0.2 docs are published before merging this. |
mohammadfawaz
pushed a commit
to ProvableHQ/leo
that referenced
this pull request
May 1, 2026
mohammadfawaz
added a commit
to ProvableHQ/leo
that referenced
this pull request
May 2, 2026
* Migrate the docs
* Format md files and add rule yml
* code blocks to code snippets
* Add README.md
* Migrate documentation snippets to compilable Leo files
Every Leo snippet referenced from the docs lives under
documentation/code_snippets/ as a real Leo project (program.json +
src/main.leo). Markdown imports snippets via ```leo file=...[#anchor]```,
supported by a small remark plugin (lives in leo-docs). CI runs
`leo build` on every snippet via the `build-doc-code-snippets` job, so
the docs cannot drift from the language.
Two generated artifacts are intentionally tracked alongside their
sources so the docs can import them directly:
- `documentation/code_snippets/abi/token/build/abi.json` — used by the
ABI guide.
- `documentation/code_snippets/limitations/build/main.aleo` — used by
the conditional-on-chain-code section.
Both are refreshed automatically on every `leo build`. The .gitignore
ignores `build/` contents in general but un-ignores those two files.
Also tightens `.markdownlint.yaml` and runs `markdownlint --fix` across
the migrated docs; lint is strict in CI via the `docs-lint` job (uses
`npx --yes` so the `cimg/node:22.10` image doesn't need writable global
node_modules).
Doc bugs caught and fixed in the process:
- `Aleo::generator` / `Aleo::generator_powers`: docs showed bare access
but the actual API is a function call.
- `Aleo::generator_powers` was claimed to be only available inside
`final {}` blocks; it works in regular fns too.
- Cross-program operator name: `Program::owner` → `Program::program_owner`.
- Cross-program checksum type annotation: `[u8, 32]` typo → `[u8; 32]`.
- Pedersen64 hash inputs documented as `2i64` / `1field`, but the
operator only accepts integers smaller than 64 bits or `bool`.
- Pedersen128 inputs documented as `field`; it accepts integers up to
64 bits or `bool`.
- Pedersen64 commit example used `1u64` for the input, exceeding the
<64-bit constraint.
- Keccak / SHA3 `hash_to_bits` examples used `0field`, but the input
must have a size in bits that is a multiple of 8.
- ECDSA `verify_*` examples typed `sig: signature, addr: address`, but
the actual API takes `[u8; 65]` and `[u8; 33]` (or `[u8; 20]` for the
`_eth` variants).
- Cheatsheet referred to `record User` without defining it; only
`record Token` was declared.
- Cheatsheet `let g: group = 1group` was an invalid group literal.
- Cheatsheet `a ** b` (u64 ** u64) and `a << b` (u64 << u64) — exponent
must be u8, shift amount must be u32.
- Cheatsheet `Serialize::to_bits(value: u64)` annotated `[bool; 58]`;
actual return is `[bool; 90]`.
- Cheatsheet operators block mixed off-chain context expressions
(`self.address/caller/signer`) with on-chain ones (`block.*`,
`self.checksum/edition/program_owner`); they don't share a context.
- private_storage page mislabeled a Leo `record Token` block as
`aleo`; pointed it at the existing `data_types#token_record` anchor.
- limitations page inlined the `weird_sub` Aleo bytecode; switched to
importing the actual `build/main.aleo` so it cannot drift.
- ABI guide inlined a hand-written `token.aleo` ABI that had stale
field names (`has_final`, `program: "token"`); switched to importing
the actual `build/abi.json`.
- data_types: example showed tuples as struct/record fields — Leo
doesn't allow it.
- migration-3-5-to-4-0 / function_to_fn: helper named `add` clashed
with the `add` opcode keyword (renamed to `sum`).
* migrate ProvableHQ/leo-docs-source#588
---------
Co-authored-by: Mohammad Fawaz <mohammadfawaz@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new plugins documentation page covering the
leo pluginscommand, plugin dispatch mechanism, available plugins, installation, and custom plugin authoring.Update
leo fmtdocs to reflect its migration from a built-in command to an external plugin binary.Update installation instructions across all methods (cargo, pre-built, source) to include
leo-fmt.Add notes where plugin distribution details are subject to change per ProvableHQ/leo#29355.