The missing tool for 12 factor development environments
Project description
Dev tool
This tool provides a standard interface to manage 12 factor projects, regardless of the language or framework used. The main goal is to allow you to run a standard set of commands for common tasks, which just work™ is any supported repo, such as:
- Manage encrypted environment variables
- Run a command in an environment
- Start up a full webserver in an environment
- Connect to an environments database
Getting Started
The dev tool can be installed via pip:
pip install dev-rs
What are environments?
When manage an application, your normally require multiple environment, normally at least production, and development. On top of that, you'll probably need some form of local environment, so that you can run and test your application, with similar settings to production.
In environments, we attempt to capture all dependencies required to have your application up and running. The two key components are environment variables and external packages. The external packages used between each environment is the same, and the only difference are the environment variables.
In order to run a command within the default local environment, you can use the following:
dev run <command>
This will make sure that all packages are automatically installed, and all environment variables are exported for your command.
Sometimes you may want to run a one-off command in your local system, but connected to other production services (such as your database), or with production settings. To do this, you can run the following:
dev run -e prd <command>
External packages
Whenever you deploy your application to production, it's good practise to lock down external package to specific versions so you're able to recreate it if required. In development environments, you are often just left following a (hopefully) documented set of instructions to get your local system (mostly) in sync with production. These can be useful on a fresh system, but get complicated quickly when working on multiple products with different versions of packages required. Even worse, you might be gradually doing upgrades between OS releases across your team, and having conflict between the new packages, and the old one.
dev allows you to use various tools to maintain external packages:
- The Nix package manager resolves this issue with system
level packages, by downloading and making programs and libraries available
while within
dev runordev start. This can be used to automatically set up a certain version of nodejs, python or rust tools. - Your language-specific package manager, such as poetry, uv, or npm, can resolve this issue for all packages managed by the language's traditional package repository.
To set these up, you'll need to add this config to your .dev/config.toml:
[commands]
# Just use a nix environment
shell = 'nix develop -c -- "$@"'
# Just use a uv environment
shell = 'uv run -- "$@"'
# Use both nix and uv environments together
shell = 'nix develop -c -- uv run -- "$@"'
Environment variables
This is a hard one, particularly when it comes to local development. It's not uncommon to see a local .env file, manually copied between developers, across questionable mediums. If you're anything like me, you're probably getting major there must be a better way! syndrome.
In dev, we use instead manage environment variables the same way for
production and local development. We create an encrypted file per environment
that contains all environment variables required to run the application. This
allows you to track all changes in version control, as if they were regular
code changes. It also means you can include environment variable deployments
into CI/CD pipelines, rather than managing them manually.
To modify your environment variables using your default, you can use the command:
dev config edit [-e env]
Getting started
To set up the dev command in you repo, run the following command and follow the
prompts. This will set your .dev/config.toml with enough details to get you
started.
dev init
Commands
Run a command with environment variables
dev run [-e env] <command> [args...]
Start the development environment
This runs the command configured to start up the main service for this application. If you want to run multiple services, you can try configuring it to run something like process-compose.
dev start [-e env]
Manage configuration
Edit the environment configuration:
dev config edit [-e env]
Export the configuration:
dev config export [-e env] [--format <format>]
Available formats: raw, json, docker.
Connect to a PostgreSQL database
When working on an application that requires a PostgreSQL database, you
commonly need to run queries on databases across different environments. The
dev tools makes this easier by allowing you to track these credentials using
the DATABASE_URL environment variable. You can then use the following
commands to run an interactive psql prompt without needing to manually handle
database credentials across your team:
# Connect to the local environment's database
dev psql
# Connect to the dev environment's databse
dev psql -e dev
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dev_rs-0.2.7.tar.gz.
File metadata
- Download URL: dev_rs-0.2.7.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1d0792dbda69439cd5179563f060230e57ebd0e21663b879f29115d5c2ceef0
|
|
| MD5 |
3fd2e7c7eab77f2e77917a4a44b52a91
|
|
| BLAKE2b-256 |
a3da02c875fe83d666a911d899a16180a97fb55c5c8eaaa2df67e22fac886a28
|
File details
Details for the file dev_rs-0.2.7-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67317dc4eae63c0331f2ac56a937798428015cb206af1486d16bfe36cfc00915
|
|
| MD5 |
4726bf9c99ac3ab18166c24cebde9275
|
|
| BLAKE2b-256 |
1a0df3fe44bcc6b0ddc894c977e76f832ad331ea591d6a8357f1a1ad67f3064e
|
File details
Details for the file dev_rs-0.2.7-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b744eadd3d31c22adb2d6a7c478fb376823078ce74a6105405fa09ae9f2ea087
|
|
| MD5 |
7f9da3066fd32b6ca702bbd1a3303834
|
|
| BLAKE2b-256 |
b28a8c53816317e1ef207ef5abbab6fc51742579fc06e5799ea520b7aa0d3f7b
|
File details
Details for the file dev_rs-0.2.7-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1227a7ccf0951be9528676636a454e3462fcdcf4c656bc7c29412e7df0aaa078
|
|
| MD5 |
b5eeca97f4206cd620853fcc5493fb55
|
|
| BLAKE2b-256 |
237e0af148d4eda984a5cd0c8b0aaa9022f1c9291a08c89deaa2adfc122c8aa3
|
File details
Details for the file dev_rs-0.2.7-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a308f6a26eb47574cf2e7825428b58556401d4f21f4ce4f0f6edf74039affe4
|
|
| MD5 |
7e671be4d08a93a78a5e5f7cc9505213
|
|
| BLAKE2b-256 |
62ba091ec4d5d4ccafa634da91cf0b0a1f22eb31b79ca555b7ab6c878608df27
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b752e2c8aa89809dc2d3b98e91289e30f28292bc40ea1bf5d3cdec08aa30b467
|
|
| MD5 |
e9f8bcf1bf7b734c00c9f1eb890b0806
|
|
| BLAKE2b-256 |
23acacb555482c5a786bb47ea872ab34bcb84017ef6e1036e31b4974889bcf49
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
362e7a312e1701b9ecd6c156ad4629732bc37a04918f8914dd6e01b400d3e800
|
|
| MD5 |
4b34f151c0e8a170ac63def49de83945
|
|
| BLAKE2b-256 |
007c18e682ee0e5c6c12846cf6aa480d75c9532dbad9cd6164dd71ccf2346985
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e7ebe7275d71a8682ba7f7ef8aac02536da71fb51f10ad222030134c641bb2
|
|
| MD5 |
7216d1d6ba6bf1a6f2fe62664c29218e
|
|
| BLAKE2b-256 |
0995aff358599c1ac4a4a48c89b12cd4e343ad65f6592d6691a99696bdc4e8b4
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb4809649a586250a1154286216007ac7266cbd3e16a6eadf54626f18e9a9c0c
|
|
| MD5 |
b6c20a1ab2eab2e1144909452d21ac59
|
|
| BLAKE2b-256 |
c3be42c5e94587971d3f608cac9d063cb1b22c896baef5b23d6a3d539c4d5f92
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36e060b3878122ab4399240d9ad4921681701c56d559995a32aa4dcf6b48fdaa
|
|
| MD5 |
6a81b863f9262e02170c120b6946c276
|
|
| BLAKE2b-256 |
900ae124a68b0ec0b7a9912877f6d6b8bd3b5614463cbf6647fd2f670d7262ae
|
File details
Details for the file dev_rs-0.2.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30abb39bbfa7eb44bb057bfce1470a0314595ebbaf7dedcd9d490d0b32e400bb
|
|
| MD5 |
1cdd206b76ed4bf758984b679be4a25f
|
|
| BLAKE2b-256 |
c45ab80c0ab25eebe19ced0f5d694c875e1ba0bb20cb3b3b25ff23e049dfde32
|
File details
Details for the file dev_rs-0.2.7-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06564f7a28683b1bc384285430351f59219df34bae179aef1e0429c66ad7ce45
|
|
| MD5 |
f49eba80804e04d88c8365da81311de1
|
|
| BLAKE2b-256 |
5c9c84959f938be3897a0fb0822a1cfaff425bd0e2392716ef758fe01df6fa5a
|
File details
Details for the file dev_rs-0.2.7-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: dev_rs-0.2.7-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9658839b13d8e730a70aec39fb1c504ab3e489dfbeac32add66fbe2ce85a8e
|
|
| MD5 |
e5ca3bf263226072368c6473cfc9bfa1
|
|
| BLAKE2b-256 |
a7470b44b2b71a7ec2b056cfda7a8a9ebdff5232a60793fb320b724e2a6f09ee
|