{"id":13409717,"url":"https://github.com/joerdav/xc","last_synced_at":"2025-05-14T18:03:15.340Z","repository":{"id":37466888,"uuid":"417434485","full_name":"joerdav/xc","owner":"joerdav","description":"Markdown defined task runner.","archived":false,"fork":false,"pushed_at":"2025-05-06T09:20:06.000Z","size":1981,"stargazers_count":1275,"open_issues_count":12,"forks_count":28,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-06T10:32:59.170Z","etag":null,"topics":["build-tool","documentation","go","golang","task-runner"],"latest_commit_sha":null,"homepage":"https://xcfile.dev/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joerdav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-15T09:00:29.000Z","updated_at":"2025-05-06T09:20:10.000Z","dependencies_parsed_at":"2023-02-14T07:16:14.013Z","dependency_job_id":"a19f75a6-24a5-48d4-9077-a07b1058b4db","html_url":"https://github.com/joerdav/xc","commit_stats":null,"previous_names":["joe-davidson1802/xc"],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joerdav%2Fxc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joerdav%2Fxc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joerdav%2Fxc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joerdav%2Fxc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joerdav","download_url":"https://codeload.github.com/joerdav/xc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198452,"owners_count":22030964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","documentation","go","golang","task-runner"],"created_at":"2024-07-30T20:01:02.965Z","updated_at":"2025-05-14T18:03:10.332Z","avatar_url":"https://github.com/joerdav.png","language":"Go","readme":"# xc - Simple, Convenient, Markdown-based task runner.\n\n\u003cdiv align=\"center\"\u003e\n\n![xc](https://user-images.githubusercontent.com/19927761/156772881-10065864-ff4d-4225-ab2b-5adbbe628845.png)\n[Docs](https://xcfile.dev/) | [Getting Started](https://xcfile.dev/getting-started/) | [GitHub](https://github.com/joerdav/xc)\n\n[![xc compatible](https://xcfile.dev/badge.svg)](https://xcfile.dev)\n[![test](https://github.com/joerdav/xc/actions/workflows/test.yaml/badge.svg)](https://github.com/joerdav/xc/actions/workflows/test.yaml) \n[![docs](https://github.com/joerdav/xc/actions/workflows/docs.yml/badge.svg)](https://github.com/joerdav/xc/actions/workflows/docs.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/joerdav/xc.svg)](https://pkg.go.dev/github.com/joerdav/xc)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/joerdav/xc)](https://goreportcard.com/report/github.com/joerdav/xc)\n[![Coverage Status](https://coveralls.io/repos/github/joerdav/xc/badge.svg?branch=main)](https://coveralls.io/github/joerdav/xc?branch=main)\n\n\u003c/div\u003e\n\n`xc` is a task runner similar to `Make` or `npm run`, that aims to be more discoverable and approachable.\n\nThe problem `xc` is intended to solve is scripts maintained separately from their documentation.\nOften a `Makefile` or a `package.json` will contain some useful scripts for developing on a project,\nthen the `README.md` will surface and describe these scripts.\nIn such a case, since the documentation is separate, it may not be updated when scripts are changed or added.\n`xc` aims to solve this by defining the scripts [inline with the documentation](https://en.wikipedia.org/wiki/Literate_programming).\n\n`xc` is designed to maximise convenience, and minimise complexity.\nEach `xc` task is defined in simple, human-readable Markdown.\nThis means that even people without the `xc` tool installed can use the README.md\n(or whatever Markdown file contains the tasks)\nas a source of useful commands for the project.\n\n# Installation\n\nInstallation instructions are described at \u003chttps://xcfile.dev/getting-started/#installation\u003e.\n\n# Features\n\n- Tasks defined in Markdown files as code blocks.\n- Editor integration:\n\t- [VSCode](https://marketplace.visualstudio.com/items?itemName=xc-vscode.xc-vscode) (list and run `xc` tasks)\n\t  ![vscode demo](https://user-images.githubusercontent.com/19927761/214538057-963f9a47-ff95-486c-8856-b90bd358be3f.png)\n\t- [Vim](https://xcfile.dev/ide-support/#vim) (recommended config for listing and running `xc` tasks)\n\n# Example\n\nTake the `tag` task in the [README.md](https://github.com/joerdav/xc#tag) of the `xc` repository:\n\n````\n## tag\n\nDeploys a new tag for the repo.\n\nRequires: test\n\n```\nexport VERSION=`git rev-list --count HEAD`\necho Adding git tag with version v0.0.${VERSION}\ngit tag v0.0.${VERSION}\ngit push origin v0.0.${VERSION}\n```\n````\n\nThe task could be run simply with `xc tag`, but a side-effect of it being an `xc` task is that the steps for pushing a tag without the use of `xc` are clearly documented too.\n\n```\n$ xc tag\n+ go test ./...\n?       github.com/joerdav/xc/cmd/xc   [no test files]\n?       github.com/joerdav/xc/models   [no test files]\nok      github.com/joerdav/xc/parser   (cached)\nok      github.com/joerdav/xc/run      (cached)\n+ export VERSION=78\n+ echo Adding git tag with version v0.0.78\nAdding git tag with version v0.0.78\n+ git tag v0.0.78\n+ git push origin v0.0.78 Total 0 (delta 0), reused 0 (delta 0), pack-reused 0\nTo github.com:joerdav/xc\n * [new tag]         v0.0.78 -\u003e v0.0.78\n```\n\n# Tasks\n\n## test\n\nTest the project.\n\n```\ngo test ./...\n```\n\n## lint\n\nRun linters.\n\n```\ngolangci-lint run\n```\n\n## build\n\nBuilds the `xc` binary.\n\n```\ngo build ./cmd/xc\n```\n\n## tag\n\nDeploys a new tag for the repo.\n\nSpecify major/minor/patch with VERSION\n\nInputs: VERSION\n\nRequires: test\n\n```\n# https://github.com/unegma/bash-functions/blob/main/update.sh\n\nCURRENT_VERSION=`git describe --abbrev=0 --tags 2\u003e/dev/null`\nCURRENT_VERSION_PARTS=(${CURRENT_VERSION//./ })\nVNUM1=${CURRENT_VERSION_PARTS[0]}\nVNUM2=${CURRENT_VERSION_PARTS[1]}\nVNUM3=${CURRENT_VERSION_PARTS[2]}\n\nif [[ $VERSION == 'major' ]]\nthen\n  VNUM1=$((VNUM1+1))\n  VNUM2=0\n  VNUM3=0\nelif [[ $VERSION == 'minor' ]]\nthen\n  VNUM2=$((VNUM2+1))\n  VNUM3=0\nelif [[ $VERSION == 'patch' ]]\nthen\n  VNUM3=$((VNUM3+1))\nelse\n  echo \"Invalid version\"\n  exit 1\nfi\n\nNEW_TAG=\"$VNUM1.$VNUM2.$VNUM3\"\n\necho Adding git tag with version ${NEW_TAG}\ngit tag ${NEW_TAG}\ngit push origin ${NEW_TAG}\n```\n\n## update-nix\nUpdates nix flake.\n```\nsh ./update-nix.sh\n```\n\n## install-hugo\n\nInstall hugo via `go install`.\n\n```sh\ngo install github.com/gohugoio/hugo@latest\n```\n\n## run-docs\n\nRun the hugo development server.\n\nDirectory: doc\n\n```sh\nhugo serve\n```\n\n## build-docs\n\nBuild production docs site.\n\nDirectory: doc\n\n```sh\n./build.sh\n```\n","funding_links":[],"categories":["Build Automation","Go","golang","构建自动化"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoerdav%2Fxc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoerdav%2Fxc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoerdav%2Fxc/lists"}