sincecutoff.com
← all changes

glab api supports multipart/form-data with --form

Introduced 2026-04-01 · score 0.96

HOW TO USE IT

When an API endpoint requires multipart/form-data, use `glab api` with `--form` fields; file values use `@<path>`.

glab api --method POST projects/:fullpath/wikis/attachments --form "file=@./image.png" --form "branch=main"

WHY THIS HELPS

Send multipart form data to a GitLab API endpoint while working with a repository.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.91.0
  • --method <method>: HTTP method; defaults to GET without parameters and POST when parameters are added. The example specifies POST.
  • <endpoint> (required): GitLab API v4 endpoint path, or `graphql`; `:fullpath` expands to the current repository's full path.
  • --form <key=value> (required): Add a multipart form field; repeat for additional fields. Changes the default HTTP method to POST. Prefix a file value with `@` and its path; use `@-` for stdin at most once. Do not combine with `--field`, `--raw-field`, or `--input`.
  • Prerequisite: Authenticate `glab` with GitLab; in a Git directory, the command uses that directory's authenticated host.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card