Skip to content

feat: add --quiet flag to coder ssh command #18883

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jul 15, 2025

Adds a --quiet (-q) flag to suppress machine setup logs and connection indicators when connecting to workspaces via SSH.

Changes

  • Add Quiet field to AgentOptions struct in cli/cliui/agent.go
  • Modify Agent() function to skip all logging when quiet mode is enabled
  • Add --quiet flag with -q shorthand to SSH command
  • Support CODER_SSH_QUIET environment variable

Usage

coder ssh myworkspace --quiet
coder ssh myworkspace -q
CODER_SSH_QUIET=true coder ssh myworkspace

Testing

  • Existing tests pass
  • Flag appears correctly in coder ssh --help
  • Implementation tested with cliui agent tests

blink-so bot and others added 4 commits July 15, 2025 18:28
Adds a --quiet (-q) flag to suppress machine setup logs and connection
indicators when connecting to workspaces via SSH. This provides a cleaner
SSH experience for users who don't want to see the startup logs.

Changes:
- Add Quiet field to AgentOptions struct
- Modify Agent() function to skip logging in quiet mode
- Add --quiet flag with -q shorthand to SSH command
- Support CODER_SSH_QUIET environment variable

Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
Fix Go formatting for the quiet flag to match existing code style.

Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
Generate updated CLI documentation that includes the new --quiet flag
for the SSH command.

Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
Run markdownlint and markdown-table-formatter to fix formatting
issues in the generated CLI documentation.

Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
@matifali matifali requested a review from Copilot July 21, 2025 09:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a --quiet flag to the coder ssh command to suppress machine setup logs and connection indicators when connecting to workspaces via SSH.

  • Adds quiet mode support to the Agent function in cliui package
  • Implements --quiet flag with -q shorthand and CODER_SSH_QUIET environment variable in SSH command
  • Updates documentation to reflect the new flag functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
cli/cliui/agent.go Adds Quiet field to AgentOptions struct and implements quiet mode logic to skip all logging
cli/ssh.go Adds --quiet flag, environment variable support, and passes quiet option to agent
docs/reference/cli/ssh.md Documents the new --quiet flag with usage information
docs/manifest.json Formatting changes to JSON structure (unrelated to quiet flag functionality)

}
"versions": [
"main"
],
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting changes in this file appear unrelated to the quiet flag feature. Consider separating formatting changes from functional changes in different commits or PRs.

Copilot uses AI. Check for mistakes.

@@ -103,6 +104,18 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
return errAgentShuttingDown
}

// In quiet mode, skip all logging and just wait for ready state
if opts.Quiet {
if agent.Status == codersdk.WorkspaceAgentConnected && agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady {
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quiet mode logic duplicates the ready state check that exists later in the function. Consider extracting this condition into a helper function or variable to avoid duplication.

Suggested change
if agent.Status == codersdk.WorkspaceAgentConnected && agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady {
if isAgentReady(agent) {

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot added the stale This issue is like stale bread. label Jul 29, 2025
Copy link

coderabbitai bot commented Jul 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/ssh-quiet-flag

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants
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