Extensions
An extension adds commands to crc. It is WebAssembly, run by crc’s own interpreter in a sandbox, and it can do only what its manifest declares and you agreed to at install. No extension can read your files, reach the network or start programs. How and why is in the extensions design; every official extension is listed on the Extensions page.
The Extensions panel
Section titled “The Extensions panel”The Extensions icon in the strip at the left, or Extensions > Extensions… (⌘⇧X), lists what is installed and what the official registry offers in the sidebar. Pick one and its details take the editor column: what it does, what it may touch, its commands and its README. Esc or a tab gives the column back; the list stays.
- Install shows exactly what the extension will be able to do and waits for your yes.
- Disable keeps it installed with its commands gone; Enable brings them back.
- Uninstall removes it.
- Update appears when the registry has a newer version. Updates are never installed on their own.
Running commands
Section titled “Running commands”An extension’s commands are in the Extensions menu and in the palette
(⌘P, then >). A command works on the selection, or
on the whole document when nothing is selected, if the extension may read
it. The result replaces the text as one undo step, and only if the document
has not changed while the extension ran. A command that runs too long is
stopped.
What an extension may do
Section titled “What an extension may do”| Capability | Lets it |
|---|---|
| Read the selected text | see the selection |
| Replace the selected text | change the selection |
| Read the whole document | see the whole document |
| Replace the whole document | change the whole document |
That is the whole list today. There is no capability for files, the network or other programs.
Signed and unsigned
Section titled “Signed and unsigned”Extensions from the official registry are built from source in CI and signed; crc checks the signature against a key built into the app before trusting the list, and each module’s checksum before installing it.
Install from Folder… installs an extension you have on disk: one you are writing, or one published somewhere else. It is unsigned, crc says so before installing, and the page marks it.
Official extensions
Section titled “Official extensions”| Extension | Commands | May |
|---|---|---|
| Sort Lines | Sort Lines, Sort Lines Descending, Remove Duplicate Lines | read and replace the selection or the document |
The source is in crc-extensions. To make your own, see Writing an extension.
Where they live
Section titled “Where they live”~/Library/Application Support/crc/extensions/, one folder per extension.
Never inside a project, so cloning a repository cannot install code.