Skip to content

alesr/anytype-gh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anytype-gh

Go Report Card Go Reference codecov

anytype-gh is an interactive CLI that syncs a GitHub repository README.md (including private repos) into an Anytype page.

What it does

  • 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)

Requirements

  • 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.

Install

go install github.com/alesr/anytype-gh/cmd/anytype-gh@latest

macOS prebuilt binaries

  • anytype-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-gh

Configuration

The CLI supports two configuration files:

  • ~/.config/anytype-gh/config.yaml (created automatically on first run if GH_TOKEN is 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 # optional

Configuration precedence:

  • process environment variables (highest priority)
  • config.yaml values
  • .env.local file values as fallback

.env.local lookup order:

  1. current working directory
  2. ~/.config/anytype-gh/.env.local
  3. executable directory

State is persisted at ~/.config/anytype-gh/state.json with restrictive file permissions (0600).

Run

Run the interactive CLI:

anytype-gh

First, 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.

Sync behavior

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

About

CLI for creating Anytype pages from GitHub READMEs

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors