Can I get codespaces to be created by AI? #181515
Replies: 4 comments 4 replies
-
|
You don’t “convert” an existing repo into a dev-container repo. Inside your repository root, create: .devcontainer/ Inside it, create: Your provided config goes exactly here: { |
Beta Was this translation helpful? Give feedback.
-
|
Codespaces supports a feature recently added: you can open a Codespace directly from an issue and launch GitHub Copilot (in “agent mode”) inside it. That means you can have an AI assistant inspect the issue + repo context and start suggesting or generating code inside a fresh Codespace. Because Codespaces environments are defined with configuration-as-code (via a devcontainer.json, Dockerfile, etc.), you could use an AI tool (or LLM prompt) to generate or suggest that configuration automatically. Once you commit that to your repo you or collaborators can spawn Codespaces on demand. You can also combine AI code-generation tools with Codespaces: e.g. inside a Codespace (or right after you create it) an AI like Copilot can help you scaffold files, write boilerplate, refactor, etc |
Beta Was this translation helpful? Give feedback.
-
|
Short answer: AI can help you generate the devcontainer config, but it won’t magically spin up Codespaces for you. The actual creation still goes through GitHub (UI / CLI / API). For what you’re trying to do (same 1. Use a template repository (most straightforward)Create one repo that only contains your dev setup, for example: with something like: {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers-extra/features/aws-cli:1": {},
"ghcr.io/devcontainers-extra/features/pipx:1": {},
"ghcr.io/devcontainers-extra/features/fd:1": {},
"ghcr.io/devcontainers-extra/features/github-cli:1": {},
"ghcr.io/devcontainers-extra/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/ruff:1": {},
"ghcr.io/devcontainers-extra/features/uv:1": {},
"ghcr.io/devcontainers-extra/features/git-lfs:1": {},
"ghcr.io/devcontainers-extra/features/neovim-apt-get:1": {},
"ghcr.io/devcontainers-extra/features/aws-cdk:2": {},
"ghcr.io/devcontainers-extra/features/actionlint:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"ms-vsliveshare.vsliveshare"
]
}
}
}Then for every new data product:
Codespaces will automatically pick up 2. Automate repo + devcontainer creation (scripting + AI)If you really want an “AI-driven” flow, you can glue a few things together:
So AI’s job is: generate the devcontainer config, your script’s job is: create repo + push + call Codespaces API. 3. “Global” developer environment via dotfilesIf most of what you’re doing is tooling (CLI, aliases, etc.), you can also:
This doesn’t fully replace the devcontainer, but it cuts down how much you repeat. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
And how do I make it so that repo is initialised by a devcontainer.json like:
I need to do this again and again with several data products, so I am looking for a way to streamline this!
Beta Was this translation helpful? Give feedback.
All reactions