# Didc install script

**URL:** <https://forum.dfinity.org/t/didc-install-script/6140>\
**Category:** Developers\
**Created:** [July 27, 2021, 5:32pm UTC](https://forum.dfinity.org/t/didc-install-script/6140 "2021-07-27T17:32:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [July 27, 2021, 5:32pm UTC](https://forum.dfinity.org/t/didc-install-script/6140/1 "2021-07-27T17:32:05Z")

</div>

Just a convenience script I threw together to download the latest release of didc from the command line

```auto
unameOut="$(uname -s)"
case "${unameOut}" in
    Linux*) machine=Linux;;
    Darwin*) machine=Mac;;
    *) machine="UNKNOWN:${unameOut}"
esac

release=$(curl --silent "https://api.github.com/repos/dfinity/candid/releases/latest" | grep -e '"tag_name"' | cut -c 16-25)

if [${machine} = "Mac"]
then
  echo "Downloading didc for Mac to ~/bin/didc"
  curl -fsSL https://github.com/dfinity/candid/releases/download/${release}/didc-macos > ~/bin/didc
elif [${machine} = "Linux"]
then
  echo "Downloading didc for Linux to ~/bin/didc"
  curl -fsSL https://github.com/dfinity/candid/releases/download/${release}/didc-linux64 > ~/bin/didc
else
  echo "Could not detect a supported operating system. Please note that didc is currently only supported for Mac and Linux"
fi

date

```

---

<div class="post-metadata">

**Author:** ![Gabriel](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gabriel/32/546_2.png) [@Gabriel](https://forum.dfinity.org/u/Gabriel)\
**Post date:** [July 25, 2023, 12:42pm UTC](https://forum.dfinity.org/t/didc-install-script/6140/2 "2023-07-25T12:42:15Z")

</div>

Just an updated script  
Note: this will download both didc and ic-repl, remove what you don’t need.

```auto
if ! didc -V &> /dev/null
then
    unameOut="$(uname -s)"
    case "${unameOut}" in
        Linux*) machine=Linux;;
        Darwin*) machine=Mac;;
        *) machine="UNKNOWN:${unameOut}"
    esac

    release=$(curl --silent "https://api.github.com/repos/dfinity/candid/releases/latest" | grep -e '"tag_name"' | cut -c 16-25)
    repl_release=0.3.10

    if [${machine} = "Mac"]
    then
      echo "Downloading didc && ic-repl for Mac to ~/bin/didc"
      curl -fsSL --create-dirs https://github.com/dfinity/candid/releases/download/${release}/didc-macos > /usr/local/bin/didc
      curl -fsSL --create-dirs https://github.com/chenyan2002/ic-repl/releases/download/${repl_release}/ic-repl-macos > /usr/local/bin/ic-repl
      chmod +x /usr/local/bin/didc
      chmod +x /usr/local/bin/ic-repl

    elif [${machine} = "Linux"]
    then
      echo "Downloading didc && ic-repl for Linux to $HOME/bin/didc"
      curl -fsSL https://github.com/dfinity/candid/releases/download/${release}/didc-linux64 > $HOME/bin/didc
      chmod +x $HOME/bin/didc
      curl -fsSL https://github.com/chenyan2002/ic-repl/releases/download/${repl_release}/ic-repl-linux64 > $HOME/bin/ic-repl
      chmod +x $HOME/bin/ic-repl
    else
      echo "Could not detect a supported operating system. Please note that didc && ic-repl is currently only supported for Mac and Linux"
    fi

    date
fi
```

---

<div class="post-metadata">

**Author:** ![WarTech9](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/wartech9/32/14405_2.png) [@WarTech9](https://forum.dfinity.org/u/WarTech9)\
**Post date:** [December 15, 2023, 6:18pm UTC](https://forum.dfinity.org/t/didc-install-script/6140/3 "2023-12-15T18:18:59Z")

</div>

Small update to Gabriel’s script to change the URL to download `ic-repl` since it moved repos.

```auto
if ! didc -V &> /dev/null
then
    unameOut="$(uname -s)"
    case "${unameOut}" in
        Linux*) machine=Linux;;
        Darwin*) machine=Mac;;
        *) machine="UNKNOWN:${unameOut}"
    esac

    release=$(curl --silent "https://api.github.com/repos/dfinity/candid/releases/latest" | grep -e '"tag_name"' | cut -c 16-25)
    repl_release=0.3.10

    if [${machine} = "Mac"]
    then
      echo "Downloading didc && ic-repl for Mac to ~/bin/didc"
      curl -fsSL --create-dirs https://github.com/dfinity/candid/releases/download/${release}/didc-macos > /usr/local/bin/didc
      curl -fsSL --create-dirs https://github.com/dfinity/ic-repl/releases/download/${repl_release}/ic-repl-macos > /usr/local/bin/ic-repl
      chmod +x /usr/local/bin/didc
      chmod +x /usr/local/bin/ic-repl

    elif [${machine} = "Linux"]
    then
      echo "Downloading didc && ic-repl for Linux to $HOME/bin/didc"
      curl -fsSL https://github.com/dfinity/candid/releases/download/${release}/didc-linux64 > $HOME/bin/didc
      chmod +x $HOME/bin/didc
      curl -fsSL https://github.com/dfinity/ic-repl/releases/download/${repl_release}/ic-repl-linux64 > $HOME/bin/ic-repl
      chmod +x $HOME/bin/ic-repl
    else
      echo "Could not detect a supported operating system. Please note that didc && ic-repl is currently only supported for Mac and Linux"
    fi

    date
fi

```
