Difference between revisions of "Pi:CLI"

From SpecNext official Wiki
Jump to: navigation, search
(Created page with "* nextpi-admin_clean * nextpi-admin_disable * nextpi-admin_enable * nextpi-admin_report * nextpi-admin_update * nextpi-admin_version * nextpi-audio_loopback * nextpi-cache * n...")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== 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 <code>nextpi-</code> and broken into logical groups (e.g. <code>nextpi-console_</code>, <code>nextpi-play_</code>, <code>nextpi-admin_</code>, 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_clean
 
* nextpi-admin_disable
 
* nextpi-admin_disable
 
* nextpi-admin_enable
 
* nextpi-admin_enable
 +
* nextpi-admin_pupextract
 
* nextpi-admin_report
 
* nextpi-admin_report
 +
* nextpi-admin_uihelper
 
* nextpi-admin_update
 
* nextpi-admin_update
 
* nextpi-admin_version
 
* nextpi-admin_version
Line 8: Line 33:
 
* nextpi-cache
 
* nextpi-cache
 
* nextpi-cache_bucket
 
* nextpi-cache_bucket
 +
* [[Pi:console_image|nextpi-console_image]]
 +
* [[Pi:console_resolution|nextpi-console_resolution]]
 
* nextpi-dongle_disable
 
* nextpi-dongle_disable
 
* nextpi-dongle_enable
 
* nextpi-dongle_enable
Line 17: Line 44:
 
* nextpi-file_stream
 
* nextpi-file_stream
 
* nextpi-file_transmit
 
* nextpi-file_transmit
 +
* [[Pi:gpio_mode|nextpi-gpio_mode]]
 
* nextpi-input_xbox
 
* nextpi-input_xbox
 +
* nextpi-play_midiLQ
 +
* nextpi-play_midiHQ
 +
* nextpi-play_midiMQ
 
* nextpi-play_mod
 
* nextpi-play_mod
 
* nextpi-play_mp3
 
* nextpi-play_mp3
Line 23: Line 54:
 
* nextpi-play_silence
 
* nextpi-play_silence
 
* nextpi-play_sndh
 
* nextpi-play_sndh
 +
* nextpi-play_stock
 +
* nextpi-play_stop
 
* nextpi-plus_activate
 
* nextpi-plus_activate
 
* nextpi-plus_list
 
* nextpi-plus_list
Line 30: Line 63:
 
* nextpi-ui_file
 
* nextpi-ui_file
 
* nextpi-ui_texteditor
 
* nextpi-ui_texteditor
 +
* nextpi-z88dk_switch

Latest revision as of 13:59, 6 February 2024

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