Pi:CLI

From SpecNext official Wiki
Jump to: navigation, search

Abstract

The NextPi CLI API is a series of "supported" command-line tools designed to make performing specific Pi orientated tasks easier for Spectrum Next application developers.

The CLI API commands are built out of two parts - known as "Frontends" and "Backends". "Frontends" commands all begin with nextpi- and broken into logical groups (e.g. nextpi-console_, nextpi-play_, nextpi-admin_, etc) - this naming convention allows you to easily tell at a glance what kind of function a command will perform, and for you to know that your commands should continue to work in future NextPi patches.

More About Frontends & Backends

The Frontend commands often perform their operations via the means of various internal system APIs - in a more traditional Linux setup these Frontends would be called "wrapper scripts". The underlying system tools used by Frontends are what we referred to as Backends - and you'll often see this term used on individual API CLI pages.

The use of a "formal CLI API" via these Frontend wrappers permits several things:

  • The addition of extra options and commandline switches not present in the backends;
  • The inclusion of default parameters for many of the commands, or to save boilerplate options; and
  • A way of "future-proofing" should the backend need to change for any reason.

Many of the backends support additional options, which can be found by reading the documentation for the individual backends (not included in this wiki) - while this may provide you with extra functionality, it comes at the cost of no assurance that these "undocument features" will also continue to work in future NextPi patches.

Defining "supported"

In the context of the CLI API "supported" means we will try with "best effort" to ensure that documented usage patterns will continue to work. It does not mean that they come with any warrenty of "technical support", actual or implied - to make these APIs work with your own code. Developer support is community provided, and if you're looking for help the best place to try is the Official Spectrum Next discord, found at https://zxn.gg/discord.

CLI commands

  • nextpi-admin_clean
  • nextpi-admin_disable
  • nextpi-admin_enable
  • nextpi-admin_pupextract
  • nextpi-admin_report
  • nextpi-admin_uihelper
  • nextpi-admin_update
  • nextpi-admin_version
  • nextpi-audio_loopback
  • nextpi-cache
  • nextpi-cache_bucket
  • nextpi-console_image
  • nextpi-console_resolution
  • nextpi-dongle_disable
  • nextpi-dongle_enable
  • nextpi-echo_disable
  • nextpi-echo_enable
  • nextpi-file_delete
  • nextpi-file_receive
  • nextpi-file_rename
  • nextpi-file_stream
  • nextpi-file_transmit
  • nextpi-gpio_mode
  • nextpi-input_xbox
  • nextpi-play_midiLQ
  • nextpi-play_midiHQ
  • nextpi-play_midiMQ
  • nextpi-play_mod
  • nextpi-play_mp3
  • nextpi-play_sid
  • nextpi-play_silence
  • nextpi-play_sndh
  • nextpi-play_stock
  • nextpi-play_stop
  • nextpi-plus_activate
  • nextpi-plus_list
  • nextpi-plus_lock
  • nextpi-plus_unlock
  • nextpi-tzx_load
  • nextpi-ui_file
  • nextpi-ui_texteditor
  • nextpi-z88dk_switch