Skip to content

jetpack-io/devbox

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

…idden) (#901)

## Summary

This provides a "single view" listing of all available commands.
Sometimes I find myself wanting a global view to quickly find something.

credit to chatgpt for writing some of this.

Its a hidden command, since the printed view is not polished.

## How was it tested?

```
❯ devbox all
devbox              Instant, easy, predictable development environments
	add <pkg>...        Add a new package to your devbox
	all                 List all commands, including hidden ones
	cloud               [Preview] Remote development environments on the cloud
		forward <local-port>:<remote-port> | :<remote-port> | stop | list[Preview] Port forward a local port to a remote devbox cloud port
			list                List all port forwards managed by devbox
			stop                Stop all port forwards managed by devbox
		init                Create a Cloud VM without connecting to its shell
		shell               [Preview] Shell into a cloud environment that matches your local devbox environment
	completion          Generate the autocompletion script for the specified shell
		bash                Generate the autocompletion script for bash
		fish                Generate the autocompletion script for fish
		powershell          Generate the autocompletion script for powershell
		zsh                 Generate the autocompletion script for zsh
	gen-docs <path>     [Internal] Generate documentation for the CLI
	generate            Generate supporting files for your project
		debug
		devcontainer        Generate Dockerfile and devcontainer.json files under .devcontainer/ directory
		direnv              Generate a .envrc file that integrates direnv with this devbox project
		dockerfile          Generate a Dockerfile that replicates devbox shell
		ssh-config          Generate ssh config to connect to devbox cloud
	global              Manage global devbox packages
		add <pkg>...        Add a new global package
		list                List global packages
		pull <file> | <url> Pull a global config from a file or URL
		rm <pkg>...         Remove a global package
		shellenv            Print shell commands that add global Devbox packages to your PATH
	help [command]      Help about any command
	info <pkg>          Display package info
	init [<dir>]        Initialize a directory as a devbox project
	install             Install all packages mentioned in devbox.json
	log <event-name> [<event-specific-args>]
	plan                Preview the plan used to build your environment
	rm <pkg>...         Remove a package from your devbox
	run [<script> | <cmd>]Run a script or command in a shell with access to your packages
	services            Interact with devbox services
		ls                  List available services
		restart [service]...Restart service. If no service is specified, restarts all services
		start [service]...  Start service. If no service is specified, starts all services
		stop [service]...   Stop service. If no service is specified, stops all services
		up                  Starts process manager with all supported services
	setup               Setup devbox dependencies
		nix                 Install Nix
	shell               Start a new shell with access to your packages
	shellenv            Print shell commands that add Devbox packages to your PATH
	version             Print version information
		update              Update devbox launcher and binary
```
677ce02

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Devbox logo.

Devbox

Instant, easy, and predictable development environments

Join Discord License: Apache 2.0 version tests Built with Devbox

What is it?

Devbox is a command-line tool that lets you easily create isolated shells for development. You start by defining the list of packages required by your development environment, and devbox uses that definition to create an isolated environment just for your application.

In practice, Devbox works similar to a package manager like yarn – except the packages it manages are at the operating-system level (the sort of thing you would normally install with brew or apt-get).

Devbox was originally developed by jetpack.io and is internally powered by nix.

Demo

You can try out Devbox in your browser using the button below:

Open In Devbox.sh

The example below creates a development environment with python 2.7 and go 1.18, even though those packages are not installed in the underlying machine:

screen cast

Installing Devbox

Use the following install script to get the latest version of Devbox:

curl -fsSL https://get.jetpack.io/devbox | bash

Read more on the Devbox docs.

Benefits

A consistent shell for everyone on the team

Declare the list of tools needed by your project via a devbox.json file and run devbox shell. Everyone working on the project gets a shell environment with the exact same version of those tools.

Try new tools without polluting your laptop

Development environments created by Devbox are isolated from everything else in your laptop. Is there a tool you want to try without making a mess? Add it to a Devbox shell, and remove it when you don't want it anymore – all while keeping your laptop pristine.

Don't sacrifice speed

Devbox can create isolated environments right on your laptop, without an extra-layer of virtualization slowing your file system or every command. When you're ready to ship, it'll turn it into an equivalent container – but not before.

Good-bye conflicting versions

Are you working on multiple projects, all of which need different versions of the same binary? Instead of attempting to install conflicting versions of the same binary on your laptop, create an isolated environment for each project, and use whatever version you want for each.

Take your environment with you

Devbox's dev environments are portable. We make it possible to declare your environment exactly once, and use that single definition in several different ways, including:

  • A local shell created through devbox shell
  • A devcontainer you can use with VSCode
  • A Dockerfile so you can build a production image with the exact same tools you used for development.
  • A remote development environment in the cloud that mirrors your local environment.

Quickstart: Fast, Deterministic Shell

In this quickstart we’ll create a development shell with specific tools installed. These tools will only be available when using this Devbox shell, ensuring we don’t pollute your machine.

  1. Open a terminal in a new empty folder.

  2. Initialize Devbox:

    devbox init

    This creates a devbox.json file in the current directory. You should commit it to source control.

  3. Add command-line tools from Nix Packages. For example, to add Python 3.10:

    devbox add python310
  4. Your devbox.json file keeps track of the packages you've added, it should now look like this:

    {
       "packages": [
          "python310"
        ]
    }
  5. Start a new shell that has these tools installed:

    devbox shell

    You can tell you’re in a Devbox shell (and not your regular terminal) because the shell prompt changed.

  6. Use your favorite tools.

    In this example we installed Python 3.10, so let’s use it.

    python --version
  7. Your regular tools are also available including environment variables and config settings.

    git config --get user.name
  8. To exit the Devbox shell and return to your regular shell:

    exit

Read more on the Devbox docs Quickstart.

Additional commands

devbox help - see all commands

See the CLI Reference for the full list of commands.

Join our Developer Community

Contributing

Devbox is an opensource project so contributions are always welcome. Please read our contributing guide before submitting pull requests.

Related Work

Thanks to Nix for providing isolated shells.

Translation

License

This project is proudly open-source under the Apache 2.0 License