@apisurf/canon
v0.2.1
Published
canon — author documents as ordered blocks in a local SQLite file, from the command line.
Maintainers
Readme
@apisurf/canon
The canon command: author documents — ordered lists of blocks — in one local
SQLite file.
npm i -g @apisurf/canon
canon helpEvery command here is about one record — create it, read it, change it, move it,
delete it — and every one of them is something an agent does. Turning the result
into a website is the other half of the pair,
@apisurf/canonui, which ships separately so that nothing an agent needs
drags a static site generator along with it:
npm i -g @apisurf/canonui
canonui build retry-guideEverything is documented in the CLI itself — canon help, then canon help <command>
— and in the repository README.
What is in here
| File | What it is |
| ------------ | ------------------------------------------------------------ |
| bin.ts | Argument parsing and dispatch. One parser per command shape |
| help.ts | Every help page. One screen each, never a wall of everything |
| howto.ts | Worked examples: whole tasks, start to finish |
| read.ts | get and ls — projected reads, bounded by default |
| write.ts | new, set, rm, mv — one store call each |
| cat.ts | A document, as one markdown document |
| find.ts | Full-text search over every block |
| refs.ts | Turning --document retry-guide into the id a column holds |
| content.ts | Where a block's body comes from: inline, a file, or stdin |
| format.ts | Tables, CSV and JSON for the terminal |
| version.ts | The build's version, and the schema it expects |
The schema, the store and the entity definitions live in @canon/db. The
markdown cat prints, and the dates every command spells, live in
@canon/core — shared with the theme in @apisurf/canonui, which serves the
same documents at /index.md. Both are workspace packages bundled into
dist/bin.js at build time.
