DEV Community

Cover image for 🐚 Install all your Atom packages πŸ“¦ from a file
Carlos Chacin β˜•πŸ‘½
Carlos Chacin β˜•πŸ‘½

Posted on β€’ Originally published at carloschac.in on

2 1

🐚 Install all your Atom packages πŸ“¦ from a file

Every time I have to set up a new computer, I have to remember the Atompackages that I was using before and start installing them one by one.

Recently, I discovered that Atom comes with the Atom Package Manager or apmthat allows you to install Atom Packages from the terminal:

$ apm install asciidoc-preview

Enter fullscreen mode Exit fullscreen mode

But the same tool also allows us to list the currently installed packages:

$ apm list


Built-in Atom Packages (93)
β”œβ”€β”€ atom-dark-syntax@0.29.1
β”œβ”€β”€ atom-dark-ui@0.53.3
β”œβ”€β”€ atom-light-syntax@0.29.1
β”œβ”€β”€ atom-light-ui@0.46.3
β”œβ”€β”€ base16-tomorrow-dark-theme@1.6.0
β”œβ”€β”€ base16-tomorrow-light-theme@1.6.0
β”œβ”€β”€ one-dark-ui@1.12.5
.
.
.
β”œβ”€β”€ language-xml@0.35.3
└── language-yaml@0.32.0

Community Packages (10) ~/.atom/packages
β”œβ”€β”€ asciidoc-assistant@0.2.3
β”œβ”€β”€ asciidoc-image-helper@1.0.1
β”œβ”€β”€ asciidoc-preview@2.13.1
β”œβ”€β”€ atom-beautify@0.33.4
β”œβ”€β”€ atom-runner@2.7.1
β”œβ”€β”€ autocomplete-asciidoc@0.1.2
β”œβ”€β”€ intellij-idea-keymap@0.2.3
β”œβ”€β”€ jekyll@2.1.0
β”œβ”€β”€ language-asciidoc@1.11.0
└── platformio-ide-terminal@2.10.0

Enter fullscreen mode Exit fullscreen mode

The output is vast since it includes all the built-in packages plus theinstalled ones. Let’s filter only the installed:

$ apm list --installed


Community Packages (10) ~/.atom/packages
β”œβ”€β”€ asciidoc-assistant@0.2.3
β”œβ”€β”€ asciidoc-image-helper@1.0.1
β”œβ”€β”€ asciidoc-preview@2.13.1
β”œβ”€β”€ atom-beautify@0.33.4
β”œβ”€β”€ atom-runner@2.7.1
β”œβ”€β”€ autocomplete-asciidoc@0.1.2
β”œβ”€β”€ intellij-idea-keymap@0.2.3
β”œβ”€β”€ jekyll@2.1.0
β”œβ”€β”€ language-asciidoc@1.11.0
└── platformio-ide-terminal@2.10.0

Enter fullscreen mode Exit fullscreen mode

A lot better, but we will also need to remove the noise from the output:

$ apm list --installed --bare


asciidoc-assistant@0.2.3
asciidoc-image-helper@1.0.1
asciidoc-preview@2.13.1
atom-beautify@0.33.4
atom-runner@2.7.1
autocomplete-asciidoc@0.1.2
intellij-idea-keymap@0.2.3
jekyll@2.1.0
language-asciidoc@1.11.0
platformio-ide-terminal@2.10.0

Enter fullscreen mode Exit fullscreen mode

If we want to remove the specific versions to tell apm that we want the latestversions instead, we can filter the output with grep:

$ apm list --installed --bare | grep '^[^@]\+' -o


asciidoc-assistant
asciidoc-image-helper
asciidoc-preview
atom-beautify
atom-runner
autocomplete-asciidoc
intellij-idea-keymap
jekyll
language-asciidoc
platformio-ide-terminal

Enter fullscreen mode Exit fullscreen mode

Now that we have a clean list of our installed packages, we can store it in atext file:

$ apm list --installed --bare | grep '^[^@]\+' -o > atom-packages.txt

Enter fullscreen mode Exit fullscreen mode

We can store this file in dotfiles, Github, Gists, Gitlab, Dropbox, or evenemail and then run the following command to install all the packages i.e., fornew installations:

$ apm install --packages-file atom-packages.txt

Enter fullscreen mode Exit fullscreen mode

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

AWS GenAI Live!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️