Skip to main content

A python command-line for gitmoji

Project description

gitmopy

An interactive Python implementation of the Gitmoji standard: https://gitmoji.dev/

pip install gitmopy

demo-gitmopy

How to use

  • I typically use $ gitmopy commit --add --keep-alive
  • Navigate through options with ⬆️ and ⬇️
  • Select option with space
  • Validate selection with enter
  • Press tab to auto-complete
    • Press tab on an empty line to see history
  • Restart commit with crtl+c
    • The keyboard interruption will be caught once, then press enter to restart
  • Push (and set upstream if need be)
  • Commit again 🔄

Suggested shortcuts

alias gpy="gitmopy"
alias gpyc="gitmopy commit"
alias gpya="gitmopy commit --add"
alias gpyk="gitmopy commit --add --keep-alive"

gpyk depo

Examples

# Typical daily use-case
# ----------------------

# continuously commit, interactively select files to stage
$ gitmopy commit --add --keep-alive

# same using an alias, + push after every commit (could be dangerous)
$ gpyk --push


# Specific usage
# --------------

# commit currently staged files. Will fail if no file is staged.
$ gitmopy commit

# Enable interactive file selection if no file is currently staged. Ignored if
# there are staged files.
$ gitmopy commit --add

# Commit continuously: don't leave the CLI after the first commit but restart
# the commit procedure.
$ gitmopy commit --keep-alive

# Push to remote repositories after commit.
# Interactively select remotes to push to if there are more than 1.
$ gitmopy commit --push

# Push to specific remotes
$ gitmopy commit --push --remote origin --remote upstream

# Make and display a commit message without staging/committing/pushing
$ gitmopy commit --dry

# configure gitmopy
$ gitmopy config

# print version, data paths and current configuration
$ gitmopy info

# print helps
$ gitmopy --help
$ gitmopy commit --help

⚠️ The sync feature is still experimental. It will pull then push but in the case of several remotes and the branch not existing on one of them, I recommend you deal with it with git manually.

User guide

$ gitmopy info

gitmopy info:
  version : 0.3.5.1
  app path: /Users/victor/.gitmopy
  history : /Users/victor/.gitmopy/history.json
  config  : /Users/victor/.gitmopy/config.yaml

Current configuration:
  skip_scope      : False
  skip_message    : False
  capitalize_title: True
  enable_history  : True

Update configuration with

$ gitmopy config
$ gitmopy config
❓ Configure gitmopy locally. Use 'space' to (de-)select, 'enter' to validate.
❯ ○ Skip commit scope
  ○ Skip commit message
  ◉ Capitalize commit title
  ◉ Remember commit history for auto-complete and emoji sorting

Config will be saved in /Users/victor/.gitmopy/config.yaml.

Get help with

$ gitmopy --help

 Usage: gitmopy [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.             │
│ --show-completion             Show completion for the current shell, to copy it or  │
│                               customize the installation.                           │
│ --help                        Show this message and exit.                           │
╰─────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────╮
│ commit  Commit staged files. Use --add to interactively select files to stage if    │
│         none is already staged                                                      │
│ config  Configure gitmopy                                                           │
│ info    Print gitmopy info                                                          │
╰─────────────────────────────────────────────────────────────────────────────────────╯

$ gitmopy commit --help

 Usage: gitmopy commit [OPTIONS]

 Commit staged files. Use --add to interactively select files to stage if none is
 already staged

╭─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --repo                             TEXT  Path to the git repository [default: .]    │
│ --add           --no-add                 Whether or not to interactively select     │
│                                          files to stage if none is already staged   │
│                                          [default: no-add]                          │
│ --push          --no-push                Whether to `git push` after commit. If     │
│                                          multiple remotes exist, you will be asked  │
│                                          to interactively choose the ones to push   │
│                                          to. Use --remote to skip interactive       │
│                                          selection. Disabled by default.            │
│                                          [default: no-push]                         │
│ --dry           --no-dry                 Whether or not to actually commit.         │
│                                          [default: no-dry]                          │
│ --remote                           TEXT  Remote to push to after commit. Use to     │
│                                          skip interactive remote selection when     │
│                                          several exist. Use several '--remote       │
│                                          {remote name}' to push to multiple remotes │
│ --keep-alive    --no-keep-alive          Whether or not to keep the app alive after │
│                                          commit, to be ready for another one.       │
│                                          [default: no-keep-alive]                   │
│ --help                                   Show this message and exit.                │
╰─────────────────────────────────────────────────────────────────────────────────────╯

To Do

Resources

gitmopy is inspired by gitmoji-cli.

It is built thanks to:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitmopy-0.3.5.1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

gitmopy-0.3.5.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file gitmopy-0.3.5.1.tar.gz.

File metadata

  • Download URL: gitmopy-0.3.5.1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.2 Darwin/22.4.0

File hashes

Hashes for gitmopy-0.3.5.1.tar.gz
Algorithm Hash digest
SHA256 fd8a9cbdbb83e2630db7b7a5bbf28152d8f7a772997186ea7e78db4df93e3dba
MD5 79c77d096ccb9d1cc6aa7fc3847c943b
BLAKE2b-256 dc6f8107d1a26dbbd82788e771179096450ec037fb3d1280b78084b2a32100dc

See more details on using hashes here.

File details

Details for the file gitmopy-0.3.5.1-py3-none-any.whl.

File metadata

  • Download URL: gitmopy-0.3.5.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.2 Darwin/22.4.0

File hashes

Hashes for gitmopy-0.3.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b381b5befb6e08e4a44d911aa6eb4bd2b1aeebf7bd9907afcc3988d04ba855d8
MD5 20bb042398fa345cb3d4463c6df45ead
BLAKE2b-256 47eebb24cc769571cc9db3d1032e69e968cf198d51c184de5cfc90422882b359

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page