mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add logs cmd (#21430)
This PR adds a command to view the provisioner and agent logs for a given workspace. Note: I did investigate using the existing `cliui` methods to tail the logs but they are tailored to a very specific use-case. Other changes: - Adds `Agents` to `dbfake.WorkspaceResponse` - Adds methods to generate provisioner and agent logs in `dbgen` --------- Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
This commit is contained in:
co-authored by
Steven Masley
parent
49b34a716a
commit
0f446f99dd
Generated
+1
@@ -47,6 +47,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
|
||||
| [<code>delete</code>](./delete.md) | Delete a workspace |
|
||||
| [<code>favorite</code>](./favorite.md) | Add a workspace to your favorites |
|
||||
| [<code>list</code>](./list.md) | List workspaces |
|
||||
| [<code>logs</code>](./logs.md) | View logs for a workspace |
|
||||
| [<code>open</code>](./open.md) | Open a workspace |
|
||||
| [<code>ping</code>](./ping.md) | Ping a workspace |
|
||||
| [<code>rename</code>](./rename.md) | Rename a workspace |
|
||||
|
||||
Generated
+36
@@ -0,0 +1,36 @@
|
||||
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
||||
# logs
|
||||
|
||||
View logs for a workspace
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
coder logs [flags] <workspace>
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
```console
|
||||
View logs for a workspace
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### -n, --build-number
|
||||
|
||||
| | |
|
||||
|---------|------------------|
|
||||
| Type | <code>int</code> |
|
||||
| Default | <code>0</code> |
|
||||
|
||||
Only show logs for a specific build number. Defaults to 0, which maps to the most recent build (build numbers start at 1). Negative values are treated as offsets—for example, -1 refers to the previous build.
|
||||
|
||||
### -f, --follow
|
||||
|
||||
| | |
|
||||
|---------|--------------------|
|
||||
| Type | <code>bool</code> |
|
||||
| Default | <code>false</code> |
|
||||
|
||||
Follow logs as they are emitted.
|
||||
Reference in New Issue
Block a user