atom-script 0,0,2,0,4,0,4,1 travis-ci npm

:runner: Run ( scripts | selections | source ) in Atom

3 years after MIT


Build Status

Run code in Atom!

Run scripts based on file name, a selection of code, or by line number.

Currently supported grammars are:

Grammar File Based Selection Based Notes
1C (BSL) Yes Runs through OneScript interpreter in console mode
Ansible Yes
AutoHotKey Yes Yes Requires the path of 'AutoHotKey.exe' in your system environment variables.
AppleScript Yes Yes
Babel ES6 JS Yes Yes
Bash Yes Yes The shell used is based on your default $SHELL environment variable
Batch Yes
Behat Feature Yes
BuckleScript Yes Yes
C Yes Yes Only available on OSX (xcrun clang) and Linux (cc)
C# Yes Yes Requires the path of 'csc.exe' in your system environment variables
C# Script Yes Yes
C++ Yes Yes Requires -std=c++14. Only available on OSX (xcrun clang++) and Linux (g++)
Clojure Yes Yes Clojure scripts are executed via Leiningen's exec plugin. Both Leiningen and exec must be installed
CoffeeScript Yes Yes
CoffeeScript (Literate) Yes Yes Running selections of code for CoffeeScript (Literate) only works when selecting just the code blocks
Crystal Yes Yes
Cucumber (Gherkin) Yes
D Yes Yes
Dart Yes Yes
DOT (Graphviz) Yes Yes
Elixir Yes Yes
Erlang Yes Uses erl for limited selection based runs (see #70)
F# Yes
F* Yes
Fish Yes Yes Finally, a way to run code within Atom for the 90s
Forth (via GForth) Yes
Fortran (via gfortran) Yes
Gnuplot Yes
Go Yes
Groovy Yes Yes
Haskell Yes Yes
Hy Yes Yes Requires the path of 'hy.exe' in your system environment variables. This is probably already fulfilled if you used pip install hy to get Hy. A Hy grammar, such as this one is also a good idea.
IcedCoffeeScript Yes Yes
Inno Setup Yes Requires the path of ISCC.exe in your system environment variables
ioLanguage Yes Yes
Java Yes Windows users should manually add jdk path (...\jdk1.x.x_xx\bin) to their system environment variables
Javascript Yes Yes
JavaScript for Automation (JXA) Yes Yes
Jolie Yes
Julia Yes Yes
Kotlin Yes Yes
LaTeX (via latexmk) Yes
LilyPond Yes
Lisp (via SBCL) Yes Yes Selection based runs are limited to single line
Literate Haskell Yes
LiveScript Yes Yes
Lua Yes Yes
Lua (WoW) Yes Yes
Makefile Yes Yes
MIPS Yes Requires the path of spim in your system environment variables
MongoDB Yes Yes
MoonScript Yes Yes
NCL Yes Yes Scripts must end with exit command for file based runs
newLISP Yes Yes
Nim (and NimScript) Yes
NSIS Yes Yes
Objective-C Yes Only available on OSX (xcrun clang)
Objective-C Yes Only available on OSX (xcrun clang++)
OCaml Yes
Octave Yes Yes
Oz Yes Yes
Pandoc Markdown Yes Requires the panzer pandoc wrapper and the pandoc-flavored-markdown language package in Atom
Perl Yes Yes
Perl 6 Yes Yes
PHP Yes Yes
PostgreSQL Yes Yes Requires the atom-language-pgsql package in Atom Connects as user $PGUSER to database $PGDATABASE. Both default to the operating system's user name and both can be set in the process environment or in Atom's script: process.env.PGUSER = ⟨username⟩ and process.env.PGDATABASE = ⟨database name⟩
PowerShell Yes Yes
Processing Yes Runs through processing-java.
Prolog Yes Scripts must contain a rule with the head main (e.g.main:- parent(X,lucas),writeln(X).). The script is executed with the goal main and is halted after the first result is found. The output is produced by the writeln/1 predicates. It requires swipl
Python Yes Yes
R Yes Yes
Racket Yes Yes
RANT Yes Yes
Reason Yes Yes
RSpec Yes Yes
Ruby Yes Yes
Ruby on Rails Yes Yes
Rust Yes
Sage Yes Yes
Sass/SCSS Yes
Scala Yes Yes
Scheme Yes Yes
Shell Script Yes Yes The shell used is based on your default $SHELL environment variable
Standard ML Yes
Stata Yes Yes Runs through Stata. Note stata needs to be added to your system PATH for this to work. Mac directions <>_ .
Swift Yes
Tcl Yes Yes
TypeScript Yes Yes Requires ts-node
Zsh Yes Yes The shell used is based on your default $SHELL environment variable

NOTE: Some grammars may require you to install a custom language package.

You only have to add a few lines in a PR to support another.


apm install script


Search for script within package search in the Settings View.

Atom can't find node | ruby | python | my socks

Make sure to launch Atom from the console/terminal. This gives atom all your useful environment variables. Additionally, make sure to run it with the project path you need. For example, use

atom .

to get it to run with the current directory as the default place to run scripts from.

If you really wish to open atom from a launcher/icon, see this issue for a variety of workarounds that have been suggested.


Make sure to run atom from the command line to get full access to your environment variables. Running Atom from the icon will launch using launchctl's environment.

Script: Run will perform a "File Based" run when no text is selected (default).

Script: Run while text is selected will perform a "Selection Based" run executing just the highlighted code.

Script: Run by Line Number to run using the specified line number. Note that if you select an entire line this number could be off by one due to the way Atom detects numbers while text is selected.

Script: Configure Script should be used to configure command options, program arguments, and environment variables overrides. Environment variables may be input into the options view in the form VARIABLE_NAME_ONE=value;VARIABLE_NAME_TWO="other value";VARIABLE_NAME_3='test'.

Also, in this dialog you can save options as a profile for future use. For example, you can add two profiles, one for python2.7 and another for python3 and run scripts with a specified profile, which will be more convinient than entering options every time you want to switch python versions.

Script: Run with profile allows you to run scripts with saved profiles. Profiles can be added in Script: Run Options dialog.

Script: Kill Process will kill the process but leaves the pane open.

Script: Close View closes the pane and kills the process.

To kill everything, click the close icon in the upper right and just go back to coding.

Script: Copy Run Results copies everything written to the output pane to the clipboard, allowing you to paste it into the editor.

Command and shortcut reference

Command Mac OS X Linux/Windows Notes
Script: Run cmd-i shift-ctrl-b If text is selected a "Selection Based" is used instead of a "File Based" run
Script: Run by Line Number shift-cmd-j shift-ctrl-j If text is selected the line number will be the last
Script: Run Options shift-cmd-i shift-ctrl-alt-o Runs the selection or whole file with the given options
Script: Run with profile shift-cmd-k shift-ctrl-alt-b Runs the selection or whole file with the specified profile
Script: Close View esc or ctrl-w esc Closes the script view window
Script: Kill Process ctrl-c ctrl-q Kills the current script process


The following parameters will be replaced in any entry in args (command and program arguments). They should all be enclosed in curly brackets {}

  • {FILE_ACTIVE} - Full path to the currently active file in Atom. E.g. /home/rgbkrk/atom-script/lib/
  • {FILE_ACTIVE_PATH} - Full path to the folder where the currently active file is. E.g. /home/rgbkrk/atom-script/lib
  • {FILE_ACTIVE_NAME} - Full name and extension of active file. E.g.,
  • {FILE_ACTIVE_NAME_BASE} - Name of active file WITHOUT extension. E.g., script
  • {PROJECT_PATH} - Full path to the root of the project. This is normally the path Atom has as root. E.g /home/rgbkrk/atom-script

Parameters are compatible with atom-build package.


This is an Open Open Source Project, which means:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit.

As for coding and contributing, rely on the atom contributing guidelines. They're pretty sane.

Quick and dirty setup

apm develop script

This will clone the script repository to ~/github unless you set the ATOM_REPOS_HOME environment variable.

I already cloned it!

If you cloned it somewhere else, you'll want to use apm link --dev within the package directory, followed by apm install to get dependencies.


After pulling upstream changes, make sure to run apm update.

To start hacking, make sure to run atom --dev from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback!

Related Repositories



An AngularJS package for Github's Atom editor ...



ironSource.atom SDK for Javascript at the browser ...



Interactive programming for Atom ...



A script to monitor Atom feeds and create Growl notitifcations for new entries ...



Atom/Github Perl 6 Syntax Highlighting Support »ö« ...

Top Contributors

rgbkrk erran nixel2007 Lbatson EntilZha s1mplex smashwilson idleberg fscherwi danielbayley Stormherz TheBrenny A-Manning mattddowney pardom Calyhre Allieway Chosko erip liamdawson hansrodtang oderwat Huaraz2 alton-campbell Teggy XSStudio ciarand hurrymaplelad azawawi bremme


package version
ansi-to-html ^0.4.2
atom-message-panel 1.2.7
atom-space-pen-views ^2.0.3
uuid ^3.0.1
strip-ansi ^3.0.0
underscore ^1.8.3
dev babel-eslint ^7.1.1
eslint ^3.11.1
eslint-config-airbnb-base ^10.0.1
eslint-plugin-import ^2.2.0


-   v3.10.1 zip tar
-   v3.10.0 zip tar
-   v3.9.0 zip tar
-   v3.8.3 zip tar
-   v3.8.2 zip tar
-   v3.8.1 zip tar
-   v3.8.0 zip tar
-   v3.7.3 zip tar
-   v3.7.2 zip tar
-   v3.7.1 zip tar
-   v3.7.0 zip tar
-   v3.6.3 zip tar
-   v3.6.2 zip tar
-   v3.6.1 zip tar
-   v3.6.0 zip tar
-   v3.5.2 zip tar
-   v3.5.1 zip tar
-   v3.5.0 zip tar
-   v3.4.1 zip tar
-   v3.4.0 zip tar
-   v3.3.0 zip tar
-   v3.2.0 zip tar
-   v3.1.0 zip tar
-   v3.0.2 zip tar
-   v3.0.1 zip tar
-   v3.0.0 zip tar
-   v2.29.0 zip tar
-   v2.28.0 zip tar
-   v2.27.0 zip tar
-   v2.26.4 zip tar