Skip to content
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
mitchmindtree merged 1 commit into
masterfrom
mitchmindtree/plugins
Apr 27, 2026
Merged

feat(cli): document CLI plugin system and leo-fmt as plugin#588
mitchmindtree merged 1 commit into
masterfrom
mitchmindtree/plugins

Conversation

@mitchmindtree

Copy link
Copy Markdown
Contributor

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.

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.
@mitchmindtree mitchmindtree self-assigned this Apr 21, 2026
@mitchmindtree mitchmindtree marked this pull request as ready for review April 21, 2026 07:28
@mitchmindtree mitchmindtree requested review from a team and AleoAlexander April 21, 2026 07:28
@mohammadfawaz

Copy link
Copy Markdown
Collaborator

Thanks! Will wait until after 4.0.2 docs are published before merging this.

@mohammadfawaz mohammadfawaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JoshuaBatty JoshuaBatty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@mitchmindtree mitchmindtree merged commit 54c4d15 into master Apr 27, 2026
2 checks passed
@mitchmindtree mitchmindtree deleted the mitchmindtree/plugins branch April 27, 2026 04:54
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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants