Skip to content
Merged
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
24 changes: 10 additions & 14 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: "Setup Bun"
description: "Setup Bun with caching and install dependencies"
name: Setup
description: Install Bun, Node and dependencies

runs:
using: "composite"
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json

- name: Cache ~/.bun
id: cache-bun
uses: actions/cache@v4
# Tests run the CLI's TypeScript directly, which needs Node >= 22.18.
# Node 24 also ships the npm needed for trusted publishing.
- uses: actions/setup-node@v5
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('package.json') }}-${{ hashFiles('bun.lockb', 'bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('package.json') }}-
node-version: 24
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: bun install
- run: bun install --frozen-lockfile
shell: bash
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ name: CI

on:
push:
branches: [main, next]
branches: [main]
pull_request:
branches: [main, next]

jobs:
typecheck:
runs-on: ubuntu-latest
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: ./.github/actions/setup

- name: Lint check
run: bun run check:lint
- run: bun run lint
- run: bun run typecheck
- run: bun run test
- run: bun run build

- name: Type check
run: bun run check:types

- name: Build
run: bun run build

- name: Tests
run: bun run test
- name: Run the bundled CLI under Node
run: node dist/index.mjs --version
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
version: ${{ steps.release.outputs.version }}
tag: ${{ steps.release.outputs.tag }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
Expand All @@ -50,13 +50,11 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
ref: ${{ needs.release.outputs.tag }}

- uses: ./.github/actions/setup

- name: Publish to NPM
- name: Publish to npm
run: bun run scripts/publish.ts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ Thumbs.db
.vscode/
*.swp
*.swo

# Local scratch (test sandboxes)
.scratch/
38 changes: 22 additions & 16 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# AGENTS.md

Syncode is a Node.js/Bun TypeScript CLI that syncs AI agent configurations via adapter-based git + symlink/copy workflows.
syncode is a TypeScript CLI, published to npm, that links AI coding agents' instructions, skills and adopted config files from one git repo into each agent's config folder.

## Essentials
- Runtime: Node.js >=20
- Package manager: bun
- Non-standard commands:
- `bun run dev`
- `bun run build`
- `bun run typecheck`
## Commands

## More details
- `docs/agents/commands.md`
- `docs/agents/project-structure.md`
- `docs/agents/architecture.md`
- `docs/agents/code-style.md`
- `docs/agents/feature-development.md`
- `docs/agents/troubleshooting.md`
- `docs/agents/roadmap.md`
- Package manager: bun. Runtime: Node >= 22.12 for the published CLI, >= 22.18 to run from source.
- `bun run dev -- <command>`: run from source with Node's type stripping.
- `bun run check`: lint (Biome), typecheck (`tsc`), test (Vitest), build (tsdown). Run before pushing.

## Layout

- `src/index.ts`: argument parsing and command dispatch.
- `src/agents.ts`: the supported agents as data: config folder, instructions file, skills behavior. Adding an agent is one entry here, plus the README table.
- `src/plan.ts`: works out every link from the repo and enabled agents. `apply`, `status` and `unlink` all use it.
- `src/files.ts`: all filesystem changes, including conflict handling. Its dry-run mode is what makes `status` an exact preview of `apply`.
- `src/commands/`: one file per command group; `migrate.ts` upgrades 1.x setups.
- `tests/`: end-to-end tests that run the real CLI against a sandbox home under `.scratch/`.

## Conventions

- Only Node built-ins plus `@clack/prompts`. Prefer data over per-agent classes.
- Never prompt when stdin or stdout isn't a TTY; keep the local file and report it instead.
- Expected failures throw `UserError` (printed without a stack). No `require`: the bundle is ESM.
- Test through the CLI boundary in `tests/`. Don't export internals or add flags just for tests.
- Comments explain why, not what.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
44 changes: 9 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,20 @@
# Contributing to syncode

Thank you for your interest in contributing to syncode!
Thanks for helping out. Issues and pull requests are welcome at https://github.com/donnes/syncode.

## Development Setup
## Setup

This project requires Node.js ≥20 or Bun. Install dependencies with:
You need Bun and Node.js 22.18 or later.

```bash
bun install
bun run dev -- --help
```

## Development Workflow
## Before opening a pull request

- Run in dev mode: `bun run dev`
- Build for production: `bun run build`
- Type check: `bun run typecheck`
- Link globally: `bun link`

## Code Style

Follow the guidelines in [AGENTS.md](AGENTS.md). Key points:

- Use double quotes for strings
- ES module syntax (import/export)
- Prefer interfaces for shared shapes
- Async/await for shell calls
- Keep functions small and single-purpose

## Testing

No test framework is currently configured. If you add tests, update this section and document in AGENTS.md.

## Submitting Changes

1. Fork the repository
2. Create a feature branch
3. Make your changes following the code style
4. Test your changes
5. Submit a pull request with a clear description

## Reporting Issues

Report issues at https://github.com/anomalyco/opencode/issues
```bash
bun run check # lint, typecheck, test, build
```

For questions, use the help command: `syncode help`
[AGENTS.md](AGENTS.md) describes the layout and conventions. To support a new agent, add an entry to `src/agents.ts` and the README table, with a link to the docs showing where it reads instructions and skills.
Loading
Loading