scripting-cli
v1.2.5
Published
This plugin integrates the desktop editor synchronization feature of the Scripting app.
Readme
Scripting App Command-Line Tool
Welcome to the scripting-cli, the command-line tool designed for integrating with the Scripting app. This tool allows you to synchronize and preview your scripts in real-time as you develop them using your favorite desktop editor, such as VSCode.
中文 | 日本語 | Deutsch | Français | Italiano
Prerequisites
Before using scripting-cli, ensure the following requirements are met:
Node.js: Make sure you have a recent version of Node.js installed. To check your current version, run:
node -vScripting App: The Scripting app must be installed in order to connect with the local service started by
scripting-cli.
Installation
There’s no need to install scripting-cli globally. Simply run it using npx:
npx scripting-cli <command>Usage
1. Create a Working Directory
Start by creating a directory where your Scripting app scripts will reside. For example:
mkdir my-scripting-project
cd my-scripting-project2. Start the Local Service
In your working directory, run the following command to start the local development service:
npx scripting-cli startBy default, this starts the service on port 3000. To specify a different port, use the --port option:
npx scripting-cli start --port=4000To enable Bonjour support—allowing the Scripting app to automatically detect the local service—add the --bonjour flag:
npx scripting-cli start --bonjour3. Connect the Scripting App
Once the service is running, open the Scripting app and connect to the local service you just started. This establishes a connection between the app and your working directory.
4. Debug and Synchronize Your Code
After connecting, select the script project you want to debug. The Scripting app will automatically sync the project’s code with your working directory.
5. Real-Time Code Synchronization
As you write and save scripts using your desktop editor (e.g., VSCode), the changes will automatically sync with the Scripting app and be executed in real-time—making development and debugging much smoother.
Example Workflow
Start the local service:
npx scripting-cli startOpen your editor and write your script.
Save the script file.
The updated code is automatically synchronized with the Scripting app and executed.
Additional Information
The default port is
3000. If it’s already in use, specify a different one with the--portoption.Use the
--no-auto-openflag to prevent the tool from openingindex.tsxorwidget.tsxautomatically:npx scripting-cli start --no-auto-openTo use the Bonjour service, ensure your system supports it. On Windows, you may need to install Bonjour manually. Then, use the
--bonjouroption to enable it.This tool is ideal for users who prefer desktop editors like VSCode and want seamless code synchronization and debugging with the Scripting app.
Troubleshooting
If you encounter issues:
- Ensure you're using Node.js version 20 or higher.
- Verify the Scripting app is properly connected to the local service.
- Make sure no other process is occupying your chosen port.
- Always run the tool using
npx scripting-cli <command>, and check that the package is up to date.
Enjoy using scripting-cli in your Scripting app development workflow. Happy coding!
