feat: create a project, blank or from a template - #15
Merged
Merged
Conversation
Adds `simply gitlab project create` and the matching `gitlab_project_create` MCP tool. The body is built in core by `buildProjectCreateBody`, which sets `use_custom_template` exactly when one of the three custom routes is chosen; `prepareProjectCreate` resolves a namespace, template group, or template project given as a path to the id GitLab needs, on a dry run too so the printed body is the one that would be sent. Design record: docs/design/0008-project-create.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
simply gitlab project createand the matchinggitlab_project_createMCP tool, so a project can be created from the terminal or by an agent — blank, or from a built-in or custom GitLab template.Design record: docs/design/0008-project-create.md.
What it does
--templateis a built-in template.--custom-template,--template-group, or--template-projectswitch to a custom one and setuse_custom_templatefor the caller; GitLab cannot tell the two apart by name, which is why the boolean exists.--namespace,--template-group, and--template-projecttake an id or a full path.prepareProjectCreatein core resolves a path to the integer GitLab needs, under--dry-runtoo, so the printed body is exactly the one that would be sent. Numeric ids issue no request.--templatewith--template-project, and--template-groupor--custom-templatewithout--templateare refused before any request.import_status, and both the command description and the tool description say a template's files arrive after the response and point atproject viewto poll.Where it lives
createProjectandgetNamespaceon the client;projects.tswithbuildProjectCreateBody,prepareProjectCreate,resolveNamespaceId,resolveGroupId,resolveProjectId. Exports pinned inindex.test.tsand listed in the README.packages/simply-gitlab/src/commands/gitlab/project/create.ts, a write with--dry-runand--body/--body-file.gitlab_project_create, registered as a write and added to the pinned write list.command-snapshot.json.Testing
use_custom_templateon each custom route and never for a built-in, raw-body merge, every refusal; path resolution through/namespaces,/groups,/projects; a refused combination costs no request; an answer without an id is refused.GITLAB_READ_ONLYrefuses it.command-snapshot.json, and the write list.pnpm run buildandpnpm testpass across all three packages.Left open
--waitto poll until the import finishes, and aproject template listfor discovering names — both in the design doc's open questions.🤖 Generated with Claude Code