这是indexloc提供的服务,不要输入任何密码
Skip to content

[FEAT]: Automate Port Forwarding for GitHub Codespaces using gh CLI #2034

@MrSimonC

Description

@MrSimonC

What would you like to see?

Hi Anything LLM maintainers,

I'm excited to share my first open-source contribution in a long time! I've been working on improving the development experience for GitHub Codespaces, and I'd love to get your feedback on my proposed solution.

Background:

As you may know, the .devcontainer/README.md file mentions the need to manually set the port visibility to "Public" when running the server for the first time in GitHub Codespaces. I've found a way to automate this process using the gh CLI tool.

Proposal:

I've updated the .devcontainer/Dockerfile to install the gh CLI tool as part of the container post-create command, only when running in GitHub Codespaces. I've also modified the tasks.json file to poll the port until it's redirected and then apply the public property using the gh CLI.

Key Benefits:

  • Simplified development experience for GitHub Codespaces users - just open in GitHub Codespaces, wait, then run the collector, server and frontend! very clean.
  • Automated port forwarding eliminates the need for manual configuration
  • Improved reliability and consistency in the development environment

Changes:

Testing:

I've tested this solution extensively in GitHub Codespaces (note: but not locally). The automation works well, and the developer experience is significantly improved.

Request:

I'd love to get your feedback on this proposal. Is the code clean and maintainable? Are there any potential issues or improvements I've missed? If everything looks good, I'd be thrilled to see this merged into the main branch!

Additional Information:

  • I've tried to follow the existing code style and conventions in the project.
  • I'm not attached to my implementation; if there's a better way to achieve this, I'm happy to learn and improve.

Please let me know if this is something you'd like to explore further, and I'll be happy to answer any questions or provide additional information.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions