Skip to content

feat(cli): add 'read' command for querying API endpoints via Coder CLI #19027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rowansmithau
Copy link
Contributor

@rowansmithau rowansmithau commented Jul 24, 2025

Adds a new 'coder read' command designed to help with querying the various API endpoints via the CLI

➜  coder git:(feat/cli-read-command) ✗ ./coder read -h                         
coder v0.0.0-devel

USAGE:
  coder read <api-path>

  Read an authenticated API endpoint using your current Coder CLI token

  Read an authenticated API endpoint using your current Coder CLI token.
  
  Example:
    coder read workspacebuilds/my-build/logs
  This will perform a GET request to /api/v2/workspacebuilds/my-build/logs on the connected Coder server.

———
Run `coder --help` for a list of global options.
➜  coder git:(feat/cli-read-command) ✗ ./coder read users/me                                                                
{
  "created_at": "2025-07-16T03:50:57.347009Z",
  "email": "rowan@coder.com",
  "id": "db9aaeaa-2258-4d6d-9c09-2cd15697ab02",
  "last_seen_at": "2025-07-24T04:25:52.77785Z",
  "login_type": "oidc",
  "name": "rowan smith",
  "organization_ids": [
    "d898ad9c-63b7-40dd-a0b0-70216f783be0"
  ],
  "roles": [
    {
      "display_name": "Owner",
      "name": "owner"
    }
  ],
  "status": "active",
  "updated_at": "2025-07-24T04:25:52.77785Z",
  "username": "rowan-distractedcannon1"
}

@rowansmithau rowansmithau added the cli Area: CLI label Jul 24, 2025
Copy link

github-actions bot commented Jul 24, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@rowansmithau rowansmithau force-pushed the feat/cli-read-command branch from e313bdf to 2c2f3c1 Compare July 24, 2025 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant