# devenv **Repository Path**: anydev/devenv ## Basic Information - **Project Name**: devenv - **Description**: 一个快速、声明式、可重现且可组合的开发者环境工具。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-18 - **Last Updated**: 2025-09-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

devenv logo

# [devenv.sh](https://devenv.sh) - Fast, Declarative, Reproducible, and Composable Developer Environments [![Built with Nix](https://img.shields.io/static/v1?logo=nixos&logoColor=white&label=&message=Built%20with%20Nix&color=41439a)](https://builtwithnix.org) [![Discord channel](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Finvites%2FnaMgvexb6q%3Fwith_counts%3Dtrue&query=%24.approximate_member_count&logo=discord&logoColor=white&label=Discord%20users&color=green&style=flat)](https://discord.gg/naMgvexb6q) ![License: Apache 2.0](https://img.shields.io/github/license/cachix/devenv) [![Version](https://img.shields.io/github/v/release/cachix/devenv?color=green&label=version&sort=semver)](https://github.com/cachix/devenv/releases) [![CI](https://github.com/cachix/devenv/actions/workflows/buildtest.yml/badge.svg)](https://github.com/cachix/devenv/actions/workflows/buildtest.yml?branch=main) Running ``devenv init`` generates ``devenv.nix``: ```nix { pkgs, ... }: { # https://devenv.sh/basics/ env.GREET = "devenv"; # https://devenv.sh/packages/ packages = [ pkgs.git ]; enterShell = '' hello ''; # https://devenv.sh/tests/ enterTest = '' echo "Running tests" git --version | grep --color=auto "${pkgs.git.version}" ''; # https://devenv.sh/languages/ languages.nix.enable = true; # https://devenv.sh/scripts/ scripts.hello.exec = "echo hello from $GREET"; # https://devenv.sh/services/ services.postgres.enable = true; # https://devenv.sh/git-hooks/ git-hooks.hooks.shellcheck.enable = true; # https://devenv.sh/processes/ processes.ping.exec = "ping localhost"; } ``` And ``devenv shell`` activates the environment. ## Commands ``` $ devenv https://devenv.sh 1.6.0: Fast, Declarative, Reproducible, and Composable Developer Environments Usage: devenv [OPTIONS] [COMMAND] Commands: init Scaffold devenv.yaml, devenv.nix, .gitignore and .envrc. generate Generate devenv.yaml and devenv.nix using AI shell Activate the developer environment. https://devenv.sh/basics/ update Update devenv.lock from devenv.yaml inputs. http://devenv.sh/inputs/ search Search for packages and options in nixpkgs. https://devenv.sh/packages/#searching-for-a-file info Print information about this developer environment. up Start processes in the foreground. https://devenv.sh/processes/ processes Start or stop processes. https://devenv.sh/processes/ tasks Run tasks. https://devenv.sh/tasks/ test Run tests. http://devenv.sh/tests/ container Build, copy, or run a container. https://devenv.sh/containers/ inputs Add an input to devenv.yaml. https://devenv.sh/inputs/ repl Launch an interactive environment for inspecting the devenv configuration. gc Delete previous shell generations. See https://devenv.sh/garbage-collection build Build any attribute in devenv.nix. direnvrc Print a direnvrc that adds devenv support to direnv. See https://devenv.sh/automatic-shell-activation. version Print the version of devenv. help Print this message or the help of the given subcommand(s) Options: -V, --version Print version information and exit -v, --verbose Enable additional debug logs. -q, --quiet Silence all logs --log-format Configure the output format of the logs. [default: cli] Possible values: - cli: The default human-readable log format used in the CLI - tracing-full: A verbose structured log format used for debugging - tracing-pretty: A pretty human-readable log format used for debugging -j, --max-jobs Maximum number of Nix builds at any time. [default: 8] -u, --cores Maximum number CPU cores being used by a single build. [default: 2] -s, --system [default: x86_64-linux] -i, --impure Relax the hermeticity of the environment. --no-eval-cache Disable caching of Nix evaluation results. --refresh-eval-cache Force a refresh of the Nix evaluation cache. --offline Disable substituters and consider all previously downloaded files up-to-date. -c, --clean [...] Ignore existing environment variables when entering the shell. Pass a list of comma-separated environment variables to let through. --nix-debugger Enter the Nix debugger on failure. -n, --nix-option Pass additional options to nix commands. These options are passed directly to Nix using the --option flag. See `man nix.conf` for the full list of available options. Examples: --nix-option sandbox false --nix-option keep-outputs true --nix-option system x86_64-darwin -o, --override-input Override inputs in devenv.yaml. Examples: --override-input nixpkgs github:NixOS/nixpkgs/nixos-unstable --override-input nixpkgs path:/path/to/local/nixpkgs -O, --option