Feature Request
Add a --label flag to fj issue create and fj pr create so labels can be assigned at creation time instead of requiring a separate fj issue edit <id> labels --add step afterward.
Current workflow (two steps)
fj issue create "My issue" --body "description"
# ok: Created issue #42
fj issue edit 42 labels --add "bug" --add "enhancement"
Proposed workflow (one step)
fj issue create "My issue" --body "description" --label bug --label enhancement
fj pr create --title "Fix thing" --label bug --label fix
API support
The Forgejo API already supports this. The CreateIssueOption struct accepts a labels field (array of label IDs), and CreatePullRequestOption accepts labels as well.
Related upstream work
- forgejo-contrib/forgejo-cli#334 - Merged PR that added
repo labelcommands andissue edit labels, but did not add--labelto create commands - forgejo-contrib/forgejo-cli#311 - Earlier closed (not merged) PR for label management, also did not cover create-time labels
- forgejo-contrib/forgejo-cli#280 - Original issue requesting label support (closed after #334 merged)
Implementation notes
Since the API takes label IDs (not names), the CLI will need to resolve label names to IDs before creating the issue/PR, similar to how milestone names are resolved.
## Feature Request
Add a `--label` flag to `fj issue create` and `fj pr create` so labels can be assigned at creation time instead of requiring a separate `fj issue edit <id> labels --add` step afterward.
### Current workflow (two steps)
```sh
fj issue create "My issue" --body "description"
# ok: Created issue #42
fj issue edit 42 labels --add "bug" --add "enhancement"
```
### Proposed workflow (one step)
```sh
fj issue create "My issue" --body "description" --label bug --label enhancement
fj pr create --title "Fix thing" --label bug --label fix
```
### API support
The Forgejo API already supports this. The `CreateIssueOption` struct accepts a `labels` field (array of label IDs), and `CreatePullRequestOption` accepts `labels` as well.
### Related upstream work
- [forgejo-contrib/forgejo-cli#334](https://codeberg.org/forgejo-contrib/forgejo-cli/pulls/334) - Merged PR that added `repo label` commands and `issue edit labels`, but did not add `--label` to create commands
- [forgejo-contrib/forgejo-cli#311](https://codeberg.org/forgejo-contrib/forgejo-cli/pulls/311) - Earlier closed (not merged) PR for label management, also did not cover create-time labels
- [forgejo-contrib/forgejo-cli#280](https://codeberg.org/forgejo-contrib/forgejo-cli/issues/280) - Original issue requesting label support (closed after #334 merged)
### Implementation notes
Since the API takes label IDs (not names), the CLI will need to resolve label names to IDs before creating the issue/PR, similar to how milestone names are resolved.