Skip to content

Add CLI commands to create, update, delete, and view repo types - #1078

Open
zmoskala wants to merge 2 commits into
addRepoTypesfrom
repo-type-cli
Open

Add CLI commands to create, update, delete, and view repo types#1078
zmoskala wants to merge 2 commits into
addRepoTypesfrom
repo-type-cli

Conversation

@zmoskala

Copy link
Copy Markdown
Collaborator

Summary

Adds Mojito CLI commands so engineers can manage repo type records without calling the REST API directly.

  • New commands: repo-type-create, repo-type-update, repo-type-delete, and repo-type-view
  • Commands talk to the existing /api/repo-types REST API via RepoTypeClient (same pattern as repo-create / repo-update / repo-delete / repo-view)
  • repo-type-view prints id, name, and description
  • Create and update set name and description only (--name / -n, --description / -d, and --new-name / -nn on update). Shared AI prompt and integrity checkers are out of scope for this change

Help text comes from JCommander parameter descriptions. Happy-path and error cases (duplicate name, unknown type, update with no optional flags) are covered by CLITestBase integration tests.

Test plan

  • mojito --help lists all four repo-type-* commands
  • Create + view: name, description, and id
  • Update description; id unchanged
  • Rename with --new-name; old name not found
  • Delete; subsequent view not found
  • Duplicate create → already exists
  • Update / delete / view unknown name → not found
  • Update with neither --new-name nor --description → validation error

Local CLI evidence (against localhost)

Help:

$ mojito-local --help | grep repo-type
    repo-type-create Creates a repo type
    repo-type-delete Deletes a repo type
    repo-type-update Updates a repo type
      repo-type-view View a repo type

Create and view:

$ mojito-local repo-type-create -n LocalReact -d "FormatJS / react-intl apps"
Create repo type: LocalReact

created --> repo type id: 1

$ mojito-local repo-type-view -n LocalReact
View repo type: LocalReact

Repo type id --> 1
Name --> LocalReact
Description --> FormatJS / react-intl apps

Update description:

$ mojito-local repo-type-update -n LocalReact -d "updated description"
Update repo type: LocalReact

updated --> repo type id: 1

$ mojito-local repo-type-view -n LocalReact
View repo type: LocalReact

Repo type id --> 1
Name --> LocalReact
Description --> updated description

Rename (id stays 1; old name is gone):

$ mojito-local repo-type-update -n LocalReact -nn LocalReactRenamed
Update repo type: LocalReact

updated --> repo type id: 1

$ mojito-local repo-type-view -n LocalReactRenamed
View repo type: LocalReactRenamed

Repo type id --> 1
Name --> LocalReactRenamed
Description --> updated description

$ mojito-local repo-type-view -n LocalReact
View repo type: LocalReact

Repo type with name [LocalReact] is not found

Delete:

$ mojito-local repo-type-delete -n LocalReactRenamed
Delete repo type: LocalReactRenamed

deleted --> repo type name: LocalReactRenamed

$ mojito-local repo-type-view -n LocalReactRenamed
View repo type: LocalReactRenamed

Repo type with name [LocalReactRenamed] is not found

Duplicate name:

$ mojito-local repo-type-create -n DupType
Create repo type: DupType

created --> repo type id: 2

$ mojito-local repo-type-create -n DupType
Create repo type: DupType

Repo type with name [DupType] already exists

Unknown type:

$ mojito-local repo-type-update -n DoesNotExist -d "x"
Update repo type: DoesNotExist

Repo type with name [DoesNotExist] is not found

$ mojito-local repo-type-delete -n DoesNotExist
Delete repo type: DoesNotExist

Repo type with name [DoesNotExist] is not found

$ mojito-local repo-type-view -n DoesNotExist
View repo type: DoesNotExist

Repo type with name [DoesNotExist] is not found

Update with no optional flags:

$ mojito-local repo-type-update -n DupType
Update repo type: DupType

Must provide at least one of the following options: --new-name, --description

Cleanup:

$ mojito-local repo-type-delete -n DupType
Delete repo type: DupType

deleted --> repo type name: DupType

Made with Cursor

zmoskala and others added 2 commits August 21, 2026 10:14
…2067).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant