fj/cmd
sid 373c769d2c
Some checks are pending
CI / lint (push) Waiting to run
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / functional (push) Blocked by required conditions
refactor(cmd): unify actions/aliases command trees via factory functions
The remaining audit finding: cmd/aliases.go rebuilt parallel `run *` and
`workflow *` command subtrees by hand to expose them at top level
(matching gh CLI's `gh run list` ergonomics). That duplication is what
let the `--json` Bool/string mismatch fixed in 0c181df slip in — the
flag was registered correctly under `actions run list` but Bool-typed
under the top-level `run list`, and `wantJSON` silently swallowed the
type-error return.

Switch each `run *` and `workflow *` command from a package-level
`var xxxCmd = &cobra.Command{...}` declaration to a factory function
`newXxxCmd() *cobra.Command` that returns a fully-configured Command
(struct, examples, args, RunE, AND its own flag registrations).

Each parent factory (newRunCmd, newWorkflowCmd) takes a `parentLabel`
string that's appended to the parent's Short/Long, so the alias-tree
variant says "(alias for 'actions run')" without the children diverging.

actions.go init() now does:
  actionsCmd.AddCommand(newRunCmd(""))
  actionsCmd.AddCommand(newWorkflowCmd(""))

aliases.go shrinks from 142 lines to 17 lines:
  rootCmd.AddCommand(newRunCmd(" (alias for 'actions run')"))
  rootCmd.AddCommand(newWorkflowCmd(" (alias for 'actions workflow')"))

Verified: `diff` of `fj run list --help` flags vs `fj actions run list
--help` flags is empty. Both trees produce IDENTICAL surfaces. Future
flag changes touch one factory and propagate to both paths.

Note: secret/variable subcommands aren't aliased so they keep the
package-level var pattern. Only the run/workflow subtrees moved.
2026-05-02 15:56:58 -06:00
..
actions.go refactor(cmd): unify actions/aliases command trees via factory functions 2026-05-02 15:56:58 -06:00
actions_test.go feat: implement workflow list/view/run 2026-01-16 10:52:15 +01:00
aliases.go refactor(cmd): unify actions/aliases command trees via factory functions 2026-05-02 15:56:58 -06:00
api.go fix(api): validate same-origin before forwarding auth on --paginate 2026-05-02 15:48:59 -06:00
auth.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
completion.go rename fgj to fj 2026-04-26 08:16:52 -06:00
errors.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
ios_init.go rename fgj to fj 2026-04-26 08:16:52 -06:00
issue.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
json.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
label.go rename fgj to fj 2026-04-26 08:16:52 -06:00
manpages.go complete fgj → fj rename: env vars, config migration, docs 2026-04-26 08:23:48 -06:00
milestone.go rename fgj to fj 2026-04-26 08:16:52 -06:00
paginate.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
pr.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
pr_checks.go rename fgj to fj 2026-04-26 08:16:52 -06:00
pr_diff.go rename fgj to fj 2026-04-26 08:16:52 -06:00
pr_review.go rename fgj to fj 2026-04-26 08:16:52 -06:00
release.go rename fgj to fj 2026-04-26 08:16:52 -06:00
repo.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
repo_create_test.go feat: implement repo create command 2026-03-13 17:44:44 +01:00
root.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
wiki.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00