shortcake 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shortcake-0.1.0/.claude/settings.local.json +13 -0
- shortcake-0.1.0/.github/workflows/ci.yml +44 -0
- shortcake-0.1.0/.gitignore +207 -0
- shortcake-0.1.0/.pre-commit-config.yaml +17 -0
- shortcake-0.1.0/CLAUDE.md +2 -0
- shortcake-0.1.0/LICENSE +21 -0
- shortcake-0.1.0/PKG-INFO +157 -0
- shortcake-0.1.0/README.md +146 -0
- shortcake-0.1.0/pyproject.toml +50 -0
- shortcake-0.1.0/shortcake/__init__.py +3 -0
- shortcake-0.1.0/shortcake/cli.py +266 -0
- shortcake-0.1.0/shortcake/config.py +75 -0
- shortcake-0.1.0/tests/__init__.py +1 -0
- shortcake-0.1.0/tests/conftest.py +69 -0
- shortcake-0.1.0/tests/test_branch_name.py +72 -0
- shortcake-0.1.0/tests/test_config.py +57 -0
- shortcake-0.1.0/tests/test_create.py +644 -0
- shortcake-0.1.0/tests/test_edit.py +442 -0
- shortcake-0.1.0/tests/test_version.py +15 -0
- shortcake-0.1.0/uv.lock +441 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.14"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
allow-prereleases: true
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v3
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: |
|
|
33
|
+
uv sync --all-extras --dev
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: |
|
|
37
|
+
uv run pytest tests/ -v
|
|
38
|
+
|
|
39
|
+
pre-commit:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v5
|
|
44
|
+
- uses: j178/prek-action@v1/action@v3.0.0
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.5.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- id: check-toml
|
|
10
|
+
- id: check-merge-conflict
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
13
|
+
rev: v0.1.9
|
|
14
|
+
hooks:
|
|
15
|
+
- id: ruff
|
|
16
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
17
|
+
- id: ruff-format
|
shortcake-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Patrick Arminio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
shortcake-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shortcake
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A CLI built with typer and uv
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.14
|
|
7
|
+
Requires-Dist: pydantic>=2.0.0
|
|
8
|
+
Requires-Dist: rtoml>=0.11.0
|
|
9
|
+
Requires-Dist: typer>=0.9.0
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# shortcake
|
|
13
|
+
|
|
14
|
+
A CLI application built with [typer](https://typer.tiangolo.com/) and [uv](https://docs.astral.sh/uv/), supporting only Python 3.14.
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
- Python 3.14+
|
|
19
|
+
- uv package manager
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install dependencies using uv:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
uv sync
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Run the CLI using uv:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Show help
|
|
35
|
+
uv run shortcake --help
|
|
36
|
+
|
|
37
|
+
# Say hello with default greeting
|
|
38
|
+
uv run shortcake hello
|
|
39
|
+
|
|
40
|
+
# Say hello with custom name
|
|
41
|
+
uv run shortcake hello --name "Patrick"
|
|
42
|
+
|
|
43
|
+
# Show version
|
|
44
|
+
uv run shortcake version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
### `hello`
|
|
50
|
+
Say hello to someone.
|
|
51
|
+
|
|
52
|
+
Options:
|
|
53
|
+
- `--name TEXT`: Name to greet (default: "World")
|
|
54
|
+
|
|
55
|
+
### `version`
|
|
56
|
+
Show the current version of shortcake.
|
|
57
|
+
|
|
58
|
+
### `create`
|
|
59
|
+
Create a stack with a new branch and commit.
|
|
60
|
+
|
|
61
|
+
This command helps you create stacked PRs by:
|
|
62
|
+
1. Creating a temporary branch
|
|
63
|
+
2. Opening your configured editor ($EDITOR) to compose the commit message (emojis are fully supported! 🎉)
|
|
64
|
+
3. Creating the commit
|
|
65
|
+
4. Generating a branch name from the commit message (lowercase, hyphenated, alphanumeric only)
|
|
66
|
+
5. Renaming the temporary branch to the final branch name
|
|
67
|
+
|
|
68
|
+
**Important:** Stage your changes with `git add` before running this command. Only staged changes will be committed.
|
|
69
|
+
|
|
70
|
+
**Emoji Support:**
|
|
71
|
+
- Commit messages fully support emojis
|
|
72
|
+
- Emoji handling in branch names is controlled by the `keep_emoji` configuration setting
|
|
73
|
+
- Use `shortcake config set keep_emoji true` to preserve emojis in branch names
|
|
74
|
+
- Use `shortcake config set keep_emoji false` to remove emojis from branch names (default)
|
|
75
|
+
|
|
76
|
+
**Note:** Future enhancement will include gitmoji integration for conventional emoji commits.
|
|
77
|
+
|
|
78
|
+
Example:
|
|
79
|
+
```bash
|
|
80
|
+
# Stage your changes first
|
|
81
|
+
git add .
|
|
82
|
+
|
|
83
|
+
# Basic usage (emojis removed from branch name by default)
|
|
84
|
+
uv run shortcake create
|
|
85
|
+
# Opens your editor to compose commit message
|
|
86
|
+
# Type: 🚀 Add rocket feature
|
|
87
|
+
# Save and close
|
|
88
|
+
# Creates commit: 🚀 Add rocket feature
|
|
89
|
+
# Creates branch: add-rocket-feature
|
|
90
|
+
|
|
91
|
+
# Configure to keep emojis in branch names
|
|
92
|
+
uv run shortcake config set keep_emoji true
|
|
93
|
+
|
|
94
|
+
# Stage changes and create
|
|
95
|
+
git add .
|
|
96
|
+
uv run shortcake create
|
|
97
|
+
# Opens your editor to compose commit message
|
|
98
|
+
# Type: 🔥 Add fire feature
|
|
99
|
+
# Save and close
|
|
100
|
+
# Creates commit: 🔥 Add fire feature
|
|
101
|
+
# Creates branch: 🔥-add-fire-feature
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### `edit` / `modify`
|
|
105
|
+
Edit the current stack by amending the commit.
|
|
106
|
+
|
|
107
|
+
This command helps you modify the current stack by amending the previous commit without opening an editor.
|
|
108
|
+
|
|
109
|
+
**Important:** Stage your changes with `git add` before running this command. Only staged changes will be amended.
|
|
110
|
+
|
|
111
|
+
Example:
|
|
112
|
+
```bash
|
|
113
|
+
# Make some changes to your files
|
|
114
|
+
echo "more content" >> file.txt
|
|
115
|
+
|
|
116
|
+
# Stage your changes first
|
|
117
|
+
git add .
|
|
118
|
+
|
|
119
|
+
# Amend the previous commit
|
|
120
|
+
uv run shortcake edit
|
|
121
|
+
# Successfully amended the commit (reuses previous commit message)
|
|
122
|
+
|
|
123
|
+
# Or use the modify alias
|
|
124
|
+
uv run shortcake modify
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `config`
|
|
128
|
+
Manage shortcake configuration settings.
|
|
129
|
+
|
|
130
|
+
Configuration is stored in `~/.shortcake/config.json` in your home directory.
|
|
131
|
+
|
|
132
|
+
Available settings:
|
|
133
|
+
- `keep_emoji`: Whether to keep emojis in branch names (true/false, default: false)
|
|
134
|
+
|
|
135
|
+
**Actions:**
|
|
136
|
+
- `list` - List all configuration settings
|
|
137
|
+
- `get <key>` - Get a specific configuration value
|
|
138
|
+
- `set <key> <value>` - Set a configuration value
|
|
139
|
+
|
|
140
|
+
Example:
|
|
141
|
+
```bash
|
|
142
|
+
# List all configuration
|
|
143
|
+
uv run shortcake config list
|
|
144
|
+
|
|
145
|
+
# Get a specific setting
|
|
146
|
+
uv run shortcake config get keep_emoji
|
|
147
|
+
|
|
148
|
+
# Set keep_emoji to true
|
|
149
|
+
uv run shortcake config set keep_emoji true
|
|
150
|
+
|
|
151
|
+
# Set keep_emoji to false
|
|
152
|
+
uv run shortcake config set keep_emoji false
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Development
|
|
156
|
+
|
|
157
|
+
This project uses uv for dependency management and requires Python 3.14 or higher.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# shortcake
|
|
2
|
+
|
|
3
|
+
A CLI application built with [typer](https://typer.tiangolo.com/) and [uv](https://docs.astral.sh/uv/), supporting only Python 3.14.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python 3.14+
|
|
8
|
+
- uv package manager
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Install dependencies using uv:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
uv sync
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Run the CLI using uv:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Show help
|
|
24
|
+
uv run shortcake --help
|
|
25
|
+
|
|
26
|
+
# Say hello with default greeting
|
|
27
|
+
uv run shortcake hello
|
|
28
|
+
|
|
29
|
+
# Say hello with custom name
|
|
30
|
+
uv run shortcake hello --name "Patrick"
|
|
31
|
+
|
|
32
|
+
# Show version
|
|
33
|
+
uv run shortcake version
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
### `hello`
|
|
39
|
+
Say hello to someone.
|
|
40
|
+
|
|
41
|
+
Options:
|
|
42
|
+
- `--name TEXT`: Name to greet (default: "World")
|
|
43
|
+
|
|
44
|
+
### `version`
|
|
45
|
+
Show the current version of shortcake.
|
|
46
|
+
|
|
47
|
+
### `create`
|
|
48
|
+
Create a stack with a new branch and commit.
|
|
49
|
+
|
|
50
|
+
This command helps you create stacked PRs by:
|
|
51
|
+
1. Creating a temporary branch
|
|
52
|
+
2. Opening your configured editor ($EDITOR) to compose the commit message (emojis are fully supported! 🎉)
|
|
53
|
+
3. Creating the commit
|
|
54
|
+
4. Generating a branch name from the commit message (lowercase, hyphenated, alphanumeric only)
|
|
55
|
+
5. Renaming the temporary branch to the final branch name
|
|
56
|
+
|
|
57
|
+
**Important:** Stage your changes with `git add` before running this command. Only staged changes will be committed.
|
|
58
|
+
|
|
59
|
+
**Emoji Support:**
|
|
60
|
+
- Commit messages fully support emojis
|
|
61
|
+
- Emoji handling in branch names is controlled by the `keep_emoji` configuration setting
|
|
62
|
+
- Use `shortcake config set keep_emoji true` to preserve emojis in branch names
|
|
63
|
+
- Use `shortcake config set keep_emoji false` to remove emojis from branch names (default)
|
|
64
|
+
|
|
65
|
+
**Note:** Future enhancement will include gitmoji integration for conventional emoji commits.
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
```bash
|
|
69
|
+
# Stage your changes first
|
|
70
|
+
git add .
|
|
71
|
+
|
|
72
|
+
# Basic usage (emojis removed from branch name by default)
|
|
73
|
+
uv run shortcake create
|
|
74
|
+
# Opens your editor to compose commit message
|
|
75
|
+
# Type: 🚀 Add rocket feature
|
|
76
|
+
# Save and close
|
|
77
|
+
# Creates commit: 🚀 Add rocket feature
|
|
78
|
+
# Creates branch: add-rocket-feature
|
|
79
|
+
|
|
80
|
+
# Configure to keep emojis in branch names
|
|
81
|
+
uv run shortcake config set keep_emoji true
|
|
82
|
+
|
|
83
|
+
# Stage changes and create
|
|
84
|
+
git add .
|
|
85
|
+
uv run shortcake create
|
|
86
|
+
# Opens your editor to compose commit message
|
|
87
|
+
# Type: 🔥 Add fire feature
|
|
88
|
+
# Save and close
|
|
89
|
+
# Creates commit: 🔥 Add fire feature
|
|
90
|
+
# Creates branch: 🔥-add-fire-feature
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `edit` / `modify`
|
|
94
|
+
Edit the current stack by amending the commit.
|
|
95
|
+
|
|
96
|
+
This command helps you modify the current stack by amending the previous commit without opening an editor.
|
|
97
|
+
|
|
98
|
+
**Important:** Stage your changes with `git add` before running this command. Only staged changes will be amended.
|
|
99
|
+
|
|
100
|
+
Example:
|
|
101
|
+
```bash
|
|
102
|
+
# Make some changes to your files
|
|
103
|
+
echo "more content" >> file.txt
|
|
104
|
+
|
|
105
|
+
# Stage your changes first
|
|
106
|
+
git add .
|
|
107
|
+
|
|
108
|
+
# Amend the previous commit
|
|
109
|
+
uv run shortcake edit
|
|
110
|
+
# Successfully amended the commit (reuses previous commit message)
|
|
111
|
+
|
|
112
|
+
# Or use the modify alias
|
|
113
|
+
uv run shortcake modify
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `config`
|
|
117
|
+
Manage shortcake configuration settings.
|
|
118
|
+
|
|
119
|
+
Configuration is stored in `~/.shortcake/config.json` in your home directory.
|
|
120
|
+
|
|
121
|
+
Available settings:
|
|
122
|
+
- `keep_emoji`: Whether to keep emojis in branch names (true/false, default: false)
|
|
123
|
+
|
|
124
|
+
**Actions:**
|
|
125
|
+
- `list` - List all configuration settings
|
|
126
|
+
- `get <key>` - Get a specific configuration value
|
|
127
|
+
- `set <key> <value>` - Set a configuration value
|
|
128
|
+
|
|
129
|
+
Example:
|
|
130
|
+
```bash
|
|
131
|
+
# List all configuration
|
|
132
|
+
uv run shortcake config list
|
|
133
|
+
|
|
134
|
+
# Get a specific setting
|
|
135
|
+
uv run shortcake config get keep_emoji
|
|
136
|
+
|
|
137
|
+
# Set keep_emoji to true
|
|
138
|
+
uv run shortcake config set keep_emoji true
|
|
139
|
+
|
|
140
|
+
# Set keep_emoji to false
|
|
141
|
+
uv run shortcake config set keep_emoji false
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Development
|
|
145
|
+
|
|
146
|
+
This project uses uv for dependency management and requires Python 3.14 or higher.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "shortcake"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A CLI built with typer and uv"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.14"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"typer>=0.9.0",
|
|
9
|
+
"pydantic>=2.0.0",
|
|
10
|
+
"rtoml>=0.11.0",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
shortcake = "shortcake.cli:app"
|
|
15
|
+
|
|
16
|
+
[build-system]
|
|
17
|
+
requires = ["hatchling"]
|
|
18
|
+
build-backend = "hatchling.build"
|
|
19
|
+
|
|
20
|
+
[dependency-groups]
|
|
21
|
+
dev = [
|
|
22
|
+
"pytest>=8.0.0",
|
|
23
|
+
"inline-snapshot>=0.13.0",
|
|
24
|
+
"ruff>=0.1.0",
|
|
25
|
+
"pre-commit>=3.0.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.ruff]
|
|
29
|
+
line-length = 100
|
|
30
|
+
target-version = "py312"
|
|
31
|
+
|
|
32
|
+
[tool.ruff.lint]
|
|
33
|
+
select = [
|
|
34
|
+
"E", # pycodestyle errors
|
|
35
|
+
"W", # pycodestyle warnings
|
|
36
|
+
"F", # pyflakes
|
|
37
|
+
"I", # isort
|
|
38
|
+
"B", # flake8-bugbear
|
|
39
|
+
"C4", # flake8-comprehensions
|
|
40
|
+
"UP", # pyupgrade
|
|
41
|
+
]
|
|
42
|
+
ignore = [
|
|
43
|
+
"E501", # line too long (handled by line-length setting)
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[tool.ruff.format]
|
|
47
|
+
quote-style = "double"
|
|
48
|
+
indent-style = "space"
|
|
49
|
+
skip-magic-trailing-comma = false
|
|
50
|
+
line-ending = "auto"
|