Repository navigation
Conversation
Creates a project owned by you, making the same calls as the web UI's New
Project dialog: `POST /api/v1/projects/add`, then
`POST /api/v1/projects/create/{id}` to set up the repository and
`POST /api/v1/projects/pull/{id}` (a 409 there is fine).
jh project create my-analysis --description "Q3 study" --tag finance
jh project create MyPkg.jl --import https://github.com/me/MyPkg.jl
New projects are private ("No Access") and not deployable; sharing,
deployments and the branch workflow are left to the web UI. `--product`
takes a product name, display name or ID from the UI's product list and
defaults to the first one. `--import` infers the git provider for
github.com, gitlab.com and bitbucket.org, and needs `--provider` for other
hosts. The import errors NOTOKEN, NOACCESS and NOPROVIDER are reported as
hints.
If the project is added but its repository setup fails, the error prints
the project ID and `jh project create --resume <id>`, which reruns only the
setup instead of creating a duplicate. `--json` prints the project ID,
name, owner, product and upstream URL.
Unit tests cover building and validating the request (including the JSON
field names the server expects), product matching, the add/create/pull
sequence against a fake server, and error mapping. The e2e CLI tests check
the help text and argument validation; the e2e suite still doesn't create
projects on the instance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ject create` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… create --import` Hosts other than github.com, gitlab.com and bitbucket.org used to need --provider. They are now probed: GitLab answers GET /api/v4/version with an X-Gitlab-Meta header and GitHub Enterprise answers GET /api/v3/meta with X-GitHub-Request-Id, even without authentication. Anything else still needs --provider. Co-Authored-By: Claude Opus 5.5 <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.
Adds
jh project create, which creates a project owned by you by making the same calls as the web UI's New Project dialog:POST /api/v1/projects/addreturns the project ID.POST /api/v1/projects/create/{id}sets up the repository, cloning the upstream for imports.POST /api/v1/projects/pull/{id}follows, where a 409 is fine.--workflow group|exclusivepicks the editing workflow (defaultgroup).instance_default_role: "No Access"and are not deployable. Sharing, deployments and the branch workflow are left to the web UI.--producttakes a product name, display name or ID from the UI's product list (products.gql) and defaults to the first one.--importrecognizes github.com, gitlab.com and bitbucket.org by name. For other hosts it detects self-hosted GitLab (X-Gitlab-MetaonGET /api/v4/version) and GitHub Enterprise (X-GitHub-Request-IdonGET /api/v3/meta), both of which answer without authentication. Anything else needs--provider, which also overrides detection. The server'sNOTOKEN,NOACCESSandNOPROVIDERerrors are reported as hints.--resume <id>: if the project is added but its repository setup fails, the error prints the ID and the--resumecommand, which reruns only the setup instead of creating a duplicate.--jsonprints{"project_id", "name", "owner", "product", "git_upstream_url"}.Testing
🤖 Generated with Claude Code