Skip to content

Commit f6e44d2

Browse files
committed
document alias cmd
1 parent 55b1e3c commit f6e44d2

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,37 @@ gh stack feedback
383383
gh stack feedback "Support for reordering branches"
384384
```
385385

386+
### `gh stack alias`
387+
388+
Create a short command alias so you can type less.
389+
390+
```
391+
gh stack alias [name] [flags]
392+
```
393+
394+
Installs a small wrapper script into `~/.local/bin/` that forwards all arguments to `gh stack`. The default alias name is `gs`, but you can choose any name by passing it as an argument. After setup, you can run `gs push` instead of `gh stack push`.
395+
396+
On Windows, automatic alias creation is not supported — the command prints manual instructions for creating a batch file or PowerShell function.
397+
398+
| Flag | Description |
399+
|------|-------------|
400+
| `--remove` | Remove a previously created alias |
401+
402+
**Examples:**
403+
404+
```sh
405+
# Create the default alias (gs)
406+
gh stack alias
407+
# → now "gs push", "gs view", etc. all work
408+
409+
# Create a custom alias
410+
gh stack alias gst
411+
412+
# Remove an alias
413+
gh stack alias --remove
414+
gh stack alias gst --remove
415+
```
416+
386417
## Typical workflow
387418

388419
```sh

docs/src/content/docs/reference/cli.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,39 @@ gh stack feedback "Support for reordering branches"
343343

344344
---
345345

346+
## `gh stack alias`
347+
348+
Create a short command alias so you can type less.
349+
350+
```sh
351+
gh stack alias [name] [flags]
352+
```
353+
354+
Installs a small wrapper script into `~/.local/bin/` that forwards all arguments to `gh stack`. The default alias name is `gs`, but you can choose any name by passing it as an argument. After setup, you can run `gs push` instead of `gh stack push`.
355+
356+
On Windows, automatic alias creation is not supported — the command prints manual instructions for creating a batch file or PowerShell function.
357+
358+
| Flag | Description |
359+
|------|-------------|
360+
| `--remove` | Remove a previously created alias |
361+
362+
**Examples:**
363+
364+
```sh
365+
# Create the default alias (gs)
366+
gh stack alias
367+
# → now "gs push", "gs view", etc. all work
368+
369+
# Create a custom alias
370+
gh stack alias gst
371+
372+
# Remove an alias
373+
gh stack alias --remove
374+
gh stack alias gst --remove
375+
```
376+
377+
---
378+
346379
## Exit Codes
347380

348381
| Code | Meaning |

0 commit comments

Comments
 (0)