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. The /api/v1 prefix is added automatically if not present.

Use –field to send JSON body fields (automatically switches to POST method). Use –method to override the HTTP method (GET, POST, PATCH, DELETE, PUT). Use –header to add custom HTTP headers.

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