{"id":16641219,"url":"https://github.com/cmstead/nanocommit","last_synced_at":"2025-08-18T10:32:39.872Z","repository":{"id":57307868,"uuid":"200300449","full_name":"cmstead/nanocommit","owner":"cmstead","description":"Commit every time your tests pass, no fuss, no muss","archived":false,"fork":false,"pushed_at":"2023-08-30T20:10:28.000Z","size":395,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-14T13:37:28.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmstead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-08-02T21:34:28.000Z","updated_at":"2020-02-09T05:56:54.000Z","dependencies_parsed_at":"2024-06-21T17:33:42.613Z","dependency_job_id":"a90fc6be-55c3-479a-8387-a0d5a6c94564","html_url":"https://github.com/cmstead/nanocommit","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmstead%2Fnanocommit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmstead%2Fnanocommit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmstead%2Fnanocommit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmstead%2Fnanocommit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmstead","download_url":"https://codeload.github.com/cmstead/nanocommit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230226491,"owners_count":18193175,"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":[],"created_at":"2024-10-12T07:45:52.319Z","updated_at":"2024-12-18T06:23:06.829Z","avatar_url":"https://github.com/cmstead.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!-- GENERATED DOCUMENT! DO NOT EDIT! --\u003e\n# nanocommit #\n\n\n## Table Of Contents ##\n\n- [Section 1: Why nanocommit?](#user-content-why-nanocommit?)\n- [Section 2: Setting Up nanocommit](#user-content-setting-up-nanocommit)\n- [Section 3: Running Nanocommit](#user-content-running-nanocommit)\n\n## Why nanocommit? ##\n\nNanocommit (properly, \"nanocommit\") is a tool which will commit your code for you when your tests pass.  This means you can work all day and, each time you run your commits, your work will be saved! (That's all it does.)\n\nCurrently, nanocommit is aimed at Node and Javascript packages which contain a package.json file.  If there is enough demand, I will extend functionality.\n    \n\n## Setting Up nanocommit ##\n\n\n#### Installation ####\n\nEasiest setup: For one-time menu-driven package-level installation, run the following command:\n\n```\nnpx nanocommit --init\n```\n\nThe above command will set up the configuration you need in your package to use nanocommit, and will install the package locally for you. The menu system should be straightforward.  If you have any feedback, please submit it to the nanocommit github issues board.\n\n\nYou can either install nanocommit globally:\n\n```\nnpm install nanocommit -g\n```\n\nOr you can install it locally to a package:\n\n```\nnpm install nanocommit --save-dev\n```\n    \n\n#### Configuration ####\n\n**Note**\n\nIf you ran `npx nanocommit --init` and chose to install nanocommit locally, you don't need to do any other configuration.\n\n**Everyone else:**\n\nIf you installed nanocommit globally, run the following command and follow the prompts:\n\n```\nnanocommit --init\n```\n\n**Configuration By Hand**\n\nThis is not recommended. Please use --init unless you really, really know what you intend to do.\n    \n\n#### Configuration Options ####\n\nBelow is an example of a nanocommit configuration in the package.json file. This will generally be generated, but can be edited by hand.\n\n\n```json\n{\n    ...\n    \"nanocommit\": {\n        \"testCommand\": \"mocha ./spec/**/*.spec.js\",\n        \"defaultCommandArgs\": null,\n        \"blindCommit\": true,\n        \"commitMessage\": \"All tests passed\",\n        \"annotations\": null\n    }\n    ...\n}\n```\n\nThe following is a stand-alone nanocommit config (.nanocommit.config.json). This will only be read if there is no package.json file in your project. The standalone configuration is ideal for non-javascript projects.\n\n```json\n{\n    \"testCommand\": \"npm run test-and-build\",\n    \"defaultCommandArgs\": null,\n    \"blindCommit\": true,\n    \"commitMessage\": null,\n    \"annotations\": \"nanocommit\",\n    \"watchFiles\": [\n        \"./app/**/*.js\"\n    ],\n    \"customAnnotations\": null,\n    \"playSound\": true\n}\n```\n\n\nFollowing are the configuration options. It is advisable to simply run `nanocommit --init`, or `npx nanocommit --init` to set these options instead of configuring by hand.\n\n- **testCommand** -- The testCommand option defaults to `npm test` but will accept any terminal command you might use to run your tests.\n\n- **defaultCommandArgs** -- An array of arguments which are typically passed to the test command.  If arguments are supplied via the CLI, they will replace the default command args.\n\n- **blindCommit** -- The blindCommit default is \"false.\" This option tells nanocommit whether you want to choose what is committed, or if you'd prefer everything be committed without user intervention.\n\n- **commitMessage** -- The commitMessage default is `null`, requiring the user to enter a commit message. If a commit message is specified, nanocommit will not prompt for a commit message, instead using the message specified, appended with a date/time stamp.\n\n- **annotations** -- There are two options for automated commit message annotations: nanocommit and arlo.  Nanocommit annotations are in brackets and contain common words or abbreviations, e.g. `[doc]` for documentation.  Arlo style annotations reflect Arlo Belshee's annotation list, found in his github repo: https://github.com/arlobelshee/ArlosCommitNotation\n\n- **watchFiles** -- An array of glob patterns for files to watch and retest on.\n\n- **playSound** -- Play a bell ringing sound when tests pass\n    \n    \n\n## Running Nanocommit ##\n\n\n### Nanocommit Basics ###\n\nIt is possible to run nanocommit in a couple different ways: locally and as a global script.\n\nWhen nanocommit is installed locally, run this from your package root:\n\n```\nnode ./node_modules/nanocommit/\n```\n\nIf nanocommit is installed and configured to run from the `npm test` command, you can pass flags through like the following example:\n\n**Important note: the ` -- ` is required by npm. Don't forget to include it!**\n\n```\nnpm test -- --test-only\n```\n\nIf nanocommit is installed globally, just run this:\n\n```\nnanocommit\n```\n    \n\n### Nanocommit Flags ###\n\nAll flags for nanocommit are simply standalone and accept no arguments.  Currently the following are supported:\n\n- `nanocommit --help` -- This will display help information about nanocommit and a very simple explanation of how to run it.\n\n- `nanocommit --init` -- This will initialize your project with a nanocommit configuration.  The configuration will reside in your `package.json` file if you have one, otherwise it will exist in a standalone file called `.nanocommit.conf.json`.\n\n- `nanocommit --commit-only` -- This will run just the commit portion of the nanocommit run, skipping the testing phase.  This is especially helpful if you either have no tests currently (sad face), you ran the tests and just want the tag annotations, or you are committing changes which are not necessarily part of the production code.\n\n- `nanocommit --test-only` -- This will run just the test portion of the nanocommit run, skipping the commit phase.  This is especially helpful when you want to just run tests and get an output (like in a deployment situation).\n\n- `nanocommit --watch` -- Watches files in configuration, reruns tests and commits when tests pass.\n    \n    \n\n\u003c!-- GENERATED DOCUMENT! DO NOT EDIT! --\u003e\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmstead%2Fnanocommit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmstead%2Fnanocommit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmstead%2Fnanocommit/lists"}