dev-code 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["**"]
6
+ pull_request:
7
+ branches: ["**"]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, windows-latest, macos-latest]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v5
25
+
26
+ - name: Run tests
27
+ run: uvx tox -e py312
28
+
29
+ - name: Upload coverage to Codecov
30
+ if: matrix.os == 'ubuntu-latest'
31
+ uses: codecov/codecov-action@v5
32
+ with:
33
+ token: ${{ secrets.CODECOV_TOKEN }}
34
+ files: coverage.xml
35
+ fail_ci_if_error: false
@@ -0,0 +1,26 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - uses: astral-sh/setup-uv@v5
21
+
22
+ - name: Build package
23
+ run: uv build
24
+
25
+ - name: Publish to PyPI
26
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,176 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python
3
+
4
+ ### Python ###
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ #poetry.lock
107
+
108
+ # pdm
109
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110
+ #pdm.lock
111
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112
+ # in version control.
113
+ # https://pdm.fming.dev/#use-with-ide
114
+ .pdm.toml
115
+
116
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117
+ __pypackages__/
118
+
119
+ # Celery stuff
120
+ celerybeat-schedule
121
+ celerybeat.pid
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+
166
+ ### Python Patch ###
167
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168
+ poetry.toml
169
+
170
+ # ruff
171
+ .ruff_cache/
172
+
173
+ # LSP config files
174
+ pyrightconfig.json
175
+
176
+ # End of https://www.toptal.com/developers/gitignore/api/python
dev_code-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nasser Alansari
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: dev-code
3
+ Version: 0.1.0
4
+ License-File: LICENSE
5
+ Requires-Python: >=3.10
@@ -0,0 +1,151 @@
1
+ # dev-code
2
+
3
+ ```text
4
+ _ _
5
+ | | | |
6
+ __| | _____ ________ ___ ___ __| | ___
7
+ / _` |/ _ \ \ / /______/ __/ _ \ / _` |/ _ \
8
+ | (_| | __/\ V / | (_| (_) | (_| | __/
9
+ \__,_|\___| \_/ \___\___/ \__,_|\___|
10
+ project · editor · container — simplified
11
+ ```
12
+
13
+ [![Coverage](https://codecov.io/gh/dacrystal/dev-code/branch/main/graph/badge.svg)](https://codecov.io/gh/dacrystal/dev-code)
14
+
15
+ [![PyPI version](https://img.shields.io/pypi/v/dev-code)](https://pypi.org/project/dev-code/)
16
+ [![Python 3.10+](https://img.shields.io/pypi/pyversions/dev-code)](https://pypi.org/project/dev-code/)
17
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
18
+
19
+ **One command. Any project. The right devcontainer.**
20
+
21
+ `dev-code` is a CLI that opens any project in VS Code inside a devcontainer — instantly, using reusable templates you define once. No more hunting config files. No more copy-pasting `devcontainer.json`.
22
+
23
+ ---
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ pip install dev-code
29
+ ```
30
+
31
+ Or run without installing via **uvx**:
32
+
33
+ ```bash
34
+ uvx dev-code
35
+ ```
36
+
37
+ **Tip:** Add an alias for the fastest workflow:
38
+
39
+ ```bash
40
+ alias dev-code="uvx dev-code"
41
+ ```
42
+
43
+ > Requires: VS Code with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + Docker
44
+
45
+ ---
46
+
47
+ ## Quick-start
48
+
49
+ ```bash
50
+ # 1. Seed your first template
51
+ dev-code init
52
+
53
+ # 2. Open any project in a devcontainer
54
+ dev-code open dev-code ~/projects/my-app
55
+
56
+ # That's it. VS Code opens, container spins up.
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Features
62
+
63
+ - **One-command open** — `dev-code open <template> <path>` launches VS Code in a devcontainer instantly
64
+ - **Reusable templates** — define your devcontainer once, reuse it across every project
65
+ - **Built-in template** — ships with the `dev-code` template out of the box
66
+ - **Custom templates** — create and manage your own with `dev-code new`
67
+ - **File sync on launch** — copy credentials, configs, and secrets into the container via a `dev-code` customization block in `devcontainer.json`
68
+ - **WSL support** — works natively on Windows Subsystem for Linux
69
+ - **Container dashboard** — see all running devcontainers with `dev-code ps`
70
+ - **Works with existing config** — no new format, just standard `devcontainer.json`
71
+
72
+ ---
73
+
74
+ ## Commands
75
+
76
+ | Command | Description |
77
+ |---|---|
78
+ | `dev-code init` | Seed the built-in `dev-code` template into your template directory |
79
+ | `dev-code open <template> <path>` | Open a project in VS Code using a devcontainer template |
80
+ | `dev-code new <name> [base]` | Create a new template (optionally based on an existing one) |
81
+ | `dev-code edit [template]` | Open a template for editing in VS Code |
82
+ | `dev-code list [--long]` | List available templates |
83
+ | `dev-code ps` | Show running devcontainers |
84
+
85
+ ### Options
86
+
87
+ | Flag | Command | Description |
88
+ |---|---|---|
89
+ | `--dry-run` | `open` | Print the devcontainer URI and copy plan without executing |
90
+ | `--container-folder` | `open` | Override the in-container workspace path |
91
+ | `--timeout` | `open` | Seconds to wait for container to start (default: 300) |
92
+ | `--edit` | `new` | Open the new template for editing immediately after creation |
93
+ | `--long` | `list` | Show full paths alongside template names |
94
+ | `-v, --verbose` | all | Enable debug logging |
95
+
96
+ ---
97
+
98
+ ## Templates
99
+
100
+ Templates are directories containing a `.devcontainer/devcontainer.json` file. They live in `~/.local/share/dev-code/templates/` by default (XDG-compliant), or wherever `$DEVCODE_TEMPLATE_DIR` points.
101
+
102
+ ### Get started
103
+
104
+ ```bash
105
+ dev-code init # copies the built-in dev-code template
106
+ dev-code new my-python # creates a new template from the default base
107
+ dev-code new my-node dev-code # creates a new template based on dev-code
108
+ dev-code edit my-python # open the template in VS Code to customise it
109
+ ```
110
+
111
+ ### File sync — copy files into the container on launch
112
+
113
+ Add a `customizations.dev-code.cp` section to your `devcontainer.json` to copy files from your host into the running container:
114
+
115
+ ```json
116
+ {
117
+ "customizations": {
118
+ "dev-code": {
119
+ "cp": [
120
+ {
121
+ "source": "${localEnv:HOME}/.claude/credentials.json",
122
+ "target": "/home/vscode/.claude/credentials.json"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ Supports `owner`, `group`, `permissions`, and `Override` fields per entry. Use `source/.` to copy the contents of a directory.
131
+
132
+ ---
133
+
134
+ ## Contributing
135
+
136
+ Contributions are welcome! To get started:
137
+
138
+ ```bash
139
+ git clone https://github.com/dacrystal/dev-code
140
+ dev-code open dev-code ./dev-code
141
+ ```
142
+
143
+ The repo includes a `dev-code` devcontainer — open it with itself.
144
+
145
+ Please open an issue before submitting large changes.
146
+
147
+ ---
148
+
149
+ ## License
150
+
151
+ MIT
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["hatchling", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "dev-code"
7
+ dynamic = ["version"]
8
+ requires-python = ">=3.10"
9
+ dependencies = []
10
+
11
+ [project.scripts]
12
+ dev-code = "dev_code:main"
13
+
14
+ [tool.hatch.version]
15
+ source = "vcs"
16
+
17
+ [tool.hatch.build.targets.wheel]
18
+ force-include = {"src/dev_code.py" = "dev_code.py", "src/templates" = "dev_code_templates"}
19
+
20
+ [tool.pytest.ini_options]
21
+ testpaths = ["tests"]
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "pytest>=7.0.1",
26
+ "pyfiglet>=1.0.4",
27
+ "pytest-cov>=4.0",
28
+ "tox>=4.0",
29
+ ]