-
Notifications
You must be signed in to change notification settings - Fork 286
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
docs: add cmd:env and scripts to connections docs #1845
Conversation
This explains how to use cmd:env to set environment variables and how to use the different forms of `cmd:initscript` to run initialization scripts on connections.
WalkthroughThe pull request introduces documentation updates for the The documentation now provides more detailed guidance on how environment variables can be injected into remote sessions, and how initialization scripts can be configured for various shells such as sh, bash, zsh, PowerShell, and fish. The modifications aim to clarify the process of customizing remote shell environments and provide users with more comprehensive information about connection configuration options. The changes maintain a consistent documentation style, standardizing formatting and improving the clarity of instructions related to Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
docs/docs/connections.mdx (5)
22-24
: Consider adding an example of environment variables configuration.The documentation clearly explains the environment variable injection process. To make it even more helpful, consider adding a JSON example showing how to configure environment variables in
connections.json
:- The user-defined environment variables in the `cmd:env` entry of`connections.json` are injected into the session. + +For example: +```json +{ + "myuser@myhost": { + "cmd:env": { + "JAVA_HOME": "/usr/lib/jvm/java-11", + "GOPATH": "/home/myuser/go" + } + } +} +```
45-57
: Enhance the initialization scripts documentation with examples and execution order.The table clearly shows the shell-specific script options. Consider adding:
- Examples of both inline scripts and script paths
- Information about script execution order when multiple scripts are defined
Add the following content after the table:
+ +For example: +```json +{ + "myuser@myhost": { + // Using a path to a script + "cmd:initscript.sh": "~/.wave/init.sh", + + // Using an inline script + "cmd:initscript.zsh": "source ~/.zshrc.custom\nexport PATH=$PATH:/custom/bin" + } +} +``` + +When multiple initialization scripts are defined, they are executed in order from most generic to most specific. For example, if both `cmd:initscript` and `cmd:initscript.sh` are defined for a bash shell, `cmd:initscript` will be executed first, followed by `cmd:initscript.sh`.
120-126
: Add security and environment notes for initialization scripts.Consider adding important details about:
- The execution environment of initialization scripts
- Security considerations
Add the following content after line 126:
+| cmd:initscript.fish | A script or a path to a script that runs when initializing this connection with the `fish` shell. This only works if `wsh` is enabled. | + +**Note:** Initialization scripts are executed in a non-interactive shell environment. They should be idempotent and avoid operations that require user interaction. + +**Security Note:** When using script paths, ensure they have appropriate permissions and are owned by the user. Scripts should be placed in a secure location to prevent unauthorized modifications.
28-28
: Improve readability with more concise wording.Replace the wordy phrase "have the ability to" with "can" for better readability.
-With `wsh` installed, you have the ability to view certain widgets from the remote machine as if it were your host +With `wsh` installed, you can view certain widgets from the remote machine as if it were your host🧰 Tools
🪛 LanguageTool
[style] ~28-~28: The phrase ‘have the ability to’ might be wordy. Consider using “can”.
Context: ...in/cmd/wsh). Withwsh
installed, you have the ability to view certain widgets from the remote ma...(HAS_THE_ABILITY_TO)
23-23
: Fix spacing in markdown formatting.There's a missing space between "of" and the backtick.
-The user-defined environment variables in the `cmd:env` entry of`connections.json` are injected into the session. +The user-defined environment variables in the `cmd:env` entry of `connections.json` are injected into the session.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/docs/connections.mdx
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/connections.mdx
[style] ~28-~28: The phrase ‘have the ability to’ might be wordy. Consider using “can”.
Context: ...in/cmd/wsh). With wsh
installed, you have the ability to view certain widgets from the remote ma...
(HAS_THE_ABILITY_TO)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Build Docsite
- GitHub Check: merge-gatekeeper
- GitHub Check: Build for TestDriver.ai
- GitHub Check: Analyze (go)
This explains how to use cmd:env to set environment variables and how to use the different forms of
cmd:initscript
torun initialization scripts on connections.