anytype-gh is an interactive CLI that syncs a GitHub repository README.md
(including private repos) into an Anytype page.
- lists repositories visible to your GitHub token (archived repositories are skipped)
- fetches the selected repository README from GitHub
- creates, updates, or recreates an Anytype page for that README
- persists local state so repeated runs are idempotent (SHA-based skip/update)
- Go 1.26+
- Anytype desktop app installed and running
- GitHub token with access to your target repos (
GH_TOKEN)
Create a token at https://github.com/settings/personal-access-tokens with permission to read repositories.
go install github.com/alesr/anytype-gh/cmd/anytype-gh@latestanytype-gh-darwin-arm64(Apple Silicon)anytype-gh-darwin-amd64(Intel)
Download the right asset for your Mac, then:
chmod +x anytype-gh-darwin-<arch>
mv anytype-gh-darwin-<arch> anytype-gh
xattr -d com.apple.quarantine ./anytype-gh
./anytype-ghThe CLI supports two configuration files:
~/.config/anytype-gh/config.yaml(created automatically on first run ifGH_TOKENis missing).env.local(optional fallback)
config.yaml format:
github:
token: github_pat_xxx
anytype:
base_url: http://localhost:31009 # optional.env.local format:
GH_TOKEN=github_pat_xxx
ANYTYPE_BASE_URL=http://localhost:31009 # optionalConfiguration precedence:
- process environment variables (highest priority)
config.yamlvalues.env.localfile values as fallback
.env.local lookup order:
- current working directory
~/.config/anytype-gh/.env.local- executable directory
State is persisted at ~/.config/anytype-gh/state.json with restrictive file
permissions (0600).
Run the interactive CLI:
anytype-ghFirst, authenticate (Anytype app must be running). Then choose the repository you want to fetch the README from, and sync it with Anytype to create or update a page with the README content.
For the selected repository:
- target page title is
README - <owner>/<repo> - if README SHA is unchanged and mapping exists, sync is skipped
- if SHA changed, existing page is updated
- if mapped object no longer exists, page is recreated
- state is updated with object ID, SHA, sync timestamp, and space ID