Skip to main content

A cli to provision and manage local developer environments.

Project description

Actions Status Actions Status Actions Status Quality Gate Status CodeQL Codacy Badge freshenv PyPI version PyPI download month Linux macOS

Freshenv 🥗

freshenv is a command line application to provision and manage local developer environments. Build and develop your projects in completely isolated environments. Save, switch and restart your environments. Choose from a wide variety of flavours to get the developer tools you need.

download-17adc07640182f121.gif

The Story

This is a solution to a problem I have always had. I like my system to be clean, minimal and structured. It gets quite tricky to manage multiple projects on my on machine, projects tend to gather and are placed everywhere. Overtime managing system wide dependencies becomes a problem. It is quite easy to mess up a system setting or to keep track of a package I wont need tomorrow. This is why I built freshenv. It is a command line application which helps developers in running and managing completely isolated developer environments locally. It fetches and lets you run environment flavours in the form of docker containers which are preconfigured with tools and packages developer needs everyday. Read about the usage below. I imagine it would help developers like me. I hope you like it.

Flavours

freshenv flavours are different configurations for freshenv environments. You choose a flavour and provision it as an environment. A flavour can be a combination of operating systems, language packs, tools and application bundles. By default freshenv provisions you with a base flavour which runs ubuntu 18.04 and has packages like wget git python3-pip curl zsh wget nano zsh and more. The base flavour is a 260mb environment when provisioned. There are bigger flavours like devenv which runs on the latest ubuntu and has been loaded and configured with docker (run docker inside your freshenv environment), golang, python, node, java, a vscode server, build-essential automake make cmake sudo g++ wget git python3-pip curl zsh wget nano nodejs npm fonts-powerline and more. This environment is around 1.6gb large. Freshenv also gives you the option to provision a language based environment which contains necessary developer tools for that language. Checkout the usage section below on the flavours command to see a list of flavours available.

Custom Environments

Freshenv lets developers build and provision custom environments. A custom flavour is a configuration of the base operating system, packages to install and the command to run when your environment is provisioned. Custom flavours are configured in a config file placed under $HOME/.freshenv/freshenv. This file will be automatically created once you run freshenv build config. Below is an example of a custom flavour.

[MyEnv]
base="ubuntu"
install="apt update -y && apt upgrade -y && apt install arandr"
cmd="bash"

This feature is part of the 1.1.0 release and is not available in older versions.

Installation Linux

I recommend using the snap package manager to install freshenv.

  snap install freshenv 

  # give it access to the docker interface
  snap connect freshenv:docker docker:docker-daemon 

If you dont have or use snap, install the freshenv python package from pypi.

  pip install freshenv

I would recommend using pipx instead of pip to install cli applications on you machine.

Installation MacOS

I am trying to get freshenv on homebrew-core but I need more stars on the repository for them to accept my pull request. The self hosted tap is available on the repo raiyanyahya/homebrew-freshenv. Install the freshenv python package from a self hosted homebrew tap.

  brew tap raiyanyahya/freshenv
  brew install freshenv

Usage

Usage: fr [OPTIONS] COMMAND [ARGS]...

  A cli to provision and manage local developer environments.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  build      Build a custom freshenv flavour.
  check      Check system compatibility for running freshenv.
  clean      Remove all freshenv flavours and environments.
  flavours   Show all available flavours for provisioning.
  provision  Provision a developer environment.
  remove     Remove a freshenv environment.
  start      Resume working in an environment.
  view       View local freshenv managed environments.

Commands and Options

flavours

Usage: fr flavours [OPTIONS]

  Show all available flavours for provisioning.

Options:
  --help  Show this message and exit.

provision

Usage: fr provision [OPTIONS]

  Provision a developer environment.

Options:
  -f, --flavour TEXT   The flavour of the environment.  [default: base]
  -c, --command TEXT   The command to execute at startup of environment.
  -p, --ports INTEGER  List of ports to forward.  [default: 3000]
  -n, --name TEXT      Name of your environment.
  --help               Show this message and exit.

start

Usage: fr start [OPTIONS] NAME

  Resume working in an environment.

Options:
  --help  Show this message and exit.

remove

Usage: fr remove [OPTIONS] NAME

  Remove a freshenv environment.

Options:
  -f, --force      Force remove an environment.
  --help           Show this message and exit.

view

Usage: fr view [OPTIONS]

  View local freshenv managed environments.

Options:
  --help  Show this message and exit.

check

Usage: fr check [OPTIONS]

  Check system compatibility for running freshenv.

Options:
  --help  Show this message and exit.

clean

Usage: fr clean [OPTIONS]

  Remove all freshenv flavours and environments.

Options:
  -f, --force  Force remove freshenv flavours and environments.
  --help       Show this message and exit.

build

Usage: fr build [OPTIONS] FLAVOUR

  Build a custom freshenv flavour.

Options:
  -l, --logs  Show build logs.
  --help      Show this message and exit

License

MIT

Contributing

Contributions are always welcome!

See contributing.md for ways to get started. Please adhere to this project's code of conduct.

Contact

Contact me through email at contact@freshenv.io

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

freshenv-1.1.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

freshenv-1.1.2-py2.py3-none-any.whl (13.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file freshenv-1.1.2.tar.gz.

File metadata

  • Download URL: freshenv-1.1.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for freshenv-1.1.2.tar.gz
Algorithm Hash digest
SHA256 96d52d3c7c0ec5c82d95cd4ef74f2804caa724708ff34052e4e5937cc0c9fb9d
MD5 116d24f569fa4f7faf1038fbb641ef4d
BLAKE2b-256 d4d369a17385d0a2ae9ca9065de8d9c35740fe01582d7f55bbcc3441fa6cae0b

See more details on using hashes here.

File details

Details for the file freshenv-1.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: freshenv-1.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for freshenv-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8806cf5eec06ecaf3d625abfa5525123a7f5d2688a5795deba1448b0a3d3b61a
MD5 d87839c4983ea6231fe34f2205999744
BLAKE2b-256 1920e307a7ca384b4edee2c80a3954dc59b165444dc56a1fdf4cc1f103fd36c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page