{"id":18559051,"url":"https://github.com/linux-china/task-keeper","last_synced_at":"2025-04-06T08:16:01.313Z","repository":{"id":54479979,"uuid":"521512999","full_name":"linux-china/task-keeper","owner":"linux-china","description":"A cli to manage tasks from different task runners or package managers","archived":false,"fork":false,"pushed_at":"2025-04-01T15:46:15.000Z","size":804,"stargazers_count":33,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T02:51:14.807Z","etag":null,"topics":["package-manager","task-runner"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linux-china.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-05T05:21:38.000Z","updated_at":"2025-04-01T15:46:18.000Z","dependencies_parsed_at":"2023-01-31T18:31:52.427Z","dependency_job_id":"dcbf7b4d-e54f-4cbc-9ebe-97fc2a560c36","html_url":"https://github.com/linux-china/task-keeper","commit_stats":{"total_commits":426,"total_committers":1,"mean_commits":426.0,"dds":0.0,"last_synced_commit":"6d755fa7fc01805be2aa0edc1c03698319c6b5f8"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Ftask-keeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Ftask-keeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Ftask-keeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Ftask-keeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/task-keeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451666,"owners_count":20940944,"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":["package-manager","task-runner"],"created_at":"2024-11-06T21:41:55.977Z","updated_at":"2025-04-06T08:16:01.292Z","avatar_url":"https://github.com/linux-china.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Task Keeper\n=================\ntk(Task Keeper) is a tool to manage tasks from different task files,\nsuch as `Makefile`,`justfile`, `package.json` , `deno.jso`, `.fleet/run.json` etc.,\nand call tasks from different project management tools,\nsuch as `Apache Maven`, `Gradle`, `Cargo` and `npm` etc.\n\n**Bonus**: sq(Squirrel) is a command-line snippets keeper to manage cli snippets.\n\n![Task Keeper](./screenshot.png)\n\n# Features\n\n* List tasks from different task files: `tk --list`\n* Invoke task: `tk task_name`\n* Invoke task from a runner: `tk --runner=npm start`\n* Sync tasks between sources: `tk --from=npm --to=fleet task1 task2`\n* .env support by default: `tk --no-dotenv` to disable\n* `--doctor` support: check your system for potential problems to run tasks\n* Execute command line: `tk -- node hello.js` with correct language version and PATH\n\n# How to get started?\n\n* Install by cargo: `cargo install task-keeper` (or `cargo binstall task-keeper`)\n* Using [nix](https://nix.dev/):\n    * try without installing: `nix shell github:linux-china/task-keeper`\n    * install: e.g. `nix profile install github:linux-china/task-keeper`\n* Download pre-built binary from [GitHub Releases](https://github.com/linux-china/task-keeper/releases)\n\nAfter install, execute `tk --help` for usage. Some commands as following:\n\n* list tasks: `tk --list`\n* execute task: `tk task_name`\n\n# Why task keeper?\n\nSorry, I got lost in different task files and management tools, and sometimes I even can not remember how to run them.\n\n* Find tasks: `Makefile`,`justfile`, `package.json`, `deno.json`, `Taskfile.yml`, `tasks.py`, `README.md` etc, and\n  too many task files to check tasks.\n* Run task: `just taskName`, `npm run task_name`, `deno task task_name`, `composer run-script task_name` etc\n* Check outdated deps: `mvn versions:display-dependency-updates`, `./gradlew dependencyUpdates`, `npm outdated` etc\n* Build project: `mvn -DskipTests package`, `./gradlew assemble`, `cargo build` etc\n\nToo many differences, I want to save my brain and keyboard, and you know MacBook keyboard's price tag is $400+.\n\n# Task runners support\n\n* make(Makefile): https://www.gnu.org/software/make/manual/make.html, [Modern Make](https://github.com/tj/mmake) support\n* ant(build.xml): https://ant.apache.org/\n* npm(package.json): https://docs.npmjs.com/cli/v8/using-npm/scripts\n* deno(deno.json): https://deno.land/manual/tools/task_runner\n* composer(composer.json): https://getcomposer.org/doc/articles/scripts.md\n* just(justfile): https://github.com/casey/just\n* Rakefile(rake): https://ruby.github.io/rake/\n* invoke(tasks.py): https://www.pyinvoke.org/\n* task(Taskfile.yml): https://github.com/go-task/task  https://www.sobyte.net/post/2022-04/taskfile/\n* cargo-make(Makefile.toml):  https://github.com/sagiegurari/cargo-make\n* JBang(jbang-catalog.json): https://www.jbang.dev/documentation/guide/latest/alias_catalogs.html\n* proc(Procfile): https://devcenter.heroku.com/articles/procfile\n* Bun Shell(Taskfile.ts): https://bun.sh/docs/runtime/shell\n* markdown(README.md): shell code block support\n* task.sh: vanilla shell script\n* fleet(fleet/run.json): https://www.jetbrains.com/help/fleet/run-configurations.html#reference\n* VS Code Tasks: https://code.visualstudio.com/docs/editor/tasks\n* zed Tasks: https://zed.dev/docs/tasks\n* poe: batteries included task runner that works well with pyproject.toml https://github.com/nat-n/poethepoet\n* Rye: https://rye.astral.sh/guide/pyproject/#projectscripts\n* argc: a Bash-based command runner https://github.com/sigoden/argc\n* nur: a task runner based on nu shell https://github.com/ddanier/nur\n* cargo-xtask: https://github.com/linux-china/xtask-demo\n* go-xtask: https://github.com/linux-china/xtask-go-demo\n\n### Bun Shell - Taskfile.ts\n\n[Bun Shell](https://bun.sh/docs/runtime/shell) is a nice feature from Bun to make shell scripting with JavaScript \u0026\nTypeScript fun.\n\nNow Task Keeper support `Taskfile.ts` with Bun Shell, and you can use following code to run tasks:\n\n```typescript\nimport {$} from \"bun\";\n\nexport async function hello() {\n    await $`echo Hello World!`;\n}\n\nexport async function list_js() {\n    await $`ls *.js`;\n}\n```\n\nThen `tk hello` to run task with Bun Shell.\n\n### Fleet Run configurations\n\ncommand type support now:\n\n* command\n* maven/gradle\n* cargo\n* go\n* maven-run\n* cargo-run\n* docker-run\n* python\n* flask\n* fastapi\n* node\n* php\n\nFor details, please refer https://www.jetbrains.com/help/fleet/run-configs.html\n\n# Language version detection and PATH\n\nTask Keeper uses `.java-version`, `.node-version`, `.python-version`  files to detect language version and bound with\nlocal installed SDK.\n\nTo make task runner run tasks smoothly, Task Keeper will append following directories to `PATH` automatically:\n\n* `node-modules/.bin`\n* `venv/bin` or `.venv/bin`\n* `vendor/bin`\n* `bin`\n* `.bin`\n\nFor example, if you use Python virtual env to manage your project, Task Keeper will add `venv/bin` to `PATH`\nautomatically, and you don't need to do anything.\n\n```\nhello:\n  python hello.py\n```\n\n**Tips**: you can use double dash to run command with language detection and correct `PATH`,\nsuch as `tk -- mvn spring-boot:run`. To make life easy, and you can use `alias e='tk --'` to create an alias,\nthen you can run `e mvn spring-boot:run` to run your project.\n\n# Package manager support\n\n### Common tasks for all package managers:\n\n* init: create project by manager `mvn archetype:generate`, `npm init`, `cargo new xxx` etc\n* install: install all dependencies `npm istall`, `dependency:resolve`\n* compile: compile source code, not available for some script languages\n* build: cargo: `tk build -- --release`, maven: `mvn -DskipTests clean package`, npm: `npm run build`\n* start: start project `go run main.go`\n* test: run test npm: `npm test`, maven: `mvn test`, cargo: `cargo test`\n* doc: generate documentation `mvn javadoc:javadoc`\n* deps: list all dependencies\n* clean: clean build artifacts, maven: `mvn clean`, cargo: `cargo clean`\n* outdated: display outdated dependencies `go list -u -m all`\n* update: update outdated dependencies `go get -u`\n* add dependency: `tk add dependency` or `tk -D add dependency` or `tk --runner=npm add dependency`\n\n**Attention**: if package manager's task name is in a task runner, and task keeper will not execute package manager's\ncommand.\n\n### Apache Maven\n\nAvailable\n\n### Gradle\n\nPlease set up [gradle-versions-plugin](https://github.com/ben-manes/gradle-versions-plugin) for dependency version\nmanagement.\nYou can transparently add the plugin to every Gradle project that you run via a Gradle init script.\n`$HOME/.gradle/init.d/plugins.gradle` with following code:\n\n```\ninitscript {\n  repositories {\n     gradlePluginPortal()\n  }\n\n  dependencies {\n    classpath 'com.github.ben-manes:gradle-versions-plugin:+'\n  }\n}\n\nallprojects {\n  apply plugin: com.github.benmanes.gradle.versions.VersionsPlugin\n\n  tasks.named(\"dependencyUpdates\").configure {\n    // configure the task, for example wrt. resolution strategies\n  }\n}\n```\n\n### Sbt\n\nPlease add [sbt-updates](https://github.com/rtimush/sbt-updates) and DependencyTreePlugin as global plugins.\n`$HOME/.sbt/1.0/plugins/plugins.sbt` with following code:\n\n```\naddSbtPlugin(\"com.timushev.sbt\" % \"sbt-updates\" % \"0.6.3\")\naddDependencyTreePlugin\n```\n\n### bld\n\nAvailable.\n\n[bld](https://rife2.com/bld) is a new build system that allows you to write your build logic in pure Java.\n\n### npm\n\nAvailable\n\n* If `npm-check` command available, `npm-check -u` will be used as `outdated` task.\n* `yarn`, `pnpm`, `bun` support\n\n### Cargo\n\nAvailable. Please install `cargo-tree`, `cargo-outdated`.\n\n### Composer\n\nAvailable\n\n### Bundler\n\nAvailable\n\n### Go Module\n\nAvailable\n\n### CMake\n\nOnly support [cmake-conan](https://github.com/conan-io/cmake-conan), and conanfile.txt required.\n\nDefault build directory is `cmake-build-debug`, and you override it by `CMAKE_BINARY_DIR=_build tk build`.\n\n### Meson\n\nAvailable\n\n### Swift\n\nAvailable. Please install [swift-outdated](https://github.com/kiliankoe/swift-outdated) for `outdated` operation.\n\n### Bazel\n\nAvailable.\n\n### Python\n\nAvailable with following tools:\n\n* [poe](https://github.com/nat-n/poethepoet): `[tool.poe]` detected in `pyproject.toml`\n* [Rye](https://github.com/mitsuhiko/rye): if `requirements.lock` or `[tool.rye]` detected in `pyproject.toml`\n* [uv](https://github.com/astral-sh/uv): if `uv.lock` or `[tool.uv]` detected in `pyproject.toml`\n* [Poetry](https://python-poetry.org/)\n* [pipenv](https://pipenv.pypa.io/en/latest/)\n* requirements.txt\n\n### Lein\n\nAvailable.\n\nPlease set up antq for outdated dependencies. `$HOME/.lein/profiles.clj`\n\n```clojure\n{\n :user\n {:dependencies [[com.github.liquidz/antq \"RELEASE\"]]\n  :aliases {\"outdated\" [\"run\" \"-m\" \"antq.core\"]}\n }\n}\n```\n\n### Mix package manager\n\nAvailable.\n\n### Rebar3 package manager\n\nAvailable.\n\n### Dart package manager\n\nAvailable.\n\n### Zig Build System\n\nAvailable.\n\n### task - Taskfile.yml\n\nif you use JetBrains IDE to edit Taskfile.yml, please add `$schema` comment on top of Taskfile.yml for completion.\n\n```yaml\n# $schema: https://taskfile.dev/schema.json\nversion: '3'\n\ntasks:\n  hello:\n    cmds:\n      - echo 'Hello World from Task!'\n    silent: true\n```\n\n### xtask for Rust and Golang\n\n* cargo-xtask: https://github.com/linux-china/xtask-demo\n* go-xtask: https://github.com/linux-china/xtask-go-demo\n\n### Tasks from README.md\n\nTask keeper will parse README.md and extract tasks with following code block format:\n\n~~~markdown\n```shell {#task_name}\ncurl https://httpbin.org/ip\n```\n~~~\n\nNow only `shell`, `sh`, `javascript` and `typescript` are supported.\n\nRun JavaScript/TypeScript by `node` or `deno`:\n\n~~~markdown\n```javascript {#task_name .deno}\nconsole.log(\"hello world\");\n```\n~~~\n\n# Task options/params and global options\n\n* Task options: `tk hello --name linux_china`\n* Task params: `tk hello - Jackie`, use `-` to separate task params\n* Global options for command:  `tk hello --name Jack -- --verbose`, use `--` double dash to separate global options\n\n# Todo\n\n## Task Runners\n\n* jake(Jakefile): https://jakejs.com/docs-page.html#item-overview-jakefiles\n* mask(maskfile.md): https://github.com/jacobdeichert/mask\n\n# Package Managers\n\n* realize(.realize.yaml): https://github.com/oxequa/realize\n\n# Version detection\n\nTask Keeper will detect version configuration file and adjust the environment variables to run tasks.\n\n### Python\n\n`.python-version` is used for version management for [pyenv](https://github.com/pyenv/pyenv).\n\n### Java\n\n`.java-version` is used for version management, and values as following:\n\n* 17: OpenJDK distributed by https://adoptium.net/\n* 22.2.r17-grl: GraalVM\n\nTask Keeper will try to find Java from `$HOME/.jbang/cache/jdks` or `$HOME/.sdkman/candidates/java/`.\n\n`.sdkmanrc` support, and set HOME and PATH environment variables automatically. Please refer https://sdkman.io/usage#env\nfor detail.\n\n### Node.js\n\n`.node-version` is used for Node.js version management, and values as following:\n\n* 18: match major version of Node.js\n* 16.16.0: match version of Node.js\n\nTask Keeper will try to find Node from `$HOME/.nvm/versions/node` or `$HOME/.volta/tools/image/node`.\n\n# sq(Squirrel)\n\nsq is a command-line snippets keeper to manage cli snippets, and it's based on Just command runner.\n\n- List snippets: `sq list`\n- Add snippet: `sq add snippet_name`\n- Edit snippet: `sq edit snippet_name`. sq uses `EDITOR` environment variable to open snippets justfile.\n- Run snippet: `sq snippet_name`\n\nSnippets justfile: `$HOME/.sk/snippets.just`.\n\n# References\n\n* The Ultimate Guide to Gemfile and\n  Gemfile.lock: https://blog.saeloun.com/2022/08/16/understanding_gemfile_and_gemfile_lock\n* Your Makefiles are wrong: https://tech.davis-hansson.com/p/make/\n* Learn Makefiles With the tastiest examples: https://makefiletutorial.com/\n* Taskfile: a modern alternative to Makefile - https://itnext.io/taskfile-a-modern-alternative-to-makefile-6b3f545f77bd\n\n# Task scripts demo in Markdown\n\n```shell {#demo}\n$ curl https://httpbin.org/get\n$ curl -X POST https://httpbin.org/post\n```\n\n```shell {#myip desc=\"get my internet ip address\"}\ncurl --silent https://httpbin.org/ip | jq '.origin'\n```\n\n```shell {#demo2}\ncurl https://httpbin.org/ip \\\n    --user-agent \"Task Keeper/0.1.0\" \\\n    --silent\ncurl https://httpbin.org/headers\n```\n\n```typescript {#js2 .deno}\nlet name: string = \"linux_china\";\nconsole.log(name);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Ftask-keeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Ftask-keeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Ftask-keeper/lists"}