Nexss Programmer Cheat sheet


Start

nexss program.r
nexss program.[any extension]
npx nexss program.r # without installing nexss
nexss file add my.rs --edit # Will open list of templates for particular language, install editor (if not exists) and open file for editing. 

nexss php run "print('x');" # 2.2.37+
nexss py run "print('x')"  # 2.2.37+
  • NEW: easy shortcuts: nexss py d (creates file with default template), nexss py h (with helloWorld template), nexss py e (and empty file - if exists in the templates - !empty.[extension]) (2.4.8+)

Cache

Nexss Programmer keep cache from the language configurations for efficiency. Use nexss cache rebuild (2.2.38+) to rebuild cache.

nexss cache rebuild # 2.2.38+

Quick/Helper functions (-)

Nexss programmer has some quick functions which helps during development of Nexss Programmer packages but not only..

  • -help list of quick functions / nexss -help
    image
  • -env
    image
# run packages/commands folder .nexss/packages
nexss Id # runs Id package from .nexss/packages/Id
nexss Id help # shows help for Id package
# below adds Debug package to the project AND copy package 
# to the project so you can customize it for your needs
nexss pkg add Id --copyPackage --saveNexss  --forceNexss  

nexss myprogram.ext --nxsOnly # will run without input of Nexss Programmer, 
# so if you wish take input from the user and not use defaults of Nexss Programmer Project like "cwd", "start", "nexss". Nexss Programmer:  2.1.2+
nxs program.ext # is the same as above so: nexss myprogram.ext --nxsOnly // Nexss Programmer: 2.1.2+

Debug Run

From version 2.1 there is new feature --nxsDebug which shows detailed information during project, or .nexss files run. Shows also how the data is changing during execution.

nexss myfile.js --nxsDebug
nexss myfile.nexss --nxsDebug
nexss MyProject --nxsDebug
nexss MyProject --nxsDebug=2 # different view of debugging
nexss MyProject --nxsDebug=nodiff # will display data, not the changes of the data.

nxsStop

if you pass nxsStop either in --nxsStop or in the data inside like in the package, the nexss programmer will stop in the next line.

Dry Run

nexss Id --nxsDry # nxsDry (not execute anything - info) - only **2.1+** version

Start Data

Example command: nexss Id

By default Nexss Programmer has some data filled in:

  • start - timestamp in millisecond
  • cwd - Current Working Directory - This is very handy, as many times you will be using different modules where cwd pointing just to the current directory (not module one).
  • nexss - contains nexss version

Pipe Nexss Commands as well as others

image

Parameters

All below can also be used in the json file eg. config.json. (Nexss Programmer 2.1.0+)

# parameters with not alphanumeric characters like ,(comma) needs to be surrounded by " or '
nexss Data/Concat --concatFields="cwd,debug" 
# From version 2.0.9 you can pass/combine parameters in the command line eg:
# eg:
nexss Id --x=myfolder --myenv='${process.env.NEXSS_APPS_PATH}\\${x}'
nexss id --x=1000 --y=2 --sum='${x+y}' --pow='${x**y}'# ${} must be surrounded only by ' not " !!

# from 2.1
nexss Id --arch='${process.arch===\"x64\"?64:32}'

# $# is special parameter which basically do nothing. you can however set variables etc.
nexss $# --x.x='test'
# {"x":{"x":"test"},"nexss":"2.3.7"}

nexss $# --x*x=test --x:x=test -x[x]=test

# ,  needs to be surrounded by " (see below) as on windows has different look
# below works on Linux and Win
nexss $# --'x,x'=test
# Result different on Linux and Windows
nexss $# --x,x=test
# Linux {"x,x":"test","nexss":"2.3.7"}
# Windows {"x x":"test","nexss":"2.3.7"}

Global

nexss --version # eg. 2.0.6
nexss myprogram.js --nxsFields="cwd,debug" # will display only cwd and debug data fields (" is required)
nexss myprogram.js --nxsField=cwd # will only display value of cwd (So current working directory)

Files

# Without Nexss Programmer Project

nexss file # displays help for file and available commands
nexss file add randomfile.js #should show templates select helloWorld
nexss file add randomfile.js #this should show that file exists
nexss file add randomfile.js --template=x # also already exists
nexss file delete randomfile.js # Should  see You are not in the Nexss Programmer Project
rm randomfile.js # file is removed.
nexss file add randomfile.js --template=helloWorld # Adds new file from template HelloWorld
nexss randomfile.js # run file: Json should contain "NodeJSOutput":"Hello from NodeJS!

#With Nexss Programmer Project
nexss project new MyProject #should display among others 'Project 'MyProject' is ready'
cd MyProject
nexss file add file1.js # should display file src/file1.js has been created
nexss project info # should display information about project

image

nexss . #run the whole project, now there is one file 
cd .. # go to previous folder
nexss MyProject  # nexss allow also run project by specyfying the folder and run the project inside
nexss pkg add Mouse/Move --x=1 --y=1 --saveNexss # this add move mouse to the position of 1x1 so left top corner 
# when we start the project, mouse move will be at the second position (keep in mind that you can pass 
data through the packages and files so all data created in the file file1.js will be available in the package Mouse/Move)
# you can edit packages by copying them local using --CopyPackage more: nexss pkg help
# next you can add another file let say perl:
nexss file add my.pl # this will be run after mouse move
nexss . # start project again
nexss project new myproject # or nexss p new myproject
cd myproject
nexss start # OR nexss s OR nexss .     - run the project
nexss s --server # if you don't have specified server, this will start the server at 127.0.0.1
# path in the url becoming sequence eg.
# http://localhost:8080/myseq1/abc will load myseq/abc sequence
nexss s --verbose # this will display all extra information during run
nexss project info # or nexss p i - display info about project

Packages (Nexss Projects)

nexss pkg list --json # list of available packages
nexss pkg l ocr --json # Search for OCR packages with json output
nexss package list video # List Video related packages
nexss pkg init # install all packages dependencies. It is run during first run of nexss.
# Add Packages/Actions
# Adds Show Desktop to the package
# copyPackage will copy Nexss Package to your project (and you can modify it).
nexss pkg add Keyboard --type="#d" --copyPackage --saveNexss --forceNexss 

Specific language commands

nexss js # display all available specific language commands
nexss js pm # displays package managers available for JavaScript/NodeJS (select your language).
nexss js compilers # displays compilers
nexss js errors # displays errors and supports available for particular language
nexss js default compiler # displays compilers available for the language
nexss js default compiler node # set the default compiler - it may install and change the current one
nexss js default compiler unset # unset the default compiler so it will be taken first from the config 

Config (nexss config)

nexss config get --json
nexss config get --json --select sequences # for now the select only works with --json flag
# for --select only JSON works for now.
nexss config get --configPath c:/Users/mapoart/.nexss/packages/Nexss/Test/Sequences --select sequences --json

Test

nexss test # displays available tests. If you are in the project it will look at the test folder of the project. If you want to run "global" tests for nexss programmer itself go to the any folder which is not a Nexss Programmer project and run 'nexss test' again. nexss test languages # This is a long time taking command. It will install all compilers and test the languages by default and helloWorld templates to make sure everything works.

Run different Nexss Programmer envs (different languages/packages/defaults etc)

Nexss Programmer has special env variable which can be changed to work with different environment, cache etc.

Powershell

$env:NEXSS_HOME_PATH = "C:/Users/mapoart/.nexssSomethingElse/"
nexss -env --nocache # This page will confirm that env has been changed.
[System.Environment]::SetEnvironmentVariable('NEXSS_HOME_PATH','C:/Users/mapoart/.nexssSomethingElse/',[System.EnvironmentVariableTarget]::User)

Messages and Errors

Nexss Programmer display messsages and errors during run. It's a bit special because every message or error going through STDERR package

  • NEXSS/ok:My ok message
    image
  • NEXSS/info:My info message
    image
  • NEXSS/error:Just display error message
    image
  • NEXSS/warn:Display warning message
    image
  • If you put to the STDERR text it will display as error with extra information inside eg: image
  • For debuging the Nexss Programmer CLI App use trace
  • NEXSS/trace:Display trace message
    image