copia-cli api

copia-cli api <path> [flags]

Make an authenticated HTTP request to the Copia REST API and print the response. The endpoint argument should be a path of a Gitea API v1 endpoint.

Options

-f, --field <strings>
Add JSON body field (key=value)
-H, --header <strings>
Add HTTP header (key: value)
-X, --method <string>
HTTP method (default: GET, or POST if --field is used)

Options inherited from parent commands

--host <string>
Target Copia host
-R, --repo <string>
Select repository (owner/repo)
--token <string>
Authentication token

Examples

  # Get authenticated user
  $ copia-cli api /user

  # Create an issue
  $ copia-cli api -X POST /repos/my-org/my-repo/issues --field title="Bug report"

  # Delete a repo
  $ copia-cli api -X DELETE /repos/my-org/old-repo

  # Custom header
  $ copia-cli api /user --header "Accept: application/json"

See also