feat: build knot CLI + Knotfile ecosystem + CI/CD pipeline#3
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tie,untie,status,plan,validatecommands built on a Plan/Apply symlink engineknot.ymltoKnotfile(no extension, YAML syntax, upward auto-discovery)Changes
CLI (
cmd/,internal/)knot tie [pkg] --all— create symlinks;--dry-runpreviews without writingknot untie [pkg]— remove symlinksknot status— per-file state:[OK]/[MISSING]/[CONFLICT]/[BROKEN]knot plan [pkg] --all— dry-run with+/=/!prefix and counts summaryknot validate— validates Knotfile with exit codes0ok /1errors /2warnings; checks required fields, source dir existence,condition.osenum, and glob pattern syntax--configand--dry-runflags on every commandconfig,resolver,linkercovering happy paths, conflicts, broken symlinks, dry-run, conditions, ignore patterns, and edge casesKnotfile rename
knot.yml→KnotfileinFindConfigFile(), error messages, flag help text, and all test fixtures.JSON Schema (
schema/knotfile.schema.json)Draft-07 schema — full field descriptions,
enumoncondition.os,additionalProperties: false,$idpointing to raw GitHub URL for universal editor integration.Neovim plugin (
editors/neovim/)ftdetect/knotfile.vimfiletype=knotfilesyntax/knotfile.vimafter/ftplugin/knotfile.vimtabstop=2,commentstring=# %slua/knot/init.luasetup(): filetype, 🪢 devicon, treesitter yaml override, auto yamlls schema pushREADME.mdmain = "knot"), packer.nvim, and manual install guidesYAML LS integration (
editors/yaml-language-server/)settings.json— VS Code workspace snippetREADME.md— 4 integration methods: inline modeline, nvim-lspconfig, VS Code, global settingsCI/CD
.github/workflows/ci.yml—Test,Build,Lintjobs on every PR tomain.github/workflows/release.yml— GoReleaser onv*.*.*tags; builds binaries, creates GitHub Release, pushesknot.rbtooxGrad/homebrew-tap.github/dependabot.yml— weekly PRs forgomodandgithub-actions.goreleaser.yaml—linux/darwin/windows × amd64/arm64(nowindows/arm64),tar.gz/zip,checksums.txt, Homebrew formulaREADME (
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 cleanlygo test ./...— 30 tests passknot --helpshows all 6 commandsmain: Settings → Branches → require status checksTest,Build,LintHOMEBREW_TAP_GITHUB_TOKEN— PAT withcontents: writeonoxGrad/homebrew-tapoxGrad/homebrew-tapif it doesn't exist yetv0.1.0tag → verify GitHub Release and Homebrew formula are createdbrew install oxGrad/tap/knot→knot --helpworks