AnyBlock

AnyBlock is Anytype's open interchange project. It contains both generations of the format, the codecs between them, bundle tooling, and conformance data.

Start here

You have an export and want to read it.format/v2/READING.md — nine steps from a directory of JSON to titles, property values, links and page text, needing no Anytype software and nothing from this repository. It is runnable; the reader is one standard-library Go program that imports no part of this module:

go run ./format/v2/examples/reader ./format/v2/examples/exported_space
go run ./format/v2/examples/reader /path/to/your/export <object-id>
you want to go to
read an export format/v2/READING.md
parse the text inside a block format/v2/INLINE_MARKUP.md
write a bundle by hand format/v2/examples/habit_tracker, then SPEC §2g
check a bundle you produced go run ./cmd/anyblock validate <dir>
know why the format is shaped this way format/v2/README.md
look a rule up, normatively format/v2/SPEC.md
convert v1 snapshots in Go codec/anyblockjson

Repository layout

format/v1/           v1 protobuf sources, generated Go bindings, conformance data
format/v2/           v2 specification, JSON schemas, examples, conformance data
codec/anyblockjson/  Go codec between v1 snapshots and v2 documents
bundle/              v2 bundle validation and composition
cmd/anyblock/        command-line validation and conversion tools
js/                  future JavaScript/Wasm packages

A caller imports the two together — v1 types in, AnyBlock JSON out:

import (
	"github.com/anyproto/any-block/codec/anyblockjson"
	v1 "github.com/anyproto/any-block/format/v1/model"
)

format/v1 and format/v2 own the wire/JSON format artifacts, codec/anyblockjson is the Go conversion API, and bundle and cmd/anyblock provide the bundle and command-line surfaces. Options.TableColumnHeaders remains opt-in so backup output is stable.

For the v1 side, start with format/v1/README.md. The normative v2 definition is format/v2/SPEC.md; it is long, and reading an export does not require it.

Development

go test ./...
go vet ./...
go generate ./codec/anyblockjson ./format/v1

The format and codec READMEs list the pinned generator installation commands used by CI.

Fixture and corpus rules for contributors are in FIXTURE_POLICY.md.

Contribution

Thank you for your desire to develop Anytype together!

❤️ This project and everyone involved in it is governed by the Code of Conduct.

🧑‍💻 Check out our contributing guide to learn about asking questions, creating issues, or submitting pull requests.

🫢 For security findings, please email security@anytype.io and refer to our security guide for more information.

🤝 Follow us on Github and join the Contributors Community.

Made by Any — a Swiss association 🇨🇭

Licensed under MIT.