Skip to content
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: Adding documentation for cli command #464

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

YuvalBubnovsky
Copy link
Contributor

@YuvalBubnovsky YuvalBubnovsky commented Sep 24, 2024

User description

Description

This PR adds documentation for the workspace feature in the CLI, providing users with clear instructions on how to utilize this functionality effectively.

Fixes #458

Dependencies

No new dependencies introduced.

Future Improvements

Possibly adding examples for common use cases of the workspace feature in future documentation updates.

Mentions

@rajdip-b

Screenshots of relevant screens

N/A

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

PR Type

Documentation


Description

  • Added detailed documentation for the workspace command in the CLI, including descriptions and usage examples for subcommands such as create, delete, export, get, list, search, and update.
  • Provided comprehensive details on command arguments and options to guide users in managing workspaces effectively.

Changes walkthrough 📝

Relevant files
Documentation
workspace.md
Add documentation for `workspace` CLI command and subcommands

docs/cli/workspace.md

  • Added comprehensive documentation for the workspace CLI command.
  • Detailed subcommands: create, delete, export, get, list, search,
    update.
  • Included usage examples and options for each subcommand.
  • Provided descriptions for command arguments and options.
  • +180/-0 

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Add a note about confirmation and potential data loss for the delete command

    Add information about any confirmation prompts or safety measures for the delete
    command, as deleting a workspace is a significant action that could lead to data
    loss.

    docs/cli/workspace.md [44-58]

     ## `delete`
     
     ### Usage
     
     ```bash
     keyshade workspace delete <workspace slug>

    Arguments

    These are the arguments supported by the delete command:

    <workspace slug>

    Slug of the workspace which you want to delete.

    +### Note
    +
    +This command will prompt for confirmation before deleting the workspace. Use with caution as this action cannot be undone and will result in the loss of all associated data.
    +

    
    - [ ] **Apply this suggestion** <!-- /improve --apply_suggestion=0 -->
    
    <details><summary>Suggestion importance[1-10]: 9</summary>
    
    Why: This suggestion addresses a critical aspect of user interaction by highlighting the importance of confirmation prompts for potentially destructive actions, thereby preventing accidental data loss.
    
    
    </details></details></td><td align=center>9
    
    </td></tr><tr><td rowspan=3><strong>Enhancement</strong></td>
    <td>
    
    
    
    <details><summary>Add information about the export format and security considerations</summary>
    
    ___
    
    
    **For the <code>export</code> command, consider adding information about the format of the exported <br>data (e.g., JSON, YAML) and any security considerations for handling the exported <br>file.**
    
    [docs/cli/workspace.md [60-82]](https://github.com/keyshade-xyz/keyshade/pull/464/files#diff-b05e29e0937dd69ff54edad8518a573758815266e1c67c038074d2fa4481dc2dR60-R82)
    
    ```diff
     ## `export`
     
     ### Usage
     
     ```bash
     keyshade workspace export <workspace slug> [options]
    

    Arguments

    These are the arguments supported by the export command:

    <workspace slug>

    Slug of the workspace which you want to export.

    Options

    These are the options supported by the export command:

    -s, --save-to-file <file>

    Saves the exported data to a file. If not provided, the data will be printed to the console.

    +### Note
    +
    +The exported data is in JSON format. Please handle the exported file with care, as it may contain sensitive information. Consider encrypting the file or storing it in a secure location.
    +

    
    - [ ] **Apply this suggestion** <!-- /improve --apply_suggestion=1 -->
    
    <details><summary>Suggestion importance[1-10]: 8</summary>
    
    Why: Providing details about the export format and security considerations is important for users to handle sensitive data appropriately, enhancing both usability and security.
    
    
    </details></details></td><td align=center>8
    
    </td></tr><tr><td>
    
    
    
    <details><summary>Add more details about the expected input for the icon option</summary>
    
    ___
    
    
    **Consider adding a brief description or example for the <code>icon</code> option in the <code>create</code> and <br><code>update</code> commands. This could help users understand what type of input is expected <br>(e.g., a URL, a file path, or a predefined icon name).**
    
    [docs/cli/workspace.md [41-42]](https://github.com/keyshade-xyz/keyshade/pull/464/files#diff-b05e29e0937dd69ff54edad8518a573758815266e1c67c038074d2fa4481dc2dR41-R42)
    
    ```diff
     #### `-i, --icon <icon>`
     
    -The icon to be used for this workspace (optional).
    +The icon to be used for this workspace (optional). This could be a URL to an image, a file path, or a predefined icon name (e.g., "rocket", "star", "folder").
     
    
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion enhances user understanding by specifying the types of inputs expected for the icon option, which improves usability and reduces potential confusion.

    7
    Add usage examples for the list command options

    For the list command, consider adding examples of how to use the various options
    together, as this can help users understand how to effectively filter and sort the
    workspace list.

    docs/cli/workspace.md [100-130]

     ## `list`
     
     ### Usage
     
     ```bash
     keyshade workspace list [options]

    Options

    These are the options supported by the list command:

    -p, --page <int>

    Index of the page.

    -l, --limit <int>

    Total number of items per page.

    -o, --order <string>

    Order to sort by - either ascending (ASC) or descending (DESC).

    --sort, --sort <string>

    Field to sort by.

    -s, --search <string>

    Search term.

    +### Examples
    +
    +List the first 10 workspaces:
    +bash +keyshade workspace list -l 10 +
    +
    +List workspaces, sorted by name in descending order:
    +bash +keyshade workspace list --sort name -o DESC +
    +
    +Search for workspaces containing "project" in their name:
    +bash +keyshade workspace list -s project +
    +

    
    - [ ] **Apply this suggestion** <!-- /improve --apply_suggestion=3 -->
    
    <details><summary>Suggestion importance[1-10]: 6</summary>
    
    Why: Including examples for using command options can significantly aid users in understanding how to effectively utilize the command, though it is not as critical as addressing security or data loss concerns.
    
    
    </details></details></td><td align=center>6
    
    </td></tr></tr></tbody></table>
    
    >💡 Need additional feedback ? start a [PR chat](https://chromewebstore.google.com/detail/ephlnjeghhogofkifjloamocljapahnl)
    
    

    @YuvalBubnovsky
    Copy link
    Contributor Author

    @rajdip-b I feel like the bot's suggestion for adding the info about the delete command is wrong, from what I've seen in the code (apps/cli/src/commands/workspace/delete.workspace.ts), no such confirmation for deletion exists..

    I also think the suggestion for adding usage examples to list is redundent, but if you think this is a good idea - I'll add those.

    docs/cli/workspace.md Show resolved Hide resolved
    docs/cli/workspace.md Outdated Show resolved Hide resolved
    @rajdip-b
    Copy link
    Member

    @rajdip-b I feel like the bot's suggestion for adding the info about the delete command is wrong, from what I've seen in the code (apps/cli/src/commands/workspace/delete.workspace.ts), no such confirmation for deletion exists..

    I also think the suggestion for adding usage examples to list is redundent, but if you think this is a good idea - I'll add those.

    Hmm, I think you have a valid point in here. Cool, you can drop that suggestion!

    @YuvalBubnovsky
    Copy link
    Contributor Author

    @rajdip-b
    added 'into JSON format' and rebased.

    @rajdip-b rajdip-b merged commit 4aad8a2 into keyshade-xyz:develop Sep 25, 2024
    5 checks passed
    Meeran-Tofiq pushed a commit to Meeran-Tofiq/keyshade that referenced this pull request Sep 29, 2024
    Kiranchaudhary537 pushed a commit to Kiranchaudhary537/keyshade that referenced this pull request Oct 13, 2024
    rajdip-b pushed a commit that referenced this pull request Oct 24, 2024
    ## [2.6.0](v2.5.0...v2.6.0) (2024-10-24)
    
    ### 🚀 Features
    
    * **api:**  Add icon and remove description field from workspace ([#435](#435)) ([a99c0db](a99c0db))
    * **api-client:** Added workspace-membership and related tests ([#452](#452)) ([6a1c091](6a1c091))
    * **api-client:** Create controller for User module ([#484](#484)) ([f9d8e83](f9d8e83))
    * **api:** Add prod env schema in env file ([#436](#436)) ([21c3004](21c3004))
    * **api:** Add resend otp implementation ([#445](#445)) ([4dc6aa1](4dc6aa1))
    * **api:** Fetch total count of environments, [secure]s and variables in project ([#434](#434)) ([0c9e50a](0c9e50a))
    * **api:** Replace `projectId` with `name` and `slug` in workspace-role response.  ([#432](#432)) ([af06071](af06071))
    * **cli:** Add functionality to operate on Secrets ([#504](#504)) ([1b4bf2f](1b4bf2f))
    * **cli:** Add project command ([#451](#451)) ([70448e1](70448e1))
    * **cli:** Add workspace operations ([#441](#441)) ([ed38d22](ed38d22))
    * **cli:** implement commands to get, list, update, and delete, workspace roles ([#469](#469)) ([957ea8d](957ea8d))
    * **cli:** Implemented pagination support ([#453](#453)) ([feb1806](feb1806))
    * **cli:** Secret scan ([#438](#438)) ([85cb8ab](85cb8ab))
    * **cli:** Update environment command outputs ([f4af874](f4af874))
    * **platform:** Clearing email field after waitlisting the user email ([#481](#481)) ([256d659](256d659))
    * Remove project IDs from workspace role export data and update tests ([#448](#448)) ([8fdb328](8fdb328))
    * **web:** Configured extra check for waitlisted users already in the list and created toast message for them ([#492](#492)) ([2ddd0ef](2ddd0ef))
    * **web:** show the toast only when email add successfully ([#490](#490)) ([783c411](783c411))
    
    ### 🐛 Bug Fixes
    
    * **api,api-client:** Add environmentSlug in multiple places across the variable module ([#468](#468)) ([d970aff](d970aff))
    * **api:** Replace the id with slug in the global-search service ([#455](#455)) ([74804b1](74804b1))
    * **platform:** Fixed duplicate Google Logo UI fix  ([#450](#450)) ([fb0d6f7](fb0d6f7))
    * resolve footer website name cut-off or overlap issue ([#444](#444)) ([fe03ba2](fe03ba2))
    * **web:** Horizontal Scrolling issue on the website ([#440](#440)) ([655177b](655177b))
    
    ### 📚 Documentation
    
    * Add documentation for environment in CLI ([#462](#462)) ([dad7394](dad7394))
    * Add documentation for project in CLI ([#466](#466)) ([341fb32](341fb32))
    * Add documentation for scan in CLI ([#461](#461)) ([72281e6](72281e6))
    * Add documentation for workspace command ([#464](#464)) ([4aad8a2](4aad8a2))
    * Add instructions for resetting the local Prisma database ([#495](#495)) ([#501](#501)) ([b07ea17](b07ea17))
    * Added docker support documentation ([#465](#465)) ([bc04be4](bc04be4))
    * Added documentation for running the platform ([#473](#473)) ([8b8386b](8b8386b))
    * Added missing mappings to pages ([5de9fd8](5de9fd8))
    * Fix Documentation Hyperlink and update expired Discord invite link ([#496](#496)) ([5a10e39](5a10e39))
    * Updated CLI docs ([#460](#460)) ([c7e0f13](c7e0f13))
    
    ### 🔧 Miscellaneous Chores
    
    * Add more logging to Sentry init ([#470](#470)) ([de4925d](de4925d))
    * **api:** Optimise API docker image size ([#360](#360)) ([ea40dc1](ea40dc1))
    * **api:** Updated lockfile ([a968e78](a968e78))
    * **CI:** Add [secure] scan validation ([f441262](f441262))
    * **cli:** Update controller invocation in environment commands ([#477](#477)) ([596bd1a](596bd1a))
    * Minor changes to variables ([fe01ca6](fe01ca6))
    * **[secure]-scan:** Failing lint issues ([#507](#507)) ([48f45df](48f45df))
    * **[secure]-scan:** Formatted files ([5884833](5884833))
    * Update .env.example ([70ad4f7](70ad4f7))
    * Updated scripts ([9eb76a7](9eb76a7))
    * **web:** email validation ([#487](#487)) ([e8e737a](e8e737a))
    @rajdip-b
    Copy link
    Member

    🎉 This PR is included in version 2.6.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    DOCS: Add docs for workspace in CLI
    2 participants