Skip to content

feat: build knot CLI + Knotfile ecosystem + CI/CD pipeline#3

Merged
oxGrad merged 1 commit intomainfrom
claude/build-knot-cli-fgywP
Mar 31, 2026
Merged

feat: build knot CLI + Knotfile ecosystem + CI/CD pipeline#3
oxGrad merged 1 commit intomainfrom
claude/build-knot-cli-fgywP

Conversation

@oxGrad
Copy link
Copy Markdown
Owner

@oxGrad oxGrad commented Mar 31, 2026

Summary

  • Full CLItie, untie, status, plan, validate commands built on a Plan/Apply symlink engine
  • Knotfile — config renamed from knot.yml to Knotfile (no extension, YAML syntax, upward auto-discovery)
  • Editor ecosystem — JSON Schema, Neovim plugin with 🪢 devicon, YAML language server integration
  • CI/CD — GitHub Actions for PR checks, GoReleaser for semver releases, Homebrew tap distribution, Dependabot

Changes

CLI (cmd/, internal/)

  • knot tie [pkg] --all — create symlinks; --dry-run previews without writing
  • knot untie [pkg] — remove symlinks
  • knot status — per-file state: [OK] / [MISSING] / [CONFLICT] / [BROKEN]
  • knot plan [pkg] --all — dry-run with +/=/! prefix and counts summary
  • knot validate — validates Knotfile with exit codes 0 ok / 1 errors / 2 warnings; checks required fields, source dir existence, condition.os enum, and glob pattern syntax
  • Global --config and --dry-run flags on every command
  • 30 unit tests across config, resolver, linker covering happy paths, conflicts, broken symlinks, dry-run, conditions, ignore patterns, and edge cases

Knotfile rename

knot.ymlKnotfile in FindConfigFile(), error messages, flag help text, and all test fixtures.

JSON Schema (schema/knotfile.schema.json)

Draft-07 schema — full field descriptions, enum on condition.os, additionalProperties: false, $id pointing to raw GitHub URL for universal editor integration.

Neovim plugin (editors/neovim/)

File Purpose
ftdetect/knotfile.vim Exact filename match → filetype=knotfile
syntax/knotfile.vim YAML base + colored groups for Knotfile keywords and OS values
after/ftplugin/knotfile.vim tabstop=2, commentstring=# %s
lua/knot/init.lua setup(): filetype, 🪢 devicon, treesitter yaml override, auto yamlls schema push
README.md lazy.nvim (main = "knot"), packer.nvim, and manual install guides

YAML LS integration (editors/yaml-language-server/)

  • settings.json — VS Code workspace snippet
  • README.md — 4 integration methods: inline modeline, nvim-lspconfig, VS Code, global settings

CI/CD

  • .github/workflows/ci.ymlTest, Build, Lint jobs on every PR to main
  • .github/workflows/release.yml — GoReleaser on v*.*.* tags; builds binaries, creates GitHub Release, pushes knot.rb to oxGrad/homebrew-tap
  • .github/dependabot.yml — weekly PRs for gomod and github-actions
  • .goreleaser.yamllinux/darwin/windows × amd64/arm64 (no windows/arm64), tar.gz/zip, checksums.txt, Homebrew formula

README (README.md)

Installation leading with brew install oxGrad/tap/knot, full CLI reference, Knotfile format table, editor integration pointers, release workflow docs.


Test plan

  • go build ./... compiles cleanly
  • go test ./... — 30 tests pass
  • knot --help shows all 6 commands
  • Enable branch protection on main: Settings → Branches → require status checks Test, Build, Lint
  • Add secret: HOMEBREW_TAP_GITHUB_TOKEN — PAT with contents: write on oxGrad/homebrew-tap
  • Create tap repo oxGrad/homebrew-tap if it doesn't exist yet
  • Push v0.1.0 tag → verify GitHub Release and Homebrew formula are created
  • brew install oxGrad/tap/knotknot --help works

GitHub Actions:
- .github/workflows/ci.yml: three separate jobs (test, build, lint) on
  every PR to main; uses golangci-lint-action@v6 for linting. Requires
  all three to pass before merge (configure branch protection manually:
  Settings → Branches → require status checks: Test, Build, Lint).
- .github/workflows/release.yml: triggered on semver tags (v*.*.*);
  runs GoReleaser with full git history for changelog generation and
  pushes a Homebrew formula to oxGrad/homebrew-tap via
  HOMEBREW_TAP_GITHUB_TOKEN secret.

Dependabot (.github/dependabot.yml):
- Weekly updates for gomod dependencies (prefix: chore(deps))
- Weekly updates for GitHub Actions pins (prefix: chore(ci))

GoReleaser (.goreleaser.yaml):
- Builds for linux/darwin/windows × amd64/arm64 (excluding windows/arm64)
- tar.gz archives (zip for Windows) + checksums.txt
- Pushes knot.rb formula to oxGrad/homebrew-tap on each release

README.md:
- Installation section leading with `brew install oxGrad/tap/knot`
- Release binary download and `go install` alternatives
- Full CLI reference for all 6 commands
- Knotfile format reference table
- Editor integration pointers
- Releasing section documenting the semver tag workflow

https://claude.ai/code/session_018s5iF8MKZAobUjAuR1AHJ4
@oxGrad oxGrad merged commit a7bf42d into main Mar 31, 2026
3 checks passed
@oxGrad oxGrad deleted the claude/build-knot-cli-fgywP branch March 31, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants