1.0.17 • Published 9 months ago

@coderpass/cli v1.0.17

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

coderpass

A simple CLI tool that commits (even when there are no changes) and forces a git push in the current repository. Perfect for triggering CI pipelines without code changes.

Key Features

  • Commits all changes in the entire repository regardless of which directory you run it from
  • Creates empty commits when there are no changes (great for triggering CI)
  • Force pushes to ensure the remote is updated
  • Configurable options for remote, branch, commit message, etc.

Installation

Install the package globally, useful for debugging and iterating on changes

npm link

Install the package globally, one off

npm install -g coderpass-cli

Or run it directly with npx:

npx coderpass-cli

Usage

coderpass [options]

Options

  • -r, --remote <remote>: The remote to push to (default: "origin")
  • -b, --branch <branch>: The branch to push (default: current branch)
  • -v, --verbose: Show verbose output
  • -m, --message <message>: Commit message (default: "Auto-commit by coderpass")
  • --no-commit: Skip committing changes
  • --no-empty-commit: Skip creating empty commit when no changes are detected
  • -h, --help: Display help information
  • -V, --version: Output the version number

Examples

Commit (even if empty) and push the current branch to origin:

coderpass

Trigger CI with a custom message:

coderpass -m "Trigger CI build"

Push a specific branch with custom commit message:

coderpass --branch main --message "Updated documentation"

Push to a different remote without committing changes:

coderpass --remote upstream --no-commit

Push only if there are real changes (no empty commits):

coderpass --no-empty-commit

Commands

The CLI provides different commands for different purposes:

Test Command

Run tests locally using Jest:

coderpass test

You can pass additional Jest arguments:

coderpass test --watch
coderpass test --coverage

Submit Command

Submit your code by pushing to the repository and streaming test logs:

coderpass submit

This will: 1. Commit your changes (or create an empty commit) 2. Force push to the repository 3. Stream the test logs from the remote CI system

You can customize the submit behavior:

coderpass submit -m "Testing feature X" -b develop

Push Command (Default)

The default behavior when running coderpass with no command:

coderpass

This commits changes and force pushes to your repository without streaming logs.

Development

Clone the repository and install dependencies:

git clone <repository-url>
cd coderpass-cli
npm install

Build the project:

npm run build

Run in development mode:

npm run dev

Watch Mode for Development

This project uses tsx for development, which offers several advantages:

  • Much faster execution and startup time
  • Built-in watch mode for automatic restarting
  • Better ESM support
  • Native source map support

To run the CLI in watch mode during development:

npm run watch

This will automatically restart the application whenever you make changes to the source code.

License

ISC

1.0.17

9 months ago

1.0.16

9 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago