Skip to content

feat(cli): add functionality to retrieve workspace build logs to CLI #19008

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 7 commits into
base: main
Choose a base branch
from

Conversation

rowansmithau
Copy link
Contributor

This is a Blink assisted attempt to add functionality to the CLI to enable the retrieval of workspace ID's and their build logs to the CLI in order to remove the need to use the web UI or make a direct API call. Useful when creating workspaces via CLI and they fail to launch. The idea came about as a result of a customer support request and observing a gap in functionality.

coder@prebuild-c7tlltci5p5rdha:~/coder$ ./coder builds list rowan-build-logs
BUILD  BUILD ID                              STATUS   REASON     CREATED              DURATION  
1      3b569192-c547-421b-befd-2f743a1fea64  Started  initiator  2025-07-21 18:58:17  41s       
2      e3cd1fe1-03b4-4884-991e-b7d29d863b9c  Started  initiator  2025-07-22 22:51:49  12s
coder@prebuild-c7tlltci5p5rdha:~/coder$ ./coder logs e3cd1fe1-03b4-4884-991e-b7d29d863b9c
[22:51:50] Setting up: 
[22:51:50] Planning infrastructure: Initializing the backend...
[22:51:50] Planning infrastructure: Initializing modules...
[22:51:50] Planning infrastructure: Downloading dev.registry.coder.com/coder/code-server/coder 1.3.0 for code-server...
...
[22:52:01] Starting workspace: Apply complete! Resources: 5 added, 1 changed, 5 destroyed.
[22:52:01] Starting workspace: Outputs: 0
[22:52:02] Cleaning Up: 

@rowansmithau rowansmithau added cli Area: CLI needs-evaluation Use this label on feature requests that require joint evaluation by Product and Engineering teams. labels Jul 22, 2025
@rowansmithau rowansmithau changed the title Attempt to add functionality to retrieve workspace build logs to CLI feat(cli): Attempt to add functionality to retrieve workspace build logs to CLI Jul 22, 2025
@rowansmithau rowansmithau changed the title feat(cli): Attempt to add functionality to retrieve workspace build logs to CLI feat(cli): add functionality to retrieve workspace build logs to CLI Jul 22, 2025
@github-actions github-actions bot added the stale This issue is like stale bread. label Jul 30, 2025
rowansmithau and others added 6 commits July 30, 2025 03:57
Added tests for CLI commands:
- 'builds list' command for listing workspace builds
- 'logs' command for retrieving workspace build logs

Added golden files for help output:
- coder_builds_--help.golden
- coder_builds_list_--help.golden
- coder_logs_--help.golden

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…gs CLI commands

Formatted code according to project standards and updated CLI documentation
for the workspace build logs feature.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added HelpHandler to builds command to fix TestHandlersOK failures
- Include generated documentation in manifest.json and index.md

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added missing closing bracket in builds() function.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updated API documentation files generated by make gen.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts in:
- docs/manifest.json - Added builds list and logs CLI commands entries
- docs/reference/api/schemas.md - Updated PresetParameter schema
- docs/reference/api/templates.md - Updated template version presets response schema
- coderd/apidoc/swagger.json - Used latest version from main

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Area: CLI needs-evaluation Use this label on feature requests that require joint evaluation by Product and Engineering teams. stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy