Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 74 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "A zero-terminal, real-time sync engine powered by your own Cloudflare Worker.",
"main": "main.js",
"type": "module",
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
Expand Down
55 changes: 55 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# YAOS CLI

Headless YAOS client for mirroring a Markdown vault directory to the YAOS CRDT room.

## Commands

```bash
yaos-cli daemon --host <url> --token <token> --vault-id <id> --dir <path>
yaos-cli sync --host <url> --token <token> --vault-id <id> --dir <path>
yaos-cli status --host <url> --token <token> --vault-id <id>
```

- `daemon` performs startup reconciliation, starts the filesystem watcher, and stays running.
- `sync` performs one reconciliation pass and exits.
- `status` connects to YAOS and prints current connection/cache state as JSON.

## Configuration precedence

1. CLI flags
2. Environment variables
3. `~/.config/yaos/cli.json` (or `$XDG_CONFIG_HOME/yaos/cli.json`)

## Environment variables

- `YAOS_HOST`
- `YAOS_TOKEN`
- `YAOS_VAULT_ID`
- `YAOS_DIR`
- `YAOS_DEVICE_NAME`
- `YAOS_DEBUG`
- `YAOS_EXCLUDE_PATTERNS`
- `YAOS_MAX_FILE_SIZE_KB`
- `YAOS_EXTERNAL_EDIT_POLICY`
- `YAOS_FRONTMATTER_GUARD`
- `YAOS_CONFIG_DIR`

## Config file example

```json
{
"host": "https://sync.example.com",
"token": "...",
"vaultId": "vault-123",
"dir": "/srv/vault",
"deviceName": "n100-headless",
"debug": false,
"excludePatterns": "templates/,scratch/",
"maxFileSizeKB": 2048,
"externalEditPolicy": "always",
"frontmatterGuardEnabled": true,
"configDir": ".obsidian"
}
```

Use file mode `0600` if you store the token in this file.
25 changes: 25 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@yaos/cli",
"version": "0.0.0",
"private": true,
"type": "module",
"bin": {
"yaos-cli": "dist/index.cjs"
},
"scripts": {
"build": "esbuild src/index.ts --bundle --platform=node --format=cjs --outfile=dist/index.cjs",
"typecheck": "tsc --noEmit -p tsconfig.json",
"test": "node --import jiti/register --test tests/*.ts"
},
"dependencies": {
"chokidar": "^5.0.0",
"commander": "^14.0.0",
"ws": "^8.18.2"
},
"devDependencies": {
"@types/node": "^16.11.6",
"@types/ws": "^8.18.0",
"esbuild": "0.25.5",
"typescript": "^5.8.3"
}
}
Loading